home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
delphi
/
tstrclas.lzh
/
STRCLASS.INT
< prev
next >
Wrap
Text File
|
1995-11-11
|
24KB
|
479 lines
UNIT StrClass;
{ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: }
{ TStringClass : Version 2.0 - CopyRight of ICFM Software, London, UK }
{ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: }
INTERFACE
{ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: }
{$R StrClass.RES}
{ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: }
USES
WinTypes,
WinProcs,
SysUtils,
Dialogs,
ContainR,
Controls;
{ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: }
CONST
{ id to test for WORD function results }
WordResError : WORD = $FFFF;
{ case usage constants }
Ignore_Case = TRUE;
Use_Case = FALSE;
{ string comparison function integer results }
Compare_LT = -1;
Compare_EQ = 0;
Compare_GT = 1;
{ boolean to string conversion types }
bt_NoYes = 1;
bt_01 = 2;
bt_FalseTrue = 3;
bt_FT = 4;
bt_NY = 5;
bt_OffOn = 6;
bt_Last = 6;
{ special processing flags for delimiter parsing actions }
delim_None = 0;
delim_IncDIC = 1;
delim_IncSIC = 2;
delim_ExcDIC = 4;
delim_ExcSIC = 8;
delim_ExcNull = 16;
{ parameters for the 'FindBetween2Ch' function }
fbc_DelSubStr = TRUE;
fbc_LeaveSubStr = FALSE;
fbc_IncDelims = TRUE;
fbc_ExcDelims = FALSE;
{ filesplit related id's }
fs_Directory = 1;
fs_Name = 2;
fs_extension = 4;
{ base number indicator }
StrClassBaseZero : BOOLEAN = TRUE;
{ FromComponent index settings }
All_Items = -1;
Selected_text = -2;
{ grep related constants }
grep_any = '?';
grep_nextLiteral = '\';
grep_optionStart = '[';
grep_optionEnd = ']';
grep_class = ':';
grep_Alpha = 'A';
grep_numeric = 'D';
grep_alphaNumeric = 'N';
grep_Chcont0 = '*';
grep_Chcont1 = '+';
grep_ChOption = '-';
grep_Not = '!';
TYPE
TStringClass = CLASS(TObject)
PRIVATE
{ data members }
FBuffer : PChar;
FMaxSize : WORD;
FLength : WORD;
FSizeInc : WORD;
{ private methods }
FUNCTION ArgsToList(CONST Args : ARRAY OF CONST;
AList : TObjectContainer) : LONGINT;
FUNCTION AssignFromPChar(Source : PChar; Start : WORD) : PChar;
FUNCTION AssignMidPChar(Source : PChar; Start,Count : WORD) : PChar;
FUNCTION AssignLenPChar(Source : PChar; Len : WORD) : PChar;
FUNCTION AssignNLPChar(Source : PChar) : PChar;
FUNCTION AssignPadPChar(Source : PChar; Len : WORD; ACh : CHAR) : PChar;
FUNCTION AssignPChar(Source : PChar) : PChar;
FUNCTION AssignRightPChar(Source : PChar; Len : WORD) : PChar;
FUNCTION AssignString(CONST Source : STRING) : PChar;
FUNCTION AppendLenPChar(Source : PChar; Len : WORD) : PChar;
FUNCTION AppendMidPChar(Source : PChar; Start,Count : WORD) : PChar;
FUNCTION AppendNLPChar(Source : PChar) : PChar;
FUNCTION AppendPadPChar(Source : PChar; Len : WORD; ACh : CHAR) : PChar;
FUNCTION AppendPChar(Source : PChar) : PChar;
FUNCTION AppendRightPChar(Source : PChar; Len : WORD) : PChar;
FUNCTION AppendString(Source : STRING) : PChar;
FUNCTION AppendTClass(T : TClass) : PChar;
FUNCTION AppendTrimPChar(Source : PChar) : PChar;
FUNCTION AppendWithTabPChar(Source : PChar) : PChar;
FUNCTION PrependPChar(Source : PChar) : PChar;
FUNCTION ComparePChar(Other : PChar) : INTEGER;
FUNCTION CompareIPChar(Other : PChar) : INTEGER;
FUNCTION CompareLPChar(Other : PChar; Len : WORD) : INTEGER;
FUNCTION CompareLIPChar(Other : PChar; Len : WORD) : INTEGER;
FUNCTION InsertPChar(Source : PChar; Index : WORD) : PChar;
FUNCTION CanCat(Source : PChar; VAR Extra : WORD) : BOOLEAN;
FUNCTION CanCopy(Source : PChar; VAR Extra : WORD) : BOOLEAN;
FUNCTION ChkSizeInc(E : WORD) : WORD;
FUNCTION CompConv(I : INTEGER) : INTEGER;
PROCEDURE DisposeStr;
FUNCTION ExpandBy(ExtraLen : WORD) : BOOLEAN;
FUNCTION GetCh(w : WORD) : CHAR;
FUNCTION GetLength : WORD;
FUNCTION GetMaxSize : WORD;
FUNCTION GetPChar : PChar;
FUNCTION GetSizeInc : WORD;
FUNCTION GetString : STRING;
PROCEDURE SetBufferLen(NewLen : WORD);
PROCEDURE SetSizeInc(ASize : WORD);
PROTECTED
FUNCTION AppendTObject(T : TObject) : PChar; VIRTUAL;
PROCEDURE InitDataMembers; VIRTUAL;
FUNCTION DoAssignFrom(CONST Args : ARRAY OF CONST; Start : WORD) : PChar;
FUNCTION DoAssignMid(CONST Args : ARRAY OF CONST; Start,Count : WORD) : PChar;
FUNCTION DoAppendMid(CONST Args : ARRAY OF CONST; Start,Count : WORD) : PChar;
FUNCTION DoFirstNonSpaceCh(VAR ACh : CHAR) : WORD;
FUNCTION DoHasCh(ACh : CHAR; VAR Pos : WORD) : BOOLEAN;
FUNCTION DoIsCh(W : WORD; ACh : CHAR) : BOOLEAN;
FUNCTION DoLastNonSpaceCh(VAR ACh : CHAR) : WORD;
PROCEDURE DoSetCh(W : WORD; ACh : CHAR);
FUNCTION DoDelete(Index,Count : WORD) : PChar;
FUNCTION DoDeleteFrom(Index : WORD) : PChar;
FUNCTION DoInsert(CONST Args : ARRAY OF CONST; Index : WORD) : PChar;
FUNCTION DoInsertL(CONST Args : ARRAY OF CONST; Len,Index : WORD) : PChar;
FUNCTION DoFindBetween2Ch(FirstCh,
SecondCh : CHAR;
StartFrom : WORD;
VAR SubStrStart : WORD;
VAR SubStrLen : WORD;
CutSubStr,
IncDelims : BOOLEAN;
VAR ASubStr : TStringClass) : BOOLEAN;
FUNCTION DoFindFirst(CONST SubArgs : ARRAY OF CONST; VAR P : WORD) : BOOLEAN;
FUNCTION DoFindFirstCh(ACh : CHAR; VAR P : WORD) : BOOLEAN;
FUNCTION DoFindLast(CONST SubArgs : ARRAY OF CONST; VAR P : WORD) : BOOLEAN;
FUNCTION DoFindLastCh(ACh : CHAR; VAR P : WORD) : BOOLEAN;
FUNCTION DoFindNext(CONST SubArgs : ARRAY OF CONST;
StartPos : WORD;
VAR NextPos : WORD) : BOOLEAN;
FUNCTION DoFindNextCh(ACh : CHAR; StartPos : WORD; VAR NextPos : WORD) : BOOLEAN;
FUNCTION DoFindPrev(CONST SubArgs : ARRAY OF CONST;
StartPos : WORD; VAR PrevPos : WORD) : BOOLEAN;
FUNCTION DoFindPrevCh(ACh : CHAR; StartPos : WORD; VAR PrevPos : WORD) : BOOLEAN;
FUNCTION DoFirstParseDelim(CONST Args : ARRAY OF CONST;
DelimCh : CHAR;
VAR DelimPos : WORD) : BOOLEAN;
FUNCTION DoNextParseDelim(CONST Args : ARRAY OF CONST;
DelimCh : CHAR;
StartPos : WORD;
VAR NextDelimPos : WORD) : BOOLEAN;
PUBLIC
{ *** CONSTRUCTORS *** }
CONSTRUCTOR Create;
CONSTRUCTOR CreateSize(ASize: WORD);
CONSTRUCTOR CreateString(CONST Args : ARRAY OF CONST);
CONSTRUCTOR CreateStringNL(CONST Args : ARRAY OF CONST);
CONSTRUCTOR CreateBoolean(B : BOOLEAN; StrType : INTEGER);
{ *** DESTRUCTOR *** }
DESTRUCTOR Destroy; OVERRIDE;
{ *** COPY related *** }
FUNCTION Copy : POINTER; VIRTUAL;
PROCEDURE CopyFrom(Source : TStringClass);
{ clearing methods }
PROCEDURE Clear;
PROCEDURE Empty;
{ size related }
PROCEDURE RecalcLength;
{ assign }
FUNCTION Assign(CONST Args : ARRAY OF CONST) : PChar;
FUNCTION AssignFrom(CONST Args : ARRAY OF CONST; Start : WORD) : PChar;
FUNCTION AssignLen(CONST Args : ARRAY OF CONST ; Len : WORD) : PChar;
FUNCTION AssignMid(CONST Args : ARRAY OF CONST; Start,Count : WORD) : PChar;
FUNCTION AssignNL(CONST Args : ARRAY OF CONST) : PChar;
FUNCTION AssignPad(CONST Args : ARRAY OF CONST; Len : WORD; ACh : CHAR) : PChar;
FUNCTION AssignRight(CONST Args : ARRAY OF CONST; Len : WORD) : PChar;
FUNCTION AssignTrim(CONST Args : ARRAY OF CONST) : PChar;
{ appending data to the data }
FUNCTION Append(CONST Args : ARRAY OF CONST) : PChar;
FUNCTION AppendBoolean(B : BOOLEAN; bt : INTEGER) : PChar;
FUNCTION AppendByte(B : BYTE) : PChar;
FUNCTION AppendCh(C : CHAR) : PChar;
FUNCTION AppendDIC(CONST Args : ARRAY OF CONST) : PChar;
FUNCTION AppendDouble(D : DOUBLE; Width,Places : BYTE) : PChar;
FUNCTION AppendDoubleTrim(D : DOUBLE) : PChar;
FUNCTION AppendExt(E : EXTENDED; Width,Places : BYTE) : PChar;
FUNCTION AppendExtTrim(E : EXTENDED) : PChar;
FUNCTION AppendLen(CONST Args : ARRAY OF CONST; Len : WORD) : PChar;
FUNCTION AppendLong(L : LONGINT) : PChar;
FUNCTION AppendMid(CONST Args : ARRAY OF CONST; Start,Count : WORD) : PChar;
FUNCTION AppendNL(CONST Args : ARRAY OF CONST) : PChar;
FUNCTION AppendPad(CONST Args : ARRAY OF CONST; Len : WORD; ACh : CHAR) : PChar;
FUNCTION AppendPtr(P : POINTER) : PChar;
FUNCTION AppendReal(R : REAL; Width,Places : BYTE) : PChar;
FUNCTION AppendRight(CONST Args : ARRAY OF CONST; Len : WORD) : PChar;
FUNCTION AppendSIC(CONST Args : ARRAY OF CONST) : PChar;
FUNCTION AppendTrim(CONST Args : ARRAY OF CONST) : PChar;
FUNCTION AppendWithTab(CONST Args : ARRAY OF CONST) : PChar;
FUNCTION NL : PChar;
FUNCTION NLAppend(CONST Args : ARRAY OF CONST) : PChar;
FUNCTION Prepend(CONST Args : ARRAY OF CONST) : PChar;
{ *** Character/array element related *** }
FUNCTION FirstNonSpaceCh(VAR ACh : CHAR) : WORD;
FUNCTION HasCh(ACh : CHAR; VAR Pos : WORD) : BOOLEAN;
FUNCTION IsCh(W : WORD; ACh : CHAR) : BOOLEAN;
FUNCTION IsFirstCh(ACh : CHAR) : BOOLEAN;
FUNCTION IsLastCh(ACh : CHAR) : BOOLEAN;
FUNCTION LastNonSpaceCh(VAR ACh : CHAR) : WORD;
PROCEDURE RemoveLastCh;
PROCEDURE SetCh(W : WORD; ACh : CHAR);
{ *** WITH OTHER DATA TYPES *** }
FUNCTION FromBoolean(B : BOOLEAN; bt : INTEGER) : PChar;
FUNCTION FromByte(B : BYTE) : PChar;
FUNCTION FromChar(C : CHAR) : PChar;
FUNCTION FromComponent(AComp : TWinControl) : PChar;
FUNCTION FromComponentItem(AComp : TWinControl; Idx : INTEGER) : PChar;
FUNCTION FromDouble(D : DOUBLE; Width,Places : BYTE) : PChar;
FUNCTION FromDoubleTrim(D : DOUBLE) : PChar;
FUNCTION FromExt(E : EXTENDED; Width,Places : BYTE) : PChar;
FUNCTION FromExtTrim(E : EXTENDED) : PChar;
FUNCTION FromLong(L : LONGINT) : PChar;
FUNCTION FromPtr(P : POINTER) : PChar;
FUNCTION FromReal(R : REAL; Width,Places : BYTE) : PChar;
FUNCTION FromRealTrim(R : REAL) : PChar;
FUNCTION FromRGB(C : TColorRef) : PChar;
FUNCTION HexFromByte(B : BYTE) : PChar;
FUNCTION HexFromLong(L : LONGINT) : PChar;
FUNCTION HexFromPtr(P : POINTER) : PChar;
FUNCTION HexFromWord(W : WORD) : PChar;
FUNCTION ToBoolean(VAR B : BOOLEAN) : BOOLEAN;
FUNCTION ToByte(VAR B : BYTE) : BOOLEAN;
FUNCTION ToChar(VAR C : CHAR) : BOOLEAN;
FUNCTION ToComponent(AComp : TWinControl) : BOOLEAN;
FUNCTION ToDouble(VAR D : DOUBLE) : BOOLEAN;
FUNCTION ToExt(VAR E : EXTENDED) : BOOLEAN;
FUNCTION ToInteger(VAR I : INTEGER) : BOOLEAN;
FUNCTION ToLong(VAR L : LONGINT) : BOOLEAN;
FUNCTION ToReal(VAR R : REAL) : BOOLEAN;
FUNCTION ToRGB(VAR C : TColorRef) : BOOLEAN;
FUNCTION ToWord(VAR W : WORD) : BOOLEAN;
{ equivalent SysUtils type functions }
FUNCTION AppendStr(CONST S: string) : PChar;
FUNCTION UpperCase(CONST S: string) : PChar;
FUNCTION LowerCase(const S: string): PChar;
FUNCTION CompareStr(CONST S2: STRING): Integer;
FUNCTION CompareText(CONST S2: STRING): Integer;
FUNCTION AnsiUpperCase(CONST S : STRING) : PChar;
FUNCTION AnsiLowerCase(CONST S : STRING) : PChar;
FUNCTION AnsiCompareStr(CONST S2: STRING): Integer;
FUNCTION AnsiCompareText(CONST S2: STRING): Integer;
FUNCTION IsValidIdent: Boolean;
FUNCTION IntToStr(Value: Longint): PChar;
FUNCTION IntToHex(Value: Longint; Digits: Integer): PChar;
FUNCTION StrToInt : Longint;
FUNCTION StrToIntDef(Default: Longint): Longint;
FUNCTION LoadStr(Ident: Word): PChar;
FUNCTION FmtLoadStr(Ident: Word; CONST Args: ARRAY OF CONST): PChar;
FUNCTION Format(CONST Format: STRING; CONST Args: ARRAY OF CONST): PChar;
FUNCTION FloatToStr(Value: Extended): PChar;
FUNCTION FloatToStrF(Value: Extended; Format: TFloatFormat; Precision, Digits: Integer): PChar;
FUNCTION FormatFloat(const Format: STRING; Value: Extended): PChar;
FUNCTION StrToFloat : Extended;
{ *** equivalent PChar type 'STRINGS' unit FUNCTIONs *** }
FUNCTION StrCat(Source : PChar) : PChar;
FUNCTION StrComp(Str2 : PChar) : INTEGER;
FUNCTION StrCopy(Source : PChar) : PChar;
FUNCTION StrECopy(Source : PChar) : PChar;
FUNCTION StrEnd : PChar;
FUNCTION StrIComp(Str2 : PChar) : INTEGER;
FUNCTION StrLCat(Source : PChar; MaxLen : WORD) : PChar;
FUNCTION StrLIComp(Str2 : PChar; MaxLen : WORD) : INTEGER;
FUNCTION StrLComp(Str2 : PChar; MaxLen : WORD) : INTEGER;
FUNCTION StrLCopy(Str2 : PChar; MaxLen : WORD) : INTEGER;
FUNCTION StrLen : WORD;
FUNCTION StrLower : PChar;
FUNCTION StrMove(Source : PChar; Count : WORD) : PChar;
FUNCTION StrPas : STRING;
FUNCTION StrPCopy(Source : STRING) : PChar;
FUNCTION StrPos(Str2 : PChar) : PChar;
FUNCTION StrRScan(Chr : CHAR) : PChar;
FUNCTION StrScan(Chr : CHAR) : PChar;
FUNCTION StrUpper : PChar;
{ *** COMPARISON METHODS *** }
FUNCTION Compare(CONST Args : ARRAY OF CONST) : INTEGER;
FUNCTION CompareI(CONST Args : ARRAY OF CONST) : INTEGER;
FUNCTION CompareL(CONST Args : ARRAY OF CONST; Len : WORD) : INTEGER;
FUNCTION CompareLI(CONST Args : ARRAY OF CONST; Len : WORD) : INTEGER;
FUNCTION CompareLong(L : LONGINT) : INTEGER;
FUNCTION CompareDouble(D : DOUBLE) : INTEGER;
FUNCTION CompareExt(E : EXTENDED) : INTEGER;
FUNCTION IsSame(CONST Args : ARRAY OF CONST) : BOOLEAN;
FUNCTION IsSameI(CONST Args : ARRAY OF CONST) : BOOLEAN;
FUNCTION IsSameL(CONST Args : ARRAY OF CONST; Len : WORD) : BOOLEAN;
FUNCTION IsSameLI(CONST Args : ARRAY OF CONST; Len : WORD) : BOOLEAN;
FUNCTION Includes(CONST Args : ARRAY OF CONST) : BOOLEAN;
FUNCTION Within(CONST Args : ARRAY OF CONST) : BOOLEAN;
{ *** TRIM related *** }
FUNCTION AddDIC : PChar;
FUNCTION AddSIC : PChar;
FUNCTION Delete(Index,Count : WORD) : PChar;
FUNCTION DeleteFrom(Index : WORD) : PChar;
FUNCTION Insert(CONST Args : ARRAY OF CONST; Index : WORD) : PChar;
FUNCTION InsertL(CONST Args : ARRAY OF CONST; Len,Index : WORD) : PChar;
FUNCTION PadCentre(NewLen : WORD; ACh : CHAR) : PChar;
FUNCTION PadEnd(NewLen : WORD; ACh : CHAR) : PChar;
FUNCTION PadFront(NewLen : WORD; ACh : CHAR) : PChar;
FUNCTION RemoveDIC : PChar;
FUNCTION RemoveSIC : PChar;
FUNCTION Trim : PChar;
FUNCTION TrimEnd : PChar;
FUNCTION TrimFront : PChar;
FUNCTION TrimZero : PChar;
{ command line related }
FUNCTION FindCmdLine : PChar;
FUNCTION FindCmdLineAndParse(IncExeParam : BOOLEAN;
VAR AList : TObjectContainer) : PChar;
FUNCTION FindCmdLineParam(Idx : INTEGER) : PChar;
{ *** RESOURCE STRING LOADING *** }
FUNCTION AppendStringRes(Instance : THandle; Id : WORD) : PChar;
FUNCTION LoadStringRes(Instance : THandle; Id : WORD) : PChar;
{ *** INI file related *** }
FUNCTION FindIniSectionKeywords(CONST IniFileArgs,
SectionArgs : ARRAY OF CONST;
VAR AList : TObjectContainer) : WORD;
FUNCTION ReadIniKeyword(CONST IniFileArgs : ARRAY OF CONST;
CONST SectionArgs : ARRAY OF CONST;
CONST KeyWordArgs : ARRAY OF CONST) : WORD;
FUNCTION WriteIniKeyword(CONST IniFileArgs : ARRAY OF CONST;
CONST SectionArgs : ARRAY OF CONST;
CONST KeyWordArgs : ARRAY OF CONST) : WORD;
{ *** DOS PATH/FILE NAME RELATED *** }
FUNCTION AddBackSlash : PChar;
FUNCTION AddFilterDesc(CONST DescArgs,ExtArgs : ARRAY OF CONST) : PChar;
FUNCTION BuildPathName(CONST DirArgs,
FileNameArgs,
ExtArgs : ARRAY OF CONST) : PChar;
FUNCTION CreateDirectory : BOOLEAN;
FUNCTION DefaultExtension(CONST Args : ARRAY OF CONST) : PChar;
FUNCTION DirectoryExists : BOOLEAN;
FUNCTION DriveExists : BOOLEAN;
FUNCTION ExpandFileName : PChar;
FUNCTION FileExists : BOOLEAN;
FUNCTION FindCurrentDir : PChar;
FUNCTION FindRelPath(CONST StartDirArgs,EndDirArgs : ARRAY OF CONST) : PChar;
FUNCTION ForceExtension(CONST Args : ARRAY OF CONST) : PChar;
FUNCTION GetSystemDirectory : PChar;
FUNCTION GetWindowsDirectory : PChar;
FUNCTION HasBackSlash : BOOLEAN;
FUNCTION HasDrive : BOOLEAN;
FUNCTION HasExtension(VAR DotPos : WORD) : BOOLEAN;
FUNCTION HasFileName : BOOLEAN;
FUNCTION HasDirectory : BOOLEAN;
FUNCTION FileSplit(VAR ADirObj,ANameObj,AnExtObj : TStringClass) : WORD;
FUNCTION JustExtension(CONST Args : ARRAY OF CONST) : PChar;
FUNCTION JustFileName(CONST Args : ARRAY OF CONST) : PChar;
FUNCTION JustName(CONST Args : ARRAY OF CONST) : PChar;
FUNCTION JustDirectory(CONST Args : ARRAY OF CONST) : PChar;
FUNCTION RemoveDirectory : BOOLEAN;
FUNCTION SameDrive(CONST Args : ARRAY OF CONST) : BOOLEAN;
FUNCTION SameDirectory(CONST Args : ARRAY OF CONST) : BOOLEAN;
FUNCTION SameExtension(CONST Args : ARRAY OF CONST) : BOOLEAN;
FUNCTION SameFileName(CONST Args : ARRAY OF CONST) : BOOLEAN;
FUNCTION SameName(CONST Args : ARRAY OF CONST) : BOOLEAN;
FUNCTION SetCurDir : BOOLEAN;
{ *** SEARCH RELATED FUNCTIONS *** }
FUNCTION ChCount(ACh : CHAR) : WORD;
FUNCTION FindBetween2Ch(FirstCh,
SecondCh : CHAR;
StartFrom : WORD;
VAR SubStrStart : WORD;
VAR SubStrLen : WORD;
CutSubStr,
IncDelims : BOOLEAN;
VAR ASubStr : TStringClass) : BOOLEAN;
FUNCTION FindFirst(CONST SubArgs : ARRAY OF CONST; VAR P : WORD) : BOOLEAN;
FUNCTION FindFirstCh(ACh : CHAR; VAR P : WORD) : BOOLEAN;
FUNCTION FindLast(CONST SubArgs : ARRAY OF CONST; VAR P : WORD) : BOOLEAN;
FUNCTION FindLastCh(ACh : CHAR; VAR P : WORD) : BOOLEAN;
FUNCTION FindNext(CONST SubArgs : ARRAY OF CONST;
StartPos : WORD;
VAR NextPos : WORD) : BOOLEAN;
FUNCTION FindNextCh(ACh : CHAR; StartPos : WORD; VAR NextPos : WORD) : BOOLEAN;
FUNCTION FindPrev(CONST SubArgs : ARRAY OF CONST;
StartPos : WORD; VAR PrevPos : WORD) : BOOLEAN;
FUNCTION FindPrevCh(ACh : CHAR; StartPos : WORD; VAR PrevPos : WORD) : BOOLEAN;
FUNCTION Grep(CONST SearchArgs : ARRAY OF CONST; VAR AList : TWordContainer) : WORD;
FUNCTION SubStrCount(CONST SubArgs : ARRAY OF CONST) : WORD;
{ *** Case related *** }
FUNCTION FirstCharToUpper : PChar;
FUNCTION IsAlphaNumeric : BOOLEAN;
FUNCTION ToLower : PChar;
FUNCTION ToUpper : PChar;
{ *** Search & replace related methods *** }
FUNCTION ReplaceAll(CONST OldArgs,NewArgs : ARRAY OF CONST) : PChar;
FUNCTION ReplaceChAll(OldCh,NewCh : CHAR) : PChar;
FUNCTION ReplaceChFirst(OldCh,NewCh : CHAR) : PChar;
FUNCTION ReplaceChLast(OldCh,NewCh : CHAR) : PChar;
FUNCTION ReplaceFirst(CONST OldArgs,NewArgs : ARRAY OF CONST) : PChar;
FUNCTION ReplaceLast(CONST OldArgs,NewArgs : ARRAY OF CONST) : PChar;
{ *** PARSER RELATED *** }
FUNCTION FirstParseDelim(CONST Args : ARRAY OF CONST;
DelimCh : CHAR;
VAR DelimPos : WORD) : BOOLEAN;
FUNCTION NextParseDelim(CONST Args : ARRAY OF CONST;
DelimCh : CHAR;
StartPos : WORD;
VAR NextDelimPos : WORD) : BOOLEAN;
FUNCTION ParseDelimCount(DelimCh : CHAR) : WORD;
FUNCTION ParseDelimToList(DelimCh : CHAR;
Special : INTEGER;
VAR AList : TObjectContainer) : WORD;
FUNCTION ParseMultiDelimToList(CONST DelimArgs : ARRAY OF CONST;
Special : INTEGER;
VAR AList : TObjectContainer) : WORD;
FUNCTION ParsePosToList(VAR PosArray;
PosCt : WORD;
VAR AList : TObjectContainer) : WORD;
{ **** OBJECT PROPERTIES *** }
PROPERTY Ch[w : WORD] : CHAR READ GetCh;
PROPERTY Length : WORD READ GetLength;
PROPERTY MaxSize : WORD READ GetMaxSize;
PROPERTY SizeInc : WORD READ GetSizeInc WRITE SetSizeInc;
PROPERTY Text : STRING READ GetString;
PROPERTY ZString : PChar READ GetPChar;
END;
{ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: }
EStringClass = class(Exception);
{ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: }
FUNCTION GetScFunctionName(Id : WORD) : STRING;
{ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: }
VAR
gSc : TStringClass;
{ ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: }