Search Results for

    Show / Hide Table of Contents

    Class MultiFileTextReader

    A text reader which virtually concatenates a number of text files and allows sequential reading from this file set.

    Inheritance
    System.Object
    System.MarshalByRefObject
    System.IO.TextReader
    MultiFileTextReader
    Implements
    System.IDisposable
    Inherited Members
    System.IO.TextReader.Null
    System.IO.TextReader.Dispose()
    System.IO.TextReader.Dispose(System.Boolean)
    System.IO.TextReader.ReadLineAsync()
    System.IO.TextReader.ReadToEndAsync()
    System.IO.TextReader.ReadAsync(System.Char[], System.Int32, System.Int32)
    System.IO.TextReader.ReadBlockAsync(System.Char[], System.Int32, System.Int32)
    System.IO.TextReader.Synchronized(System.IO.TextReader)
    System.MarshalByRefObject.MemberwiseClone(System.Boolean)
    System.MarshalByRefObject.GetLifetimeService()
    System.MarshalByRefObject.InitializeLifetimeService()
    System.MarshalByRefObject.CreateObjRef(System.Type)
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Sdl.LanguagePlatform.IO
    Assembly: Sdl.LanguagePlatform.IO.dll
    Syntax
    public class MultiFileTextReader : TextReader, IDisposable

    Constructors

    MultiFileTextReader(DirectoryInfo, String, Boolean)

    Instantiates a MultiFileTextReader which works on the files contained in the specified directory and its subdirectories.

    Declaration
    public MultiFileTextReader(DirectoryInfo rootDirectory, string fileFilter, bool recurse)
    Parameters
    Type Name Description
    System.IO.DirectoryInfo rootDirectory

    The directory in which to search for applicable files.

    System.String fileFilter

    If non-null, only files which match the filter are added to the file set (see System.IO.DirectoryInfo.GetFiles()).

    System.Boolean recurse

    If true, subdirectories are scanned for matching false. Otherwise, only files in the specified root directory are considered.

    MultiFileTextReader(FileInfo[])

    Instantiates a MultiFileTextReader which works on the specified set of files. The files are opened with BOM sniffing defaulting to UTF8 encoding.

    Declaration
    public MultiFileTextReader(params FileInfo[] files)
    Parameters
    Type Name Description
    System.IO.FileInfo[] files

    MultiFileTextReader(String[])

    Instantiates a MultiFileTextReader which works on the files or directories passed as the parameter. Directories are recursed into, files are opened UTF8 with BOM sniffing.

    Declaration
    public MultiFileTextReader(params string[] filesOrDirectories)
    Parameters
    Type Name Description
    System.String[] filesOrDirectories

    The set of file names or directory names to work on

    Properties

    CurrentFile

    Allows access to the FileInfo of the currently worked-on file. If null, EOF has been reached.

    Declaration
    public FileInfo CurrentFile { get; }
    Property Value
    Type Description
    System.IO.FileInfo

    Methods

    Close()

    Closes the overall file set. An attempt to read more data will lead to an exception.

    Declaration
    public override void Close()
    Overrides
    System.IO.TextReader.Close()

    Peek()

    Not implemented.

    Declaration
    public override int Peek()
    Returns
    Type Description
    System.Int32

    Always throws exception.

    Overrides
    System.IO.TextReader.Peek()

    Read()

    Reads the next character from the set of input files, advances the current file as necessary.

    Declaration
    public override int Read()
    Returns
    Type Description
    System.Int32

    The next input character or -1 if EOF (of the concatenation) is reached.

    Overrides
    System.IO.TextReader.Read()

    Read(Char[], Int32, Int32)

    Reads a block of characters from the virtual concatenation of text files.

    Declaration
    public override int Read(char[] buffer, int index, int count)
    Parameters
    Type Name Description
    System.Char[] buffer

    The buffer to store the data in (see TextReader.Read())

    System.Int32 index

    The index to start storing characters in the buffer.

    System.Int32 count

    The maximum number of characters to read

    Returns
    Type Description
    System.Int32

    0 on EOF, or the number of characters read which may be 0 < n <= count

    Overrides
    System.IO.TextReader.Read(System.Char[], System.Int32, System.Int32)

    ReadBlock(Char[], Int32, Int32)

    Reads a block of characters from the virtual concatenation of text files.

    Declaration
    public override int ReadBlock(char[] buffer, int index, int count)
    Parameters
    Type Name Description
    System.Char[] buffer

    The buffer to store the data in (see TextReader.Read())

    System.Int32 index

    The index to start storing characters in the buffer

    System.Int32 count

    The number of characters to read

    Returns
    Type Description
    System.Int32

    The number of characters read. Unlike Read(buffer, index, count), this method will always attempt to read count characters and will automatically advance to the next file if the current file does not contain enough data.

    Overrides
    System.IO.TextReader.ReadBlock(System.Char[], System.Int32, System.Int32)

    ReadLine()

    Reads the next line of input from the concatenation of text files.

    Declaration
    public override string ReadLine()
    Returns
    Type Description
    System.String
    Overrides
    System.IO.TextReader.ReadLine()

    ReadToEnd()

    Not implemented.

    Declaration
    public override string ReadToEnd()
    Returns
    Type Description
    System.String

    Always throws exception.

    Overrides
    System.IO.TextReader.ReadToEnd()

    Explicit Interface Implementations

    IDisposable.Dispose()

    Declaration
    void IDisposable.Dispose()

    Implements

    System.IDisposable

    On this page

    • Constructors
      • MultiFileTextReader(DirectoryInfo, String, Boolean)
      • MultiFileTextReader(FileInfo[])
      • MultiFileTextReader(String[])
    • Properties
      • CurrentFile
    • Methods
      • Close()
      • Peek()
      • Read()
      • Read(Char[], Int32, Int32)
      • ReadBlock(Char[], Int32, Int32)
      • ReadLine()
      • ReadToEnd()
    • Explicit Interface Implementations
      • IDisposable.Dispose()
    • Implements
    Back to top Generated by DocFX