+ StrNextChar implemented

git-svn-id: trunk@7803 -
This commit is contained in:
florian 2007-06-24 20:30:55 +00:00
parent 792f84a710
commit e1125c3f7f
2 changed files with 18 additions and 11 deletions

View File

@ -938,7 +938,7 @@ begin
Result:=StrFmt(Buffer,Fmt,Args,DefaultFormatSettings); Result:=StrFmt(Buffer,Fmt,Args,DefaultFormatSettings);
end; end;
Function StrFmt(Buffer,Fmt : PChar; Const Args: Array of const; Const FormatSettings: TFormatSettings): PChar; Function StrFmt(Buffer,Fmt : PChar; Const Args: Array of const; Const FormatSettings: TFormatSettings): PChar;
begin begin
Buffer[FormatBuf(Buffer^,Maxint,Fmt^,strlen(fmt),args,FormatSettings)]:=#0; Buffer[FormatBuf(Buffer^,Maxint,Fmt^,strlen(fmt),args,FormatSettings)]:=#0;
@ -1104,7 +1104,7 @@ Var
P: Integer; P: Integer;
Negative, TooSmall, TooLarge: Boolean; Negative, TooSmall, TooLarge: Boolean;
DS: Char; DS: Char;
Begin Begin
DS:=FormatSettings.DecimalSeparator; DS:=FormatSettings.DecimalSeparator;
Case format Of Case format Of
@ -1608,7 +1608,7 @@ begin
Result:=FloatToStrF(Value,ffGeneral,-1,0); Result:=FloatToStrF(Value,ffGeneral,-1,0);
end; end;
function AnsiDequotedStr(const S: string; AQuote: Char): string; function AnsiDequotedStr(const S: string; AQuote: Char): string;
var p : pchar; var p : pchar;
@ -1666,7 +1666,7 @@ begin
begin begin
CheckStrs; CheckStrs;
if B then if B then
Result:=TrueBoolStrs[0] Result:=TrueBoolStrs[0]
else else
Result:=FalseBoolStrs[0]; Result:=FalseBoolStrs[0];
end end
@ -1682,7 +1682,7 @@ begin
if not(TryStrToBool(S,Result)) then if not(TryStrToBool(S,Result)) then
Result:=Default; Result:=Default;
end; end;
function TryStrToBool(const S: string; out Value: Boolean): Boolean; function TryStrToBool(const S: string; out Value: Boolean): Boolean;
Var Var
Temp : String; Temp : String;
@ -1902,7 +1902,7 @@ Var
End; { Case } End; { Case }
End { Begin } End { Begin }
Else Else
Inc(Fmt); Inc(Fmt);
End; { Case } End; { Case }
End; { While .. Begin } End; { While .. Begin }
End; End;
@ -2205,7 +2205,7 @@ begin
fvComp: fvComp:
Str(Currency(Value):23, Buffer); Str(Currency(Value):23, Buffer);
end; end;
N := 1; N := 1;
L := Byte(Buffer[0]); L := Byte(Buffer[0]);
while Buffer[N]=' ' do while Buffer[N]=' ' do
@ -2460,8 +2460,8 @@ begin
Result:=mbSingleByte; Result:=mbSingleByte;
end; end;
Function StrByteType(Str: PChar; Index: Cardinal): TMbcsByteType;
Function StrByteType(Str: PChar; Index: Cardinal): TMbcsByteType;
begin begin
Result:=mbSingleByte; Result:=mbSingleByte;
end; end;
@ -2473,6 +2473,12 @@ begin
end; end;
function StrNextChar(const Str: PChar): PChar;
begin
result:=Str+StrCharLength(Str);
end;
Function FindCmdLineSwitch(const Switch: string; const Chars: TSysCharSet;IgnoreCase: Boolean): Boolean; Function FindCmdLineSwitch(const Switch: string; const Chars: TSysCharSet;IgnoreCase: Boolean): Boolean;
Var Var

View File

