📄 vc25pro_doc_unautils.html
字号:
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_folderRemoveFiles"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.folderRemoveFiles(const path: wideString; includeSubfolders: bool = false; const mask: wideString = '*.*'; removeSubfoldersAsWell: bool = false; SFONLY: bool = false; const omask: wideString = ''): bool;</SPAN></A><P />
Removes all files in a folder (and optionally subfolders) according to file mask specified.
All empty subfolders may be removed too, making it easy to clean up all contect of a folder.
SFONLY and omask are internal parameters and should not be changed.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_folderRemove"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.folderRemove(const path: wideString): bool;</SPAN></A><P /></TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_paramStrW"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.paramStrW(index: unsigned): wideString;</SPAN></A><P />
Returns specified (by index) command line parameter as wide string.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_getDiskSpace"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.getDiskSpace(const path: wideString; index: int): int64;</SPAN></A><P /></TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_bool2int"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.bool2int(value: bool): int;</SPAN></A><P />
Converts boolean value to integer. Returns 0 if value = false and 1 otherwise.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_int2bool"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.int2bool(value: int): bool;</SPAN></A><P />
Converts integer value to boolean. Returns false if value = 0 and true otherwise.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_bool2str"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.bool2str(value: bool): string;</SPAN></A><P />
Converts boolean value to string. Returns '0' if value = false and '1' otherwise.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_bool2strStr"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.bool2strStr(value: bool): string;</SPAN></A><P />
Converts boolean value to string. Returns 'false' if value = false and 'true' otherwise.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_int2str"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.int2str(value: int; base: unsigned = 10; split: unsigned = 0; splitchar: char = ' '): string; overload;</SPAN></A><P />
Converts integer value to string.
<BR />base is the base for conversion (10 or 16 for example, max is 69).
<BR />If split > 0, the result will be divided on groups of digits, with at least split digits in every group.
<BR />splitchar is used to delimiter one group from other (when split > 0).
<BR />For example, when split = 3 and splitchar = ' ', instead of '12345' this function returns '12 345'.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_int2strW"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.int2strW(value: int; base: unsigned = 10; split: unsigned = 0; const splitchar: wideChar = ' '): wideString; overload;</SPAN></A><P /></TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_int2str"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.int2str(const value: int64; base: unsigned = 10; split: unsigned = 0; splitchar: char = ' '): string; overload;</SPAN></A><P />
Converts int64 value to string.
<BR />See int2str(int) for description of other parameters.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_int2strW"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.int2strW(const value: int64; base: unsigned = 10; split: unsigned = 0; const splitchar: wideChar = ' '): wideString; overload;</SPAN></A><P /></TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_int2str"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.int2str(value: unsigned; base: unsigned = 10; split: unsigned = 0; splitchar: char = ' '): string; overload;</SPAN></A><P />
Converts unsigned value to string.
<BR />See int2str(int) for description of other parameters.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_int2strW"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.int2strW(value: unsigned; base: unsigned = 10; split: unsigned = 0; const splitchar: wideChar = ' '): wideString; overload;</SPAN></A><P /></TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_int2str"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.int2str(value: word; base: unsigned = 10; split: unsigned = 0; splitchar: char = ' '): string; overload;</SPAN></A><P />
Converts word value to string.
<BR />See int2str(int) for description of other parameters.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_int2strW"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.int2strW(value: word; base: unsigned = 10; split: unsigned = 0; const splitchar: wideChar = ' '): wideString; overload;</SPAN></A><P /></TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_intArray2str"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.intArray2str(value: pInt32Array): string;</SPAN></A><P />
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_str2bool"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.str2bool(const value: string; defValue: bool = false): bool;</SPAN></A><P />
Converts string value to boolean. Returns false if value = '0' and true otherwise.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_strStr2bool"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.strStr2bool(const value: string; defValue: bool = false): bool;</SPAN></A><P />
Converts string value to boolean. Returns true if value = 'true', false if value = 'false' and defValue otherwise.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_str2intByte"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.str2intByte(const value: string; defValue: byte = 0; base: unsigned = 10; ignoreTrails: bool = false): byte; overload;</SPAN></A><P />
Converts string value to byte.
<BR />Returns defValue if conversion fails.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_str2intInt"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.str2intInt(const value: string; defValue: int = 0; base: unsigned = 10; ignoreTrails: bool = false): int; overload;</SPAN></A><P />
Converts string value to integer.
<BR />Returns defValue if conversion fails.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_str2intUnsigned"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.str2intUnsigned(const value: string; defValue: unsigned = 0; base: unsigned = 10; ignoreTrails: bool = false): unsigned; overload;</SPAN></A><P />
Converts string value to unsigned.
<BR />Returns defValue if conversion fails.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_str2intInt64"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.str2intInt64(const value: string; defValue: int64 = 0; base: unsigned = 10; ignoreTrails: bool = false): int64; overload;</SPAN></A><P />
Converts string value to int64.
<BR />Returns defValue if conversion fails.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_str2intArray"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.str2intArray(const value: string; subLevel: int = 0): pInt32Array;</SPAN></A><P />
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_newGUID"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.newGUID(): string;</SPAN></A><P />
Returns new GUID.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_ms2time"><SPAN class="source">procedure <SPAN class="class">unaUtils</SPAN>.ms2time(ms: int64; out dd, hh, mm, ss, mss: unsigned);</SPAN></A><P />
Converts milliseconds to days, hours, minutes, seconds and milliseconds
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_encodeTime"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.encodeTime(hh, mm, ss, ms: unsigned): tDateTime;</SPAN></A><P />
Encodes hours, minutes seconds and milliseconds to tDateTime value
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_ms2dateTime"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.ms2dateTime(ms: int64): tDateTime;</SPAN></A><P />
Converts milliseconds to tDateTime value
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_dateTime2b64str"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.dateTime2b64str(const dateTime: tDateTime): string;</SPAN></A><P />
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_b64str2dateTime"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.b64str2dateTime(const date: string; const defValue: tDateTime = 0): tDateTime;</SPAN></A><P />
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_sysTime2str"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.sysTime2str(time: pSYSTEMTIME = nil; const format: wideString = ''; locale: LCID = LOCALE_USER_DEFAULT): [unknown];</SPAN></A><P />
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_sysDate2str"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.sysDate2str(date: pSYSTEMTIME = nil; const format: wideString = ''; locale: LCID = LOCALE_USER_DEFAULT; flags: DWORD = 0): wideString;</SPAN></A><P />
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_sysDateTime2localDateTime"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.sysDateTime2localDateTime(const sysDate: SYSTEMTIME; out localDate: SYSTEMTIME): bool;</SPAN></A><P />
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_utc2local"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.utc2local(const dateTime: SYSTEMTIME): SYSTEMTIME;</SPAN></A><P />
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_monthsPassed"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.monthsPassed(const now, than: SYSTEMTIME): int;</SPAN></A><P />
Returns number of full months passed between two dates.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_isLeapYear"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.isLeapYear(year: word): bool;</SPAN></A><P />
Returns true if specified year is leap.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_percent"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.percent(value, total: unsigned): unsigned; overload;</SPAN></A><P />
Converts value and total into percentage.
<BR />For example, if value = 1, and total = 50 result will be 2.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_percent"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.percent(value, total: int64): int64; overload;</SPAN></A><P />
Converts value and total into percentage.
<BR />For example, if value = 10, and total = 50 result will be 20.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_trim"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.trim(const value: string; left: bool = true; right: bool = true): string;</SPAN></A><P />
Trims the specified value by removing all control or space characters from left (beginning) and right (ending) of the string.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_trimW"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.trimW(const value: wideString; left: bool = true; right: bool = true): wideString;</SPAN></A><P /></TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_loCase"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.loCase(value: char): char;</SPAN></A><P />
Returns lower case of given char.
<BR /><STRONG>NOTE</STRONG>: only Latin characters from ASCII table are converted.
<BR />Example:
<BR />A => a
<BR />b => b
<BR />3 => 3
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_upCase"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.upCase(value: char): char;</SPAN></A><P />
Returns upper case of given character.
<BR /><STRONG>NOTE</STRONG>: only Latin characters from ASCII table are converted.
<BR />Example:
<BR />A => A
<BR />b => B
<BR />3 => 3
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_upperCase"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.upperCase(const value: string): string;</SPAN></A><P />
Converts all character in given string into upper case.
<BR /><STRONG>NOTE</STRONG>: only Latin characters from ASCII table are converted.
<BR />Example:
<BR />Alek => ALEK
<BR />bool => BOOL
<BR />345 => 345
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_lowerCase"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.lowerCase(const value: string): string;</SPAN></A><P />
Converts all character in given string into lower case.
<BR /><STRONG>NOTE</STRONG>: only Latin characters from ASCII table are converted.
<BR />Example:
<BR />Alek => alek
<BR />bool => bool
<BR />345 => 345
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_compareStr"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.compareStr(const str1, str2: string; ignoreCase: bool = false): int;</SPAN></A><P />
Compares two strings with regard (ignoreCase = false) or not (ignoreCase = true) to the case of characters in the string. Returns:
<UL>
<LI>0 - strings are identical</LI>
<LI>-1 - str1 is shorter or lower then str2</LI>
<LI>+1 - str2 is shorter or lower then str1</LI>
</UL>
<BR /><STRONG>NOTE</STRONG>: only Latin characters from ASCII table are converted when ignoreCase = true.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_lowerCaseW"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.lowerCaseW(const value: wideString): wideString;</SPAN></A><P /></TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_sameString"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.sameString(const str1, str2: string; doTrim: bool = true): bool;</SPAN></A><P /></TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_sameStringW"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.sameStringW(const str1, str2: wideString; doTrim: bool = true; locale: LCID = LOCALE_SYSTEM_DEFAULT): bool;</SPAN></A><P /></TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_adjust"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.adjust(const value: string; len: int; fill: char = ' '; left: bool = true; truncate: bool = false): string;</SPAN></A><P />
Adjusts a string length to the len value, by adding additional character at the beginning (left = true) or at the end (left = false) of the string.
</TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_adjustW"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.adjustW(const value: wideString; len: int; const fill: wideChar = ' '; left: bool = true; truncate: bool = false): wideString;</SPAN></A><P /></TD></TR></TABLE></DIV><DIV><P /><TABLE BORDER="1" width="100%"><TR><TD><A NAME="routine_padChar"><SPAN class="source">function <SPAN class="class">unaUtils</SPAN>.padChar(pad: char; len: unsign
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -