core/ZSysUtils.pas File Reference

Go to the source code of this file.

Classes

class  TZSortedList
 Modified list of pointers. More...

Typedefs

typedef Integer(* TZListSortCompare )(Pointer Item1, Pointer Item2)
 Modified comaprison function.

Functions

TDateTime AnsiSQLDateToDateTime (const string Value)
 Converts Ansi SQL Date/Time to TDateTime.
 AppendSplitString (TStrings List, const string Str, const string Delimiters)
 Appends to list a splitted string using the multiple chars.
 AppendSplitStringEx (TStrings List, const string Str, const string Delimiter)
 Appends to list a splitted string using the delimeter string.
String BoolToStrEx (Boolean Bool)
 Converts a boolean into string value.
string BufferToStr (PChar Buffer, LongInt Length)
 Converts a character buffer into pascal string.
string BytesToStr (const TByteDynArray Value)
 Converts bytes into a string representation.
Variant BytesToVar (const TByteDynArray Value)
 Converts bytes into a variant representation.
string ComposeString (TStrings List, const string Delimiter)
 Composes a string from the specified strings list delimited with a special character.
string DateTimeToAnsiSQLDate (TDateTime Value)
 Converts TDateTime to Ansi SQL Date/Time.
string DecodeCString (const string Value)
 Converts an string from escape PostgreSQL format.
 DecodeSQLVersioning (const Integer FullVersion, Integer &MajorVersion, Integer &MinorVersion, Integer &SubVersion)
 Decodes a Full Version Value encoded with the format: (major_version * 1,000,000) + (minor_version * 1,000) + sub_version into separated major, minor and subversion values.
string EncodeCString (const string Value)
 Converts an string into escape PostgreSQL format.
Integer EncodeSQLVersioning (const Integer MajorVersion, const Integer MinorVersion, const Integer SubVersion)
 Encodes major, minor and subversion (revision) values in this format: (major_version * 1,000,000) + (minor_version * 1,000) + sub_version For example, 4.1.12 is returned as 4001012.
Boolean EndsWith (const string Str, const string SubStr)
 Checks is the string ends with substring.
Integer FirstDelimiter (const string Delimiters, const string Str)
 Determines a position of a first delimiter.
string FloatToSQLStr (Extended Value)
 Converts a float value into SQL string with '.
String FormatSQLVersion (const Integer SQLVersion)
 Formats a Zeos SQL Version format to X.Y.Z where: X = major_version Y = minor_version Z = sub version.
Boolean IsIpAddr (const string Str)
 Checks if the specified string can represent an IP address.
Integer LastDelimiter (const string Delimiters, const string Str)
 Determines a position of a LAST delimiter.
Boolean MemLComp (PChar P1, PChar P2, Integer Len)
 Compares two PChars without stopping at #0.
string MemPas (PChar Buffer, LongInt Length)
 Copy buffer to the pascal string.
 PutSplitString (TStrings List, const string Str, const string Delimiters)
 Puts to list a splitted string using the multiple chars which replaces the previous list content.
 PutSplitStringEx (TStrings List, const string Str, const string Delimiter)
 Puts to list a splitted string using the delimiter string which replaces the previous list content.
string ReplaceChar (const Char Source, const Char Target, const string Str)
 Replace chars in the string.
TStrings SplitString (const string Str, const string Delimiters)
 Splits string using the multiple chars.
TStrings SplitStringEx (const string Str, const string Delimiter)
 Splits string using the delimiter string.
 SplitToStringList (TStrings List, string Str, const string Delimiters)
 SplitToStringListEx (TStrings List, const string Str, const string Delimiter)
Extended SQLStrToFloat (const string Str)
 Converts SQL string into float value.
Extended SQLStrToFloatDef (string Str, Extended Def)
 Converts SQL string into float value.
Boolean StartsWith (const string Str, const string SubStr)
 Checks is the string starts with substring.
Boolean StrToBoolEx (string Str)
 Converts a string into boolean value.
TByteDynArray StrToBytes (const string Value)
 Converts string into an array of bytes.
TDateTime TimestampStrToDateTime (const string Value)
 Converts Timestamp String to TDateTime.
TByteDynArray VarToBytes (const Variant Value)
 Converts variant into an array of bytes.


Typedef Documentation

typedef Integer(* TZListSortCompare)(Pointer Item1, Pointer Item2)

Modified comaprison function.

Definition at line 76 of file ZSysUtils.pas.


Function Documentation

TDateTime AnsiSQLDateToDateTime ( const string  Value  ) 

Converts Ansi SQL Date/Time to TDateTime.

Parameters:
Value a date and time string.
Returns:
a decoded TDateTime value.

Definition at line 1199 of file ZSysUtils.pas.

AppendSplitString ( TStrings  List,
const string  Str,
const string  Delimiters 
)

Appends to list a splitted string using the multiple chars.

Parameters:
List a list with strings.
Str the source string
Delimiters the delimiters string

Definition at line 895 of file ZSysUtils.pas.

AppendSplitStringEx ( TStrings  List,
const string  Str,
const string  Delimiter 
)

Appends to list a splitted string using the delimeter string.

Parameters:
List a list with strings.
Str the source string
Delimiters the delimiters string

Definition at line 1048 of file ZSysUtils.pas.

String BoolToStrEx ( Boolean  Bool  ) 

Converts a boolean into string value.

Parameters:
Bool a boolean value.
Returns:
"True" or "False"

Definition at line 773 of file ZSysUtils.pas.

string BufferToStr ( PChar  Buffer,
LongInt  Length 
)

Converts a character buffer into pascal string.

Parameters:
Buffer a character buffer pointer.
Length a buffer length.
Returns:
a string retrived from the buffer.

Definition at line 740 of file ZSysUtils.pas.

string BytesToStr ( const TByteDynArray  Value  ) 

Converts bytes into a string representation.

Parameters:
Value an array of bytes to be converted.
Returns:
a converted string.

Definition at line 1064 of file ZSysUtils.pas.

Variant BytesToVar ( const TByteDynArray  Value  ) 

Converts bytes into a variant representation.

Parameters:
Value an array of bytes to be converted.
Returns:
a converted variant.

Definition at line 1094 of file ZSysUtils.pas.

string ComposeString ( TStrings  List,
const string  Delimiter 
)

Composes a string from the specified strings list delimited with a special character.

Parameters:
List a list of strings.
Delimiter a delimiter string.
Returns:
a composed string from the list.

Definition at line 913 of file ZSysUtils.pas.

string DateTimeToAnsiSQLDate ( TDateTime  Value  ) 

Converts TDateTime to Ansi SQL Date/Time.

Parameters:
Value an encoded TDateTime value.
Returns:
a date and time string.

Definition at line 1299 of file ZSysUtils.pas.

string DecodeCString ( const string  Value  ) 

Converts an string from escape PostgreSQL format.

Parameters:
Value a string in PostgreSQL escape format.
Returns:
a regular string.

Definition at line 1421 of file ZSysUtils.pas.

DecodeSQLVersioning ( const Integer  FullVersion,
Integer &  MajorVersion,
Integer &  MinorVersion,
Integer &  SubVersion 
)

Decodes a Full Version Value encoded with the format: (major_version * 1,000,000) + (minor_version * 1,000) + sub_version into separated major, minor and subversion values.

Decodes a full version value encoded with Zeos SQL format: (major_version * 1,000,000) + (minor_version * 1,000) + sub_version into separated major, minor and subversion values.

Parameters:
FullVersion an integer containing the Full Version to decode.
MajorVersion an integer containing the Major Version decoded.
MinorVersion an integer containing the Minor Version decoded.
SubVersion an integer contaning the Sub Version (revision) decoded.

Definition at line 1526 of file ZSysUtils.pas.

string EncodeCString ( const string  Value  ) 

Converts an string into escape PostgreSQL format.

Parameters:
Value a regular string.
Returns:
a string in PostgreSQL escape format.

Definition at line 1371 of file ZSysUtils.pas.

Integer EncodeSQLVersioning ( const Integer  MajorVersion,
const Integer  MinorVersion,
const Integer  SubVersion 
)

Encodes major, minor and subversion (revision) values in this format: (major_version * 1,000,000) + (minor_version * 1,000) + sub_version For example, 4.1.12 is returned as 4001012.

Encodes major, minor and subversion (revision) values in Zeos SQL format: (major_version * 1,000,000) + (minor_version * 1,000) + sub_version For example, 4.1.12 is returned as 4001012.

Parameters:
MajorVersion an integer containing the Major Version.
MinorVersion an integer containing the Minor Version.
SubVersion an integer containing the Sub Version (revision).
Returns:
an integer containing the full version.

Definition at line 1549 of file ZSysUtils.pas.

Boolean EndsWith ( const string  Str,
const string  SubStr 
)

Checks is the string ends with substring.

Parameters:
Str a string to be checked.
SubStr a string to test at the end of the Str.
Returns:
True if Str ended with SubStr;

Definition at line 654 of file ZSysUtils.pas.

Integer FirstDelimiter ( const string  Delimiters,
const string  Str 
)

Determines a position of a first delimiter.

Parameters:
Delimiters a string with possible delimiters.
Str a string to be checked.
Returns:
a position of the first found delimiter or 0 if no delimiters was found.

Definition at line 547 of file ZSysUtils.pas.

string FloatToSQLStr ( Extended  Value  ) 

Converts a float value into SQL string with '.

' delimiter.

Parameters:
Value a float value to be converted.
Returns:
a converted string value.

Definition at line 953 of file ZSysUtils.pas.

String FormatSQLVersion ( const Integer  SQLVersion  ) 

Formats a Zeos SQL Version format to X.Y.Z where: X = major_version Y = minor_version Z = sub version.

Parameters:
SQLVersion an integer
Returns:
Formated Zeos SQL Version Value.

Definition at line 1568 of file ZSysUtils.pas.

Boolean IsIpAddr ( const string  Str  ) 

Checks if the specified string can represent an IP address.

Parameters:
Str a string value.
Returns:
True if the string can represent an IP address or False otherwise.

Definition at line 791 of file ZSysUtils.pas.

Integer LastDelimiter ( const string  Delimiters,
const string  Str 
)

Determines a position of a LAST delimiter.

Parameters:
Delimiters a string with possible delimiters.
Str a string to be checked.
Returns:
a position of the last found delimiter or 0 if no delimiters was found.

Definition at line 574 of file ZSysUtils.pas.

Boolean MemLComp ( PChar  P1,
PChar  P2,
Integer  Len 
)

Compares two PChars without stopping at #0.

Parameters:
P1 first PChar
P2 seconds PChar
Returns:
True if the memory at P1 and P2 are equal
Parameters:
P1 first PChar
P2 seconds PChar
Returns:
True if the memory at P1 and P2 are equal

Definition at line 602 of file ZSysUtils.pas.

string MemPas ( PChar  Buffer,
LongInt  Length 
)

Copy buffer to the pascal string.

Parameters:
Buffer a buffer with data
Length a buffer length
Returns:
a buffer content

Definition at line 1505 of file ZSysUtils.pas.

PutSplitString ( TStrings  List,
const string  Str,
const string  Delimiters 
)

Puts to list a splitted string using the multiple chars which replaces the previous list content.

Parameters:
List a list with strings.
Str the source string
Delimiters the delimiters string

Definition at line 877 of file ZSysUtils.pas.

PutSplitStringEx ( TStrings  List,
const string  Str,
const string  Delimiter 
)

Puts to list a splitted string using the delimiter string which replaces the previous list content.

Parameters:
List a list with strings.
Str the source string
Delimiters the delimiter string

Definition at line 1008 of file ZSysUtils.pas.

string ReplaceChar ( const Char  Source,
const Char  Target,
const string  Str 
)

Replace chars in the string.

Parameters:
Source a char to search.
Target a char to replace.
Str a source string.
Returns:
a string with replaced chars.

Definition at line 1474 of file ZSysUtils.pas.

TStrings SplitString ( const string  Str,
const string  Delimiters 
)

Splits string using the multiple chars.

Parameters:
Str the source string
Delimiters the delimiters string
Returns:
the result list where plased delimited string

Definition at line 854 of file ZSysUtils.pas.

TStrings SplitStringEx ( const string  Str,
const string  Delimiter 
)

Splits string using the delimiter string.

Parameters:
Str the source string
Delimiters the delimiter string
Returns:
the result list where plased delimited string

Definition at line 1026 of file ZSysUtils.pas.

SplitToStringList ( TStrings  List,
string  Str,
const string  Delimiters 
)

Definition at line 821 of file ZSysUtils.pas.

SplitToStringListEx ( TStrings  List,
const string  Str,
const string  Delimiter 
)

Definition at line 975 of file ZSysUtils.pas.

Extended SQLStrToFloat ( const string  Str  ) 

Converts SQL string into float value.

Parameters:
Str an SQL string with comma delimiter.
Returns:
a converted value or Def if conversion was failt.

Definition at line 717 of file ZSysUtils.pas.

Extended SQLStrToFloatDef ( string  Str,
Extended  Def 
)

Converts SQL string into float value.

Parameters:
Str an SQL string with comma delimiter.
Def a default value if the string can not be converted.
Returns:
a converted value or Def if conversion was failt.

Definition at line 687 of file ZSysUtils.pas.

Boolean StartsWith ( const string  Str,
const string  SubStr 
)

Checks is the string starts with substring.

Parameters:
Str a string to be checked.
SubStr a string to test at the start of the Str.
Returns:
True if Str started with SubStr;

Definition at line 623 of file ZSysUtils.pas.

Boolean StrToBoolEx ( string  Str  ) 

Converts a string into boolean value.

Parameters:
Str a string value.
Returns:
True is Str = 'Y'/'YES'/'T'/'TRUE'/<>0

Definition at line 757 of file ZSysUtils.pas.

TByteDynArray StrToBytes ( const string  Value  ) 

Converts string into an array of bytes.

Parameters:
Value a string to be converted.
Returns:
a converted array of bytes.

Definition at line 1078 of file ZSysUtils.pas.

TDateTime TimestampStrToDateTime ( const string  Value  ) 

Converts Timestamp String to TDateTime.

Parameters:
Value a timestamp string.
Returns:
a decoded TDateTime value.

Definition at line 1243 of file ZSysUtils.pas.

TByteDynArray VarToBytes ( const Variant  Value  ) 

Converts variant into an array of bytes.

Parameters:
Value a varaint to be converted.
Returns:
a converted array of bytes.

Definition at line 1117 of file ZSysUtils.pas.


Generated on Wed Dec 30 08:42:41 2009 for zeoslib by  doxygen 1.5.7.1