|
@@ -76,16 +76,16 @@ const
|
|
|
|
|
|
{ TParser special tokens }
|
|
|
|
|
|
- toEOF = Char(0);
|
|
|
- toSymbol = Char(1);
|
|
|
- toString = Char(2);
|
|
|
- toInteger = Char(3);
|
|
|
- toFloat = Char(4);
|
|
|
- toWString = Char(5);
|
|
|
+ toEOF = AnsiChar(0);
|
|
|
+ toSymbol = AnsiChar(1);
|
|
|
+ toString = AnsiChar(2);
|
|
|
+ toInteger = AnsiChar(3);
|
|
|
+ toFloat = AnsiChar(4);
|
|
|
+ toWString = AnsiChar(5);
|
|
|
|
|
|
Const
|
|
|
- FilerSignature : Array[1..4] of char = 'TPF0';
|
|
|
- FilerSignature1 : Array[1..4] of char = 'TPF1';
|
|
|
+ FilerSignature : Array[1..4] of Ansichar = 'TPF0';
|
|
|
+ FilerSignature1 : Array[1..4] of Ansichar = 'TPF1';
|
|
|
|
|
|
type
|
|
|
{ Text alignment types }
|
|
@@ -623,9 +623,9 @@ type
|
|
|
FMissingNameValueSeparatorAction: TMissingNameValueSeparatorAction;
|
|
|
FSpecialCharsInited : boolean;
|
|
|
FAlwaysQuote: Boolean;
|
|
|
- FQuoteChar : Char;
|
|
|
- FDelimiter : Char;
|
|
|
- FNameValueSeparator : Char;
|
|
|
+ FQuoteChar : AnsiChar;
|
|
|
+ FDelimiter : AnsiChar;
|
|
|
+ FNameValueSeparator : AnsiChar;
|
|
|
FUpdateCount: Integer;
|
|
|
FAdapter: IStringsAdapter;
|
|
|
FLBS : TTextLineBreakStyle;
|
|
@@ -653,19 +653,19 @@ type
|
|
|
procedure SetUseLocale(AValue: Boolean);
|
|
|
procedure SetWriteBOM(AValue: Boolean);
|
|
|
procedure SetValue(const Name, Value: string);
|
|
|
- procedure SetDelimiter(c:Char);
|
|
|
- procedure SetQuoteChar(c:Char);
|
|
|
- procedure SetNameValueSeparator(c:Char);
|
|
|
+ procedure SetDelimiter(c:AnsiChar);
|
|
|
+ procedure SetQuoteChar(c:AnsiChar);
|
|
|
+ procedure SetNameValueSeparator(c:AnsiChar);
|
|
|
procedure WriteData(Writer: TWriter);
|
|
|
procedure DoSetTextStr(const Value: string; DoClear : Boolean);
|
|
|
- Function GetDelimiter : Char;
|
|
|
- Function GetNameValueSeparator : Char;
|
|
|
- Function GetQuoteChar: Char;
|
|
|
+ Function GetDelimiter : AnsiChar;
|
|
|
+ Function GetNameValueSeparator : AnsiChar;
|
|
|
+ Function GetQuoteChar: AnsiChar;
|
|
|
Function GetLineBreak : String;
|
|
|
procedure SetLineBreak(const S : String);
|
|
|
Function GetSkipLastLineBreak : Boolean;
|
|
|
procedure SetSkipLastLineBreak(const AValue : Boolean);
|
|
|
- Procedure DoSetDelimitedText(const AValue: string; DoClear,aStrictDelimiter : Boolean; aQuoteChar,aDelimiter : Char);
|
|
|
+ Procedure DoSetDelimitedText(const AValue: string; DoClear,aStrictDelimiter : Boolean; aQuoteChar,aDelimiter : AnsiChar);
|
|
|
protected
|
|
|
function CompareStrings(const s1,s2 : string) : Integer; virtual;
|
|
|
procedure DefineProperties(Filer: TFiler); override;
|
|
@@ -715,7 +715,7 @@ type
|
|
|
procedure SetStrings(TheStrings: array of string); overload; virtual;
|
|
|
Procedure AddText(Const S : String); virtual;
|
|
|
procedure AddCommaText(const S: String);
|
|
|
- procedure AddDelimitedText(const S: String; ADelimiter: char; AStrictDelimiter: Boolean); overload;
|
|
|
+ procedure AddDelimitedText(const S: String; ADelimiter: AnsiChar; AStrictDelimiter: Boolean); overload;
|
|
|
procedure AddDelimitedtext(const S: String); overload;
|
|
|
procedure Append(const S: string);
|
|
|
procedure Assign(Source: TPersistent); override;
|
|
@@ -735,7 +735,7 @@ type
|
|
|
procedure ForEach(aCallback: TStringsForeachMethodExObj);
|
|
|
function GetEnumerator: TStringsEnumerator;
|
|
|
procedure GetNameValue(Index : Integer; Out AName,AValue : String);
|
|
|
- function GetText: PChar; virtual;
|
|
|
+ function GetText: PAnsiChar; virtual;
|
|
|
function IndexOf(const S: string): Integer; virtual;
|
|
|
function IndexOf(const S: string; aStart : Integer): Integer; virtual;
|
|
|
function IndexOfName(const Name: string): Integer; virtual;
|
|
@@ -766,22 +766,22 @@ type
|
|
|
function Shift : String;
|
|
|
Procedure Slice(fromIndex: integer; aList : TStrings);
|
|
|
Function Slice(fromIndex: integer) : TStrings;
|
|
|
- procedure SetText(TheText: PChar); virtual;
|
|
|
+ procedure SetText(TheText: PAnsiChar); virtual;
|
|
|
property AlwaysQuote: Boolean read FAlwaysQuote write FAlwaysQuote;
|
|
|
property Capacity: Integer read GetCapacity write SetCapacity;
|
|
|
property CommaText: string read GetCommaText write SetCommaText;
|
|
|
property Count: Integer read GetCount;
|
|
|
property DefaultEncoding: TEncoding read FDefaultEncoding write SetDefaultEncoding;
|
|
|
property DelimitedText: string read GetDelimitedText write SetDelimitedText;
|
|
|
- property Delimiter: Char read GetDelimiter write SetDelimiter;
|
|
|
+ property Delimiter: AnsiChar read GetDelimiter write SetDelimiter;
|
|
|
property Encoding: TEncoding read FEncoding;
|
|
|
property LineBreak : string Read GetLineBreak write SetLineBreak;
|
|
|
Property MissingNameValueSeparatorAction : TMissingNameValueSeparatorAction Read GetMissingNameValueSeparatorAction Write SetMissingNameValueSeparatorAction;
|
|
|
property Names[Index: Integer]: string read GetName;
|
|
|
- Property NameValueSeparator : Char Read GetNameValueSeparator Write SetNameValueSeparator;
|
|
|
+ Property NameValueSeparator : AnsiChar Read GetNameValueSeparator Write SetNameValueSeparator;
|
|
|
property Objects[Index: Integer]: TObject read GetObject write PutObject;
|
|
|
property Options: TStringsOptions read FOptions write FOptions;
|
|
|
- property QuoteChar: Char read GetQuoteChar write SetQuoteChar;
|
|
|
+ property QuoteChar: AnsiChar read GetQuoteChar write SetQuoteChar;
|
|
|
Property SkipLastLineBreak : Boolean Read GetSkipLastLineBreak Write SetSkipLastLineBreak;
|
|
|
// Same as SkipLastLineBreak but for Delphi compatibility. Note it has opposite meaning.
|
|
|
Property TrailingLineBreak : Boolean Read GetTrailingLineBreak Write SetTrailingLineBreak;
|
|
@@ -1311,10 +1311,10 @@ type
|
|
|
private
|
|
|
Res: TFPResourceHandle;
|
|
|
Handle: TFPResourceHGLOBAL;
|
|
|
- procedure Initialize(Instance: TFPResourceHMODULE; Name, ResType: PChar; NameIsID: Boolean);
|
|
|
+ procedure Initialize(Instance: TFPResourceHMODULE; Name, ResType: PAnsiChar; NameIsID: Boolean);
|
|
|
public
|
|
|
- constructor Create(Instance: TFPResourceHMODULE; const ResName: string; ResType: PChar);
|
|
|
- constructor CreateFromID(Instance: TFPResourceHMODULE; ResID: Integer; ResType: PChar);
|
|
|
+ constructor Create(Instance: TFPResourceHMODULE; const ResName: string; ResType: PAnsiChar);
|
|
|
+ constructor CreateFromID(Instance: TFPResourceHMODULE; ResID: Integer; ResType: PAnsiChar);
|
|
|
destructor Destroy; override;
|
|
|
end;
|
|
|
{$endif FPC_OS_UNICODE}
|
|
@@ -1583,7 +1583,7 @@ type
|
|
|
procedure Read(var Buf; Count: LongInt); virtual;
|
|
|
|
|
|
function ReadBoolean: Boolean;
|
|
|
- function ReadChar: Char;
|
|
|
+ function ReadChar: AnsiChar;
|
|
|
function ReadWideChar: WideChar;
|
|
|
function ReadUnicodeChar: UnicodeChar;
|
|
|
procedure ReadCollection(Collection: TCollection);
|
|
@@ -1651,7 +1651,7 @@ type
|
|
|
|
|
|
procedure WriteBinary(const Buffer; Count: Longint); virtual; abstract;
|
|
|
procedure WriteBoolean(Value: Boolean); virtual; abstract;
|
|
|
- // procedure WriteChar(Value: Char);
|
|
|
+ // procedure WriteChar(Value: AnsiChar);
|
|
|
{$ifndef FPUNONE}
|
|
|
procedure WriteFloat(const Value: Extended); virtual; abstract;
|
|
|
procedure WriteSingle(const Value: Single); virtual; abstract;
|
|
@@ -1774,7 +1774,7 @@ type
|
|
|
procedure WriteBoolean(Value: Boolean);
|
|
|
procedure WriteCollection(Value: TCollection);
|
|
|
procedure WriteComponent(Component: TComponent);
|
|
|
- procedure WriteChar(Value: Char);
|
|
|
+ procedure WriteChar(Value: AnsiChar);
|
|
|
procedure WriteWideChar(Value: WideChar);
|
|
|
procedure WriteDescendent(ARoot: TComponent; AAncestor: TComponent);
|
|
|
{$ifndef FPUNONE}
|
|
@@ -1810,17 +1810,17 @@ type
|
|
|
TParser = class(TObject)
|
|
|
private
|
|
|
fStream : TStream;
|
|
|
- fBuf : pchar;
|
|
|
+ fBuf : PAnsiChar;
|
|
|
fBufLen : integer;
|
|
|
fPos : integer;
|
|
|
fDeltaPos : integer;
|
|
|
- fFloatType : char;
|
|
|
+ fFloatType : AnsiChar;
|
|
|
fSourceLine : integer;
|
|
|
- fToken : char;
|
|
|
+ fToken : AnsiChar;
|
|
|
fEofReached : boolean;
|
|
|
fLastTokenStr : string;
|
|
|
fLastTokenWStr : widestring;
|
|
|
- function GetTokenName(aTok : char) : string;
|
|
|
+ function GetTokenName(aTok : AnsiChar) : string;
|
|
|
procedure LoadBuffer;
|
|
|
procedure CheckLoadBuffer; {$ifdef CLASSESINLINE} inline; {$endif CLASSESINLINE}
|
|
|
procedure ProcessChar; {$ifdef CLASSESINLINE} inline; {$endif CLASSESINLINE}
|
|
@@ -1828,7 +1828,7 @@ type
|
|
|
function IsHexNum : boolean; {$ifdef CLASSESINLINE} inline; {$endif CLASSESINLINE}
|
|
|
function IsAlpha : boolean; {$ifdef CLASSESINLINE} inline; {$endif CLASSESINLINE}
|
|
|
function IsAlphaNum : boolean; {$ifdef CLASSESINLINE} inline; {$endif CLASSESINLINE}
|
|
|
- function GetHexValue(c : char) : byte; {$ifdef CLASSESINLINE} inline; {$endif CLASSESINLINE}
|
|
|
+ function GetHexValue(c : AnsiChar) : byte; {$ifdef CLASSESINLINE} inline; {$endif CLASSESINLINE}
|
|
|
function GetAlphaNum : string;
|
|
|
procedure HandleNewLine;
|
|
|
procedure SkipBOM;
|
|
@@ -1840,20 +1840,20 @@ type
|
|
|
procedure HandleHexNumber;
|
|
|
function HandleQuotedString : string;
|
|
|
procedure HandleDecimalCharacter(var ascii : boolean;
|
|
|
- out WideChr: widechar; out StringChr: char);
|
|
|
+ out WideChr: widechar; out StringChr: AnsiChar);
|
|
|
procedure HandleString;
|
|
|
procedure HandleMinus;
|
|
|
procedure HandleUnknown;
|
|
|
public
|
|
|
constructor Create(Stream: TStream);
|
|
|
destructor Destroy; override;
|
|
|
- procedure CheckToken(T: Char);
|
|
|
+ procedure CheckToken(T: AnsiChar);
|
|
|
procedure CheckTokenSymbol(const S: string);
|
|
|
procedure Error(const Ident: string);
|
|
|
procedure ErrorFmt(const Ident: string; const Args: array of const);
|
|
|
procedure ErrorStr(const Message: string);
|
|
|
procedure HexToBinary(Stream: TStream);
|
|
|
- function NextToken: Char;
|
|
|
+ function NextToken: AnsiChar;
|
|
|
function SourcePos: Longint;
|
|
|
function TokenComponentIdent: string;
|
|
|
{$ifndef FPUNONE}
|
|
@@ -1863,9 +1863,9 @@ type
|
|
|
function TokenString: string;
|
|
|
function TokenWideString: WideString;
|
|
|
function TokenSymbolIs(const S: string): Boolean;
|
|
|
- property FloatType: Char read fFloatType;
|
|
|
+ property FloatType: AnsiChar read fFloatType;
|
|
|
property SourceLine: Integer read fSourceLine;
|
|
|
- property Token: Char read fToken;
|
|
|
+ property Token: AnsiChar read fToken;
|
|
|
end;
|
|
|
|
|
|
{ TThread }
|
|
@@ -2525,8 +2525,8 @@ procedure ObjectTextToResource(Input, Output: TStream);
|
|
|
|
|
|
{ Utility routines }
|
|
|
|
|
|
-function LineStart(Buffer, BufPos: PChar): PChar;
|
|
|
-procedure BinToHex(BinValue, HexValue: PChar; BinBufSize: Integer); deprecated 'use procedures from unit StrUtils';
|
|
|
-function HexToBin(HexValue, BinValue: PChar; BinBufSize: Integer): Integer;
|
|
|
-function ExtractStrings(Separators, WhiteSpace: TSysCharSet; Content: PChar; Strings: TStrings; AddEmptyStrings : Boolean = False): Integer;
|
|
|
+function LineStart(Buffer, BufPos: PAnsiChar): PAnsiChar;
|
|
|
+procedure BinToHex(BinValue, HexValue: PAnsiChar; BinBufSize: Integer); deprecated 'use procedures from unit StrUtils';
|
|
|
+function HexToBin(HexValue, BinValue: PAnsiChar; BinBufSize: Integer): Integer;
|
|
|
+function ExtractStrings(Separators, WhiteSpace: TSysCharSet; Content: PAnsiChar; Strings: TStrings; AddEmptyStrings : Boolean = False): Integer;
|
|
|
Function IfThen(AValue: Boolean; const ATrue: TStringList; const AFalse: TStringList = nil): TStringList; overload;
|