sysstrh.inc 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. {
  2. *********************************************************************
  3. $Id$
  4. Copyright (C) 1997, 1998 Gertjan Schouten
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. *********************************************************************
  17. System Utilities For Free Pascal
  18. }
  19. {==============================================================================}
  20. { standard functions }
  21. {==============================================================================}
  22. type
  23. PString = ^String;
  24. { For FloatToText }
  25. TFloatFormat = (ffGeneral, ffExponent, ffFixed, ffNumber, ffCurrency);
  26. function NewStr(const S: string): PString;
  27. procedure DisposeStr(S: PString);
  28. procedure AssignStr(var P: PString; const S: string);
  29. procedure AppendStr(var Dest: String; const S: string);
  30. function UpperCase(const s: string): string;
  31. function LowerCase(const s: string): string;
  32. function CompareStr(const S1, S2: string): Integer;
  33. function CompareMem(P1, P2: Pointer; Length: cardinal): integer;
  34. function CompareText(const S1, S2: string): integer;
  35. function AnsiUpperCase(const s: string): string;
  36. function AnsiLowerCase(const s: string): string;
  37. function AnsiCompareStr(const S1, S2: string): integer;
  38. function AnsiCompareText(const S1, S2: string): integer;
  39. function AnsiStrComp(S1, S2: PChar): integer;
  40. function AnsiStrIComp(S1, S2: PChar): integer;
  41. function AnsiStrLComp(S1, S2: PChar; MaxLen: cardinal): integer;
  42. function AnsiStrLIComp(S1, S2: PChar; MaxLen: cardinal): integer;
  43. function AnsiStrLower(Str: PChar): PChar;
  44. function AnsiStrUpper(Str: PChar): PChar;
  45. function AnsiLastChar(const S: string): PChar;
  46. function AnsiStrLastChar(Str: PChar): PChar;
  47. function Trim(const S: string): string;
  48. function TrimLeft(const S: string): string;
  49. function TrimRight(const S: string): string;
  50. function QuotedStr(const S: string): string;
  51. function AnsiQuotedStr(const S: string; Quote: char): string;
  52. function AnsiExtractQuotedStr(Const Src: PChar; Quote: Char): string;
  53. function AdjustLineBreaks(const S: string): string;
  54. function IsValidIdent(const Ident: string): boolean;
  55. function IntToStr(Value: integer): string;
  56. // function IntToStr(Value: Int64): string;
  57. function IntToHex(Value: integer; Digits: integer): string;
  58. // function IntToHex(Value: Int64; Digits: integer): string;
  59. function StrToInt(const s: string): integer;
  60. // function StrToInt64(const s: string): int64;
  61. function StrToIntDef(const S: string; Default: integer): integer;
  62. // function StrToInt64Def(const S: string; Default: int64): int64;
  63. function LoadStr(Ident: integer): string;
  64. // function FmtLoadStr(Ident: integer; const Args: array of const): string;
  65. Function Format (Const Fmt : String; const Args : Array of const) : String;
  66. Function FormatBuf (Var Buffer; BufLen : Cardinal; Const Fmt; fmtLen : Cardinal; Const Args : Array of const) : Cardinal;
  67. Function StrFmt(Buffer,Fmt : PChar; Const args: Array of const) : Pchar;
  68. Function StrLFmt(Buffer : PCHar; Maxlen : Cardinal;Fmt : PChar; Const args: Array of const) : Pchar;
  69. Procedure FmtStr(Var Res: String; Const Fmt : String; Const args: Array of const);
  70. Function FloatToStrF(Value: Extended; format: TFloatFormat; Precision, Digits: Integer): String;
  71. Function FloatToStr(Value: Extended): String;
  72. Function StrToFloat(Value : String) : Extended;
  73. Function FloatToText(Buffer: PChar; Value: Extended; format: TFloatFormat; Precision, Digits: Integer): Longint;
  74. {==============================================================================}
  75. { extra functions }
  76. {==============================================================================}
  77. function LeftStr(const S: string; Count: integer): string;
  78. function RightStr(const S: string; Count: integer): string;
  79. function BCDToInt(Value: integer): integer;
  80. {
  81. $Log$
  82. Revision 1.9 2000-02-09 16:59:33 peter
  83. * truncated log
  84. }