VCDoc
Class Tree

Unit
  VCDoc.unaUtils

Description
 

Contains useful routines used by other units and classes.


Author
 

Lake


Version
 

2.5.2008.07
+ aware of BDS 2006 and later improved memory manager;


Types
 
Type Description
BFFCALLBACK  
BROWSEINFO  
BROWSEINFOA  
BROWSEINFOW  
handleArray  
infoMessageProc This procedure type is used by infoMessage() routine.
ITEMIDLIST  
PBrowseInfo  
PBrowseInfoA  
PBrowseInfoW  
pHandleArray  
PItemIDList TItemIDList -- List if item IDs (combined with 0-terminator)
pprocessEntryArray  
pRGB  
processEntryArray  
proc_ffcallback Callback routine for findFiles().
PSECURITY_ATTRIBUTES  
PSHItemID TSHItemID -- Item ID
PSTRRet Record for returning strings from IShellFolder member functions.
pWordArray  
SHITEMID  
STRRET  
TBrowseInfo  
TBrowseInfoA  
TBrowseInfoW  
tDayTable  
TFNBFFCallBack  
TItemIDList  
TSHItemID  
TStrRet  
tunaColorOp  
tWordArray  
unaInfoMessage_logTimeModeEnum  
_browseinfo  

Constants
 
Constant Description
BFFM_ENABLEOK  
BFFM_INITIALIZED  
BFFM_SELCHANGED  
BFFM_SETSELECTION  
BFFM_SETSELECTIONA  
BFFM_SETSELECTIONW  
BFFM_SETSTATUSTEXT  
BFFM_SETSTATUSTEXTA  
BFFM_SETSTATUSTEXTW  
BFFM_VALIDATEFAILED  
BFFM_VALIDATEFAILEDA lParam:szPath ret:1(cont),0(EndDialog)
BFFM_VALIDATEFAILEDW lParam:wzPath ret:1(cont),0(EndDialog)
BIF_BROWSEFORCOMPUTER Browsing for Computers
BIF_BROWSEFORPRINTER Browsing for Printers
BIF_BROWSEINCLUDEFILES Browsing for Everything
BIF_BROWSEINCLUDEURLS  
BIF_DONTGOBELOWDOMAIN For starting the Find Computer
BIF_EDITBOX  
BIF_NEWDIALOGSTYLE  
BIF_RETURNFSANCESTORS  
BIF_RETURNONLYFSDIRS For finding a folder to start document searching
BIF_SHAREABLE  
BIF_STATUSTEXT  
BIF_USENEWUI  
BIF_VALIDATE insist on valid result (or CANCEL)
CSIDL_ADMINTOOLS  
CSIDL_ALTSTARTUP  
CSIDL_APPDATA  
CSIDL_BITBUCKET  
CSIDL_CDBURN_AREA  
CSIDL_COMMON_ADMINTOOLS  
CSIDL_COMMON_ALTSTARTUP  
CSIDL_COMMON_APPDATA  
CSIDL_COMMON_DESKTOPDIRECTORY  
CSIDL_COMMON_DOCUMENTS  
CSIDL_COMMON_FAVORITES  
CSIDL_COMMON_MUSIC  
CSIDL_COMMON_PICTURES  
CSIDL_COMMON_PROGRAMS  
CSIDL_COMMON_STARTMENU  
CSIDL_COMMON_STARTUP  
CSIDL_COMMON_VIDEO  
CSIDL_COMPUTERSNEARME  
CSIDL_CONNECTIONS  
CSIDL_CONTROLS  
CSIDL_COOKIES  
CSIDL_DESKTOP  
CSIDL_DESKTOPDIRECTORY  
CSIDL_DRIVES  
CSIDL_FAVORITES  
CSIDL_FLAG_CREATE  
CSIDL_FONTS  
CSIDL_HISTORY  
CSIDL_INTERNET  
CSIDL_INTERNET_CACHE  
CSIDL_LOCAL_APPDATA  
CSIDL_MYPICTURES  
CSIDL_NETHOOD  
CSIDL_NETWORK  
CSIDL_PERSONAL  
CSIDL_PRINTERS  
CSIDL_PRINTHOOD  
CSIDL_PROFILE  
CSIDL_PROFILES  
CSIDL_PROGRAMS  
CSIDL_PROGRAM_FILES  
CSIDL_PROGRAM_FILES_COMMON  
CSIDL_RECENT  
CSIDL_SENDTO  
CSIDL_STARTMENU  
CSIDL_STARTUP  
CSIDL_SYSTEM  
CSIDL_TEMPLATES  
CSIDL_WINDOWS  
c_logModeFlags_critical  
c_logModeFlags_debug  
c_logModeFlags_normal  
monthDays  
REGSTR_PATH_EXPLORER  
REGSTR_PATH_SPECIAL_FOLDERS  
unicodeHighSurrogateEnd  
unicodeHighSurrogateStart  
unicodeLowSurrogateEnd  
unicodeLowSurrogateStart  
WM_USER  
zeroWidthNonBreakingSpace  
zeroWidthNonBreakingSpaceUTF8  
zeroWidthNonBreakingSpaceW  

