sysstrh.inc 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. function NewStr(const S: string): PString;
  25. procedure DisposeStr(S: PString);
  26. procedure AssignStr(var P: PString; const S: string);
  27. procedure AppendStr(var Dest: PString; const S: string);
  28. function UpperCase(const s: string): string;
  29. function LowerCase(const s: string): string;
  30. function CompareStr(const S1, S2: string): Integer;
  31. function CompareMem(P1, P2: Pointer; Length: cardinal): integer;
  32. function CompareText(const S1, S2: string): integer;
  33. function AnsiUpperCase(const s: string): string;
  34. function AnsiLowerCase(const s: string): string;
  35. function AnsiCompareStr(const S1, S2: string): integer;
  36. function AnsiCompareText(const S1, S2: string): integer;
  37. function AnsiStrComp(S1, S2: PChar): integer;
  38. function AnsiStrIComp(S1, S2: PChar): integer;
  39. function AnsiStrLComp(S1, S2: PChar; MaxLen: cardinal): integer;
  40. function AnsiStrLIComp(S1, S2: PChar; MaxLen: cardinal): integer;
  41. function AnsiStrLower(Str: PChar): PChar;
  42. function AnsiStrUpper(Str: PChar): PChar;
  43. function AnsiLastChar(const S: string): PChar;
  44. function AnsiStrLastChar(Str: PChar): PChar;
  45. function Trim(const S: string): string;
  46. function TrimLeft(const S: string): string;
  47. function TrimRight(const S: string): string;
  48. function QuotedStr(const S: string): string;
  49. function AnsiQuotedStr(const S: string; Quote: char): string;
  50. function AnsiExtractQuotedStr(var Src: PChar; Quote: Char): string;
  51. function AdjustLineBreaks(const S: string): string;
  52. function IsValidIdent(const Ident: string): boolean;
  53. function IntToStr(Value: integer): string;
  54. // function IntToStr(Value: Int64): string;
  55. function IntToHex(Value: integer; Digits: integer): string;
  56. // function IntToHex(Value: Int64; Digits: integer): string;
  57. function StrToInt(const s: string): integer;
  58. // function StrToInt64(const s: string): int64;
  59. function StrToIntDef(const S: string; Default: integer): integer;
  60. // function StrToInt64Def(const S: string; Default: int64): int64;
  61. function LoadStr(Ident: integer): string;
  62. // function FmtLoadStr(Ident: integer; const Args: array of const): string;
  63. Function Format (Const Fmt : String; const Args : Array of const) : String;
  64. {==============================================================================}
  65. { extra functions }
  66. {==============================================================================}
  67. function LeftStr(const S: string; Count: integer): string;
  68. function RightStr(const S: string; Count: integer): string;
  69. function BCDToInt(Value: integer): integer;
  70. {
  71. $Log$
  72. Revision 1.5 1998-12-15 22:43:11 peter
  73. * removed temp symbols
  74. Revision 1.4 1998/11/04 10:20:53 peter
  75. * ansistring fixes
  76. Revision 1.3 1998/11/02 12:53:53 michael
  77. + Added format function
  78. Revision 1.2 1998/09/16 08:28:43 michael
  79. Update from gertjan Schouten, plus small fix for linux
  80. Revision 1.1 1998/04/10 15:17:46 michael
  81. + Initial implementation; Donated by Gertjan Schouten
  82. His file was split into several files, to keep it a little bit structured.
  83. }