Download Now

    Reference TAggregateStream

    Declared in Codebot.Collections.pas on line 367

    TAggregateStream reads a series of text, files, and streams as if they were one continuous stream
      TAggregateStream = class(TStream)
      protected
        function GetSize: Int64; override;
      public
        { Create an empty aggregate stream }
        constructor Create;
        { Destroy the aggregate stream and any streams it owns }
        destructor Destroy; override;
        { Remove all streams }
        procedure Clear;
        { Add a block of text to the end }
        procedure AddText(const Text: string);
        { Add the contents of a file to the end }
        procedure AddFile(const FileName: string);
        { Add a stream to the end optionally taking ownership of it }
        procedure AddStream(Stream: TStream; OwnsStream: Boolean = True);
        { Read bytes moving through each stream in order }
        function Read(var Buffer; Count: Longint): Longint; override;
      end;