Variables
 
Variable Description
g_emergencyIsOn  
g_emergencyLogFileName  
g_OSVersion  
g_wideApiSupported  
hrpc_Freq  
hrpc_FreqFail  
hrpc_FreqMs  

Routines
 
Method Description
abort Divides 1 by zero to rise an exception.
addBackSlashW Ensures you can safely add a file name to the given path. Adds '\' character to the end of path as necessary.
adjust 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.
adjustW 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.
ams Returns allocated memory size.
array2str  
array2strW If maxArrayLength is specified, assumed that it includes the last NULL character.
assertLogMessage Calls infoMessage() or does nothing if DEBUG symbol was not defined.
b64str2dateTime Converts a string into tDateTime value. Uses base64dencode() to dencode date value.
base64decode Decodes string encoded with base64 method.
base64decode Decodes data encoded with base64 method.
base64decode Decodes string encoded with base64 method.
base64encode Encodes data with base64 method.
base64encode Encodes string with base64 method.
base65decode Decodes data encoded with "base65" method.
base65decode Decodes data encoded with "base65" method.
base65encode Encodes data with "base65" method.
base65encode Encodes data with "base65" method.
baseXdecode Decodes data encoded with "X" method.
baseXencode Encodes data with "X" method.
bool2int Converts boolean value to integer. Returns 0 if value = false and 1 otherwise.
bool2str Converts boolean value to string. Returns '0' if value = false and '1' otherwise.
bool2strStr Converts boolean value to string. Returns 'false' if value = false and 'true' otherwise.
changeFileExtW Replaces the file extension with given one.
checkIfDuplicateProcess Returns false if no mutex with given name was created by the time
checkIfDuplicateProcess returns processId of first process with same module name,
choice Returns one of the choices depending on value of boolean selector.
choice Returns one of the choices depending on value of boolean selector.
choice Returns one of the choices depending on value of boolean selector.
choice Returns one of the choices depending on value of boolean selector.
choice Returns one of the choices depending on value of boolean selector.
choice Returns one of the choices depending on value of boolean selector.
choice Returns one of the choices depending on value of boolean selector.
choiceD Returns one of the choices depending on value of boolean selector.
choiceE  
color2rgb  
color2str  
colorShift  
compareStr Compares two strings with regard (ignoreCase = false) or not (ignoreCase = true) to the case of characters in the string. Returns:
cp2UTF8  
crc16 Calculates "CRC16" checksum. CRC16 is defined as "(crc shr 16) xor (crc and $FFFF)" where crc is standard CRC32 value.
crc32 Calculates CRC32 checksum.
crc32 Calculates CRC32 checksum.
crc4 Calculates "CRC4" checksum.
crc8 Calculates "CRC8" checksum.
dateTime2b64str Converts tDateTime value into string. Uses base64encode() to encode dateTime value.
debug_memAllocated Used to display the memory size currently allocated by application.
directoryExistsW Returns True if specified directory exists.
emergencyIsOn  
emergencyLog  
enableAutorun Enables or disables autorun of specified appication (current module will be used by default).
encodeTime Encodes hours, minutes seconds and milliseconds to tDateTime value.
execApp  
execApp  
extractFileNameW Returns file name (without file path).
extractFilePathW Returns file path (without file name).
fileChecksum Calculates CRC32 checksum of a file.
fileChecksum Calculates CRC32 checksum of a file.
fileClose Closes file handle.
fileCopy Copies the file content to a new file.
fileCreate Creates a file. If file already exists, truncates it to zero-length file (if truncate is true).
fileCreationDateTime Returns file creation time.
fileCreationDateTime Returns file creation time.
fileDelete Removes the file.
fileExists Checks if specified file exists.
fileModificationDateTime Returns file modification time.
fileModificationDateTime Returns file modification time.
fileMove Renames the file.
fileOpen Opens a file.
fileSeek Seeks the file to specified position.
fileSize Returns file size in bytes, or -1 if file does not exists.
fileSize Returns file size in bytes, or -1 if file does not exists.
fileSize2str Returns nice string representing file size.
fileTruncate Truncates file at specified position.
findFiles Finds all files according to path and mask, optionally travelling in subdirs.
folderRemove Returns True if folder was successfully removed. Folder must not contain subfolders or files.
folderRemoveFiles Removes all files in a folder (and optionally subfolders) according to file mask specified.
forceDirectoriesW Ensures that specified path exists. Recursively creates directories as required.
formatTemplate Substitues variable fields in the template with given values. Example:
freeAndNil Disposes an object.
gcd Returns greatest common divider.
getAppDataFolderPath Returns Application Data folder path.
getDiskSpace index means:
GetLongPathNameW ?
getModuleFileNameExt Returns name of executable module with given extension.
getModulePathName Produces file name with the same path as executable module.
getNullDacl  
getPriority  
getProcessWindows  
getRegValue Reads string value from registry.
getRegValue  
getRegValue Reads integer value from registry.
getRegValue Reads data from registry.
getSpecialFolderPath Returns special folder path.
getSysErrorText Returns Windows system error message for given error code.
getTemporaryFileName Returns temporary file name.
guiAboutBox Wrapper for ShellAbout function
guiMessageBox  
guiMessageBox Wrapper for MessageBox() function
guiSelectDirectory Opens directory selection dialog.
hasSwitch Returns True if command line contains given switch.
highSurrogate  
htmlEscape //
html_markSpaces //
html_markURLs //
infoMessage Displays the message on the screen, adds it to debug log file and/or passes it to the infoMessageProc.
int2bool Converts integer value to boolean. Returns false if value = 0 and true otherwise.
int2str Converts int64 value to a string.
int2str Converts unsigned value to a string.
int2str Converts word value to string.
int2str Converts integer value to a string.
int2strW Converts int64 value to a wide string.
int2strW Converts unsigned value to a wide string.
int2strW Converts word value to a wide string.
int2strW Converts integer value to a wide string.
intArray2str Converts array of integer values into a comma-separated string.
isHighSurrogate  
isLeapYear Returns true if specified year is leap.
isLowSurrogate  
lastDelimiter Returns position (starting from 1) in the s where one of the characters given in delimiters was found.
loCase Returns lower case of given char.
locateProcess  
locateProcesses  
logMessage Same as infoMessage() but also checks mode parameter. If (mode > infoLogMessageMode) does nothing.
lowerCase Converts all character in given string into lower case.
lowerCaseA  
lowerCaseW  
lowSurrogate  
malloc Allocates block of memory.
malloc Allocates block of memory.
max Returns maximal value of two signed integers.
max Returns maximal value of two floating-point.
max Returns maximal value of two signed 64 bits integers.
max Returns maximal value of two unsigned integers.
mcompare Compares two memory blocks.
mfill16 Fills memory block with specified word value.
min Returms minimal value of two signed 64 bits integers.
min Returms minimal value of two unsigned integers.
min Returms minimal value of two signed integers.
monthsPassed Returns number of full months passed between two dates.
mrealloc Reallocates block of memory.
ms2dateTime Converts milliseconds to tDateTime value
ms2time Converts milliseconds to days, hours, minutes, seconds and milliseconds.
mscanb Scans memory for a byte value.
mscanbuf Scans memory for array of bytes, pointed by value.
mscand Scans memory for a double word value.
mscanq Scans memory for a quad word value.
mscanw Scans memory for a word value.
newGUID Returns new GUID.
nextTokenW  
nowUTC Returns current system time UTC timescale.
padChar Returns a string containing specified number of specified character.
padChar Returns a string containing specified number of specified character.
paramStrW Returns specified (by index) command line parameter as wide string.
passwordStrength Returns the strength of a password string. -1 = unacceptable; 0 = weakest; 100 = strongest.
percent Converts value and total into percentage.
percent Converts value and total into percentage.
processMessages Processes messages waiting to be processed by application or window.
putIntoClipboard Returns 0 if successfull.
ReadFile  
readFromFile Reads data from a file specified by handle at specified position.
readFromFile Reads data from a file specified by name at specified position.
readFromFile Reads data from a file specified by name at specified position.
readFromFileW Same as readFromFile() but return wideString.
replaceTokens Returns number of tokens replaced.
replaceTokens  
replaceTokensW  
sameGUIDs Compares two GUIDs.
sameString  
sameStringW  
sanityCheck  
sanityCheck64  
setInfoMessageMode Specifies the name of debug log and infoMessageProc procedure to be used by the infoMessage() routine.
setPriority  
setRegValue Writes data to registry.
setRegValue  
setRegValue Writes integer value into registry.
setRegValue Writes string value into registry.
SHBrowseForFolderA  
SHBrowseForFolderW  
ShellAboutA  
ShellAboutW  
SHGetDesktopFolder  
SHGetMalloc  
SHGetPathFromIDListA  
SHGetPathFromIDListW  
SHGetSpecialFolderPathA  
SHGetSpecialFolderPathW  
str2array Returns number of chars being copied.
str2arrayW Returns number of wide chars being copied.
str2bool Converts string value to a boolean value. Returns False if value = '0' and true otherwise.
str2intArray Converts comma-separated string into array of integer values.
str2intByte Converts string value to byte.
str2intByteA Converts string value to byte.
str2intInt Converts string value to integer.
str2intInt64 Converts string value to int64.
str2intInt64A Converts string value to int64.
str2intIntA Converts string value to integer.
str2intUnsigned Converts string value to unsigned.
str2intUnsignedA Converts string value to unsigned.
strAlloc Allocates memory for a new string.
strCopy Copies source string into dest pChat. dest must be large enough to store the source.
strCopy Copies source string into dest pChat. dest must be large enough to store the source.
strDispose Deallocates memory taken by a string.
strEscape Makes value safe to pass as "plain" string, by escaping special characters with "/" symbol. Examples:
strLen Returns length of a string.
strNew Allocates new pChar value and copies the source string into it.
strNew Allocates memory for a new string. Use unaUtils.strDispose() to release the memory.
strPos  
strScan Scans the src string for specified character.
strStr2bool Converts string value to boolean. Returns true if value = 'true', false if value = 'false' and defValue otherwise.
strUnescape Converts "escaped" value back to "plain" string. Examples:
surrogate2cp  
switchValue Returns value of a given command line switch.
switchValue  
sysDate2str Converts system date into a string.
sysDateTime2localDateTime Converts system date/time from UTC into a local system date/time.
sysTime2str Converts system time into a string.
timeElapsed32 Returns number of milliseconds passed between given mark and current time. Uses high-resolution performance counter (HPRC) if available, or GetTickCount() otherwise.
timeElapsed64 Returns number of milliseconds passed between given mark and current time. Uses high-resolution performance counter (HPRC) if available, or GetTickCount() otherwise.
timeElapsed64ticks Returns number of internal ticks passed between given mark and current time. Uses high-resolution performance counter (HPRC) if available.
timeMark "Marks" current time. Uses high-resolution performance counter (HPRC) if possible or GetTickCount() otherwise.
trim Trims the specified value by removing all control or space characters from left (beginning) and right (ending) of the string.
trimW  
upCase Returns upper case of given character.
upperCase Converts all character in given string into upper case.
urlDecode  
urlEncode //
utc2local Converts local system date/time into UTC system date/time.
UTF162UTF8 Converts UTF16 to UTF8 string.
UTF82UTF16 Converts UTF8 to UTF16 string.
waitForObject Waits specified amount of time for event to be sent in signaled state.
wide2ansi Converts multi-byte string into ANSI string using WideCharToMultiByte() with CP_ACP.
windowGetFirstChild  
windowsEnum  
WriteFile  
writeToFile Writes data into a file specified by name at specified position.
writeToFile Writes data into a file specified by name at specified position.
writeToFile Writes data into a file specified by handle at specified position.
writeToFile Writes data into a file specified by handle at specified position.

Classes/Records
 
Class Description
IEnumIDList  
IMalloc  
IShellFolder  
SECURITY_ATTRIBUTES  
tRGB  
_browseinfoA  
_browseinfoW  
_ITEMIDLIST  
_SHITEMID  
_STRRET  


(c) 2001-2008 Lake of Soft, Ltd
Created with DelphiCodeToDoc.