Skip to content

Commit

Permalink
Split ctor for the future. See #14.
Browse files Browse the repository at this point in the history
  • Loading branch information
aloisdg committed Apr 26, 2015
1 parent 0b4347a commit 99ec986
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Counter/Document.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using Counter.Documents.Archives;

namespace Counter
Expand All @@ -27,7 +28,7 @@ private readonly Dictionary<string, DocumentType> _extensionsSupported
{ ".odt", DocumentType.Odt }
};

public Document(string fullName, Stream stream)
public Document(string fullName)
{
FullName = fullName;
Name = Path.GetFileName(Name);
Expand All @@ -36,6 +37,12 @@ public Document(string fullName, Stream stream)
ExtensionType = IsSupported(Extension)
? _extensionsSupported[Extension]
: DocumentType.Unknow;
}

public Document(string fullName, Stream stream)
: this(fullName)
{

Count = !ExtensionType.Equals(DocumentType.Unknow)
? BuildDocument(stream).Count
: 0;
Expand Down

0 comments on commit 99ec986

Please sign in to comment.