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
    object
    MarshalByRefObject
    TextReader
    MultiFileTextReader
    Implements
    IDisposable
    Inherited Members
    TextReader.Null
    TextReader.Dispose()
    TextReader.Dispose(bool)
    TextReader.ReadLineAsync()
    TextReader.ReadToEndAsync()
    TextReader.ReadAsync(char[], int, int)
    TextReader.ReadBlockAsync(char[], int, int)
    TextReader.Synchronized(TextReader)
    MarshalByRefObject.MemberwiseClone(bool)
    MarshalByRefObject.GetLifetimeService()
    MarshalByRefObject.InitializeLifetimeService()
    MarshalByRefObject.CreateObjRef(Type)
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Sdl.LanguagePlatform.IO
    Assembly: Sdl.LanguagePlatform.IO.dll
    Syntax
    public class MultiFileTextReader : TextReader, IDisposable

    Constructors

    MultiFileTextReader(DirectoryInfo, string, bool)

    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
    DirectoryInfo rootDirectory

    The directory in which to search for applicable files.

    string fileFilter

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

    bool recurse

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

    MultiFileTextReader(params 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
    FileInfo[] files

    MultiFileTextReader(params 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
    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
    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
    TextReader.Close()

    Peek()

    Not implemented.

    Declaration
    public override int Peek()
    Returns
    Type Description
    int

    Always throws exception.

    Overrides
    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
    int

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

    Overrides
    TextReader.Read()

    Read(char[], int, int)

    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
    char[] buffer

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

    int index

    The index to start storing characters in the buffer.

    int count

    The maximum number of characters to read

    Returns
    Type Description
    int

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

    Overrides
    TextReader.Read(char[], int, int)

    ReadBlock(char[], int, int)

    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
    char[] buffer

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

    int index

    The index to start storing characters in the buffer

    int count

    The number of characters to read

    Returns
    Type Description
    int

    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
    TextReader.ReadBlock(char[], int, int)

    ReadLine()

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

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

    ReadToEnd()

    Not implemented.

    Declaration
    public override string ReadToEnd()
    Returns
    Type Description
    string

    Always throws exception.

    Overrides
    TextReader.ReadToEnd()

    Implements

    IDisposable
    In this article
    • Constructors
      • MultiFileTextReader(DirectoryInfo, string, bool)
      • MultiFileTextReader(params FileInfo[])
      • MultiFileTextReader(params string[])
    • Properties
      • CurrentFile
    • Methods
      • Close()
      • Peek()
      • Read()
      • Read(char[], int, int)
      • ReadBlock(char[], int, int)
      • ReadLine()
      • ReadToEnd()
    • Implements
    Back to top Generated by DocFX