@ -69,7 +69,7 @@ procedure AppendStr(var Dest: String; const S: string);
function UpperCase(const s: string): string; function UpperCase(const s: string): string;
function LowerCase(const s: string): string; overload; function LowerCase(const s: string): string; overload;
{ the compiler can't decide else if it should use the char or the ansistring { the compiler can't decide else if it should use the char or the ansistring
version for a variant } version for a variant }
function LowerCase(const V: variant): string; overload;{$ifdef SYSUTILSINLINE}inline;{$endif} function LowerCase(const V: variant): string; overload;{$ifdef SYSUTILSINLINE}inline;{$endif}
function CompareStr(const S1, S2: string): Integer; function CompareStr(const S1, S2: string): Integer;
function CompareMemRange(P1, P2: Pointer; Length: cardinal): integer; function CompareMemRange(P1, P2: Pointer; Length: cardinal): integer;
@ -97,7 +97,7 @@ function TrimLeft(const S: string): string;
function TrimRight(const S: string): string; function TrimRight(const S: string): string;
function QuotedStr(const S: string): string; function QuotedStr(const S: string): string;
function AnsiQuotedStr(const S: string; Quote: char): string; function AnsiQuotedStr(const S: string; Quote: char): string;
function AnsiDequotedStr(const S: string; AQuote: Char): string; function AnsiDequotedStr(const S: string; AQuote: Char): string;
function AnsiExtractQuotedStr(var Src: PChar; Quote: Char): string; function AnsiExtractQuotedStr(var Src: PChar; Quote: Char): string;
function AdjustLineBreaks(const S: string): string; function AdjustLineBreaks(const S: string): string;
function AdjustLineBreaks(const S: string; Style: TTextLineBreakStyle): string; function AdjustLineBreaks(const S: string; Style: TTextLineBreakStyle): string;
@ -123,7 +123,7 @@ Function Format (Const Fmt: string; const Args: array of const; const FormatSett
Function FormatBuf (Var Buffer; BufLen : Cardinal; Const Fmt; fmtLen : Cardinal; Const Args : Array of const) : Cardinal; Function FormatBuf (Var Buffer; BufLen : Cardinal; Const Fmt; fmtLen : Cardinal; Const Args : Array of const) : Cardinal;
Function FormatBuf (Var Buffer; BufLen : Cardinal; Const Fmt; fmtLen : Cardinal; Const Args : Array of const; Const FormatSettings: TFormatSettings) : Cardinal; Function FormatBuf (Var Buffer; BufLen : Cardinal; Const Fmt; fmtLen : Cardinal; Const Args : Array of const; Const FormatSettings: TFormatSettings) : Cardinal;
Function StrFmt(Buffer,Fmt : PChar; Const args: Array of const) : Pchar; Function StrFmt(Buffer,Fmt : PChar; Const args: Array of const) : Pchar;
Function StrFmt(Buffer,Fmt : PChar; Const Args: Array of const; Const FormatSettings: TFormatSettings): PChar; Function StrFmt(Buffer,Fmt : PChar; Const Args: Array of const; Const FormatSettings: TFormatSettings): PChar;
Function StrLFmt(Buffer : PCHar; Maxlen : Cardinal;Fmt : PChar; Const args: Array of const) : Pchar; Function StrLFmt(Buffer : PCHar; Maxlen : Cardinal;Fmt : PChar; Const args: Array of const) : Pchar;
Function StrLFmt(Buffer : PCHar; Maxlen : Cardinal;Fmt : PChar; Const args: Array of const; Const FormatSettings: TFormatSettings) : Pchar; Function StrLFmt(Buffer : PCHar; Maxlen : Cardinal;Fmt : PChar; Const args: Array of const; Const FormatSettings: TFormatSettings) : Pchar;
Procedure FmtStr(Var Res: String; Const Fmt : String; Const args: Array of const); Procedure FmtStr(Var Res: String; Const Fmt : String; Const args: Array of const);
@ -218,6 +218,7 @@ Function ByteToCharLen(const S: string; MaxLen: Integer): Integer;
Function CharToByteLen(const S: string; MaxLen: Integer): Integer; Function CharToByteLen(const S: string; MaxLen: Integer): Integer;
Function ByteToCharIndex(const S: string; Index: Integer): Integer; Function ByteToCharIndex(const S: string; Index: Integer): Integer;
Function StrCharLength(const Str: PChar): Integer; Function StrCharLength(const Str: PChar): Integer;
function StrNextChar(const Str: PChar): PChar;
const const