Sign in Join
FPDoc Onlineexperiment

TStringStream.Create constructor

Member of TStringStreampublicIn unit Classes

Creates a new stringstream and sets its initial content.

Declaration

pascal
constructor Create(const ABytes: TBytes); override; overload
constructor Create; overload
constructor Create(const AString: AnsiString); overload
constructor Create(const AString: Ansistring; AEncoding: TEncoding; 
 AOwnsEncoding: Boolean=True); overload
constructor Create(const AString: Ansistring; ACodePage: Integer)
 ; overload
constructor Create(const AString: UnicodeString); overload
constructor Create(const AString: UnicodeString; AEncoding: TEncoding; 
 AOwnsEncoding: Boolean=True); overload
constructor Create(const AString: UnicodeString; ACodePage: Integer)
 ; overload

Description

Create creates a new TStringStream instance and sets its initial content to Astring. The position is still 0 but the size of the stream will equal the length of the string.

The Encoding argument specifies the codepage with which the bytes in the string will be interpreted. If it is not specified (or Nil) the system default encoding will be used. The correct encoding can be detected from the string by using the CreateRaw constructor.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.