VCL library function

zhaozj2021-02-16  81

VCL library function

Author: ----------, as reproduced please ensure the integrity of this document, and to indicate the source.

Welcome to C Builder Research, http://www.ccrun.com/doc/go.asp? Id = 114 // ----------------------- ---------------------------------- 1. Memory Allocation 2. File Operation 3. Disk Directory Management 4. String Operation 5. Type Conversion 6. Time and date management 1. The memory management function of the Orland C Builder VCL 1. AllocMem assigns the memory block of the specified byte in the team and initializes the assigned one byte to 0. The prototype is as follows: void * __fastcall allocmem (Cardinal size); SysfreeMem release the specified memory block. The function prototype is as follows: int __fastcall sysfreemem (void * p); 3. SysReallocMem Requires the memory specified by the parameter size. The function prototype is as follows: void * __fastcall sysReallocMem ( Void * p, int size); two.borland C Builder VCL file action function 1. FileOpen Open the specified file, if the return is a positive number, indicates that the operation is successful, the return value is a file handle: If the return value is -1, it means The operation fails, the function prototype is as follows: int __fastcall fileopen (const mode); 2. FileCreate Create a new file with the specified file name, if returned to a positive number, indicating success, return value is file Handle, if the return value is -1, indicates the operation failure. The function prototype is as follows: int __fastcall filecreate (const system :: Ansistring filename); 3. FileRead reads the data of the specified byte from the file to the buffer, the function returns the actual The number of bytes read, the function prototype is as follows; int __fastcall fileRead (INT HANDLE, VOID * BUFFER, INT COUNT); 4. FileWrite writes the buffer's data to the current location of the specified file to go to the current location of the specified file. If the operation is successful, the function Returns the number of bytes that is actually written. If returns to -1, the operation generates an error, the function prototype is as follows: int __fastcall filewrite (int Handle, Const Void * Buffer, int Count); 5. Fileseek Adjust the file pointer to the new location, if the operation is successful, return to the new file location, if the operation fails, the function returns -1, the function prototype is as follows: int __fastcall fileseek (int Handle, int offset, int tent, int ORIGIN); 6. FileClose Close the specified file, the function prototype is as follows: void __fastcall fileclose (INT HANDLE); 7. Fileage Returns the time tab of the specified file, if the operation fails, return -1, function prototype as follows: int __fastcall fileage const system :: anistring filename); 8. FileExists is used to test whether the specified file exists, if there is a return true, otherwise return the fake, the function prototype is as follows: BOOL __FASTCALL FILEEXISTS (const system :: ANSISTRING FILENAME); 9. FilegetDate Returns specified DOS time label of files, if the operation fails, then the -1, the function prototype is as follows: int __fastcall filegetdate (int Handle); 10.FileSetDate Change the DOS Time Label of the specified file, if the operation is successful, return 0, otherwise return error code The function prototype is as follows: int __fastcall filesetdate (INT HANDLE, INT AGE); 11.Filegetttr Returns the properties of the specified file, if the operation fails, the function returns -1, the function prototype is as follows; int __fastcall filegetttr (const system :: Ansistring filename) ;

12.FileSetattr Change the attribute parameters of the specified file, return 0, the function prototype is as follows; int __fastcall filesetttr (const system :: Ansistring filename, int attr); 13.FindFirst In the specified file directory, search for a specific The file file of the attribute parameter, if the function returns 0, otherwise the function returns an error code, the function prototype is as follows: int __fastcall findfirst (const system :: Ansistring Path, int Attr, Tsearchrec & f); 14 .FindNext Continue to search for files specified by the property parameter specified by FindFirst, if the function returns 0, otherwise the function returns an error code, the function prototype is as follows: int __fastcall findnext (TsearchRec & f); 15.FindClose release The memory resources applied for the FindFirst operation, the function prototype is as follows: void __fastcall findclose (Tsearchrec & f); 16.Deletefile deletes the specified file in the computer disk, if the operation is successful, the function returns true, the function prototype is as follows: BOOL __FASTCALL DELETEFILE (Const) Ansistring filename); 17.RenameFile changes the name of the specified file, if the operation is successful, the function returns true, the function prototype is as follows: BOOL __FASTCALL RENAMEFILE (const ANSISTRING OLDNAME, Const AnsiString NewName); 18.changefileExt changes the extension of the specified file, function prototype is as follows: AnsiString __fastcall ChangeFileExt (const AnsiString FileName, const AnsiString Extension); 19.ExtractFilePath specified file path back to work, the following function prototype: AnsiString __fastcall ExtractFilePath (const AnsiString FileName); 20.ExtractFileDir working directory returns the specified file, the function The prototype is as follows: ANSISTRING __FASTCALL EXTRACTFILEDIR (CO nst AnsiString FileName); 21.ExtractFileDrive drive returns the specified file, the following function prototype: AnsiString __fastcall ExtractFileDrive (const AnsiString FileName); 22.ExtractFileName returns the specified file name and extension, the following function prototype: AnsiString __fastcall ExtractFileName (const AnsiString FileName); 23.ExtractFileExt Returns the extension of the specified file, the function prototype is as follows: Ansistring __fastcall extractfileext (const anestring filename); 3, Borland C Builder VCL Disk Management Function 1. DiskFree Returns the remaining space of the specified disk, if the operation is successful, Returns the remaining disk space, if the operation fails, return -1, function prototype as follows: int __fastcall diskfree (Byte Drive); 2. Disksize returns a space for the specified disk, if the operation is successful, return disk space, if the operation fails, return- 1, the function prototype is as follows: int __fastcall disk; 3. GetCurrentDir Returns the current working directory, the function prototype is as follows: ansistring __fastcall getcurrentdir (); 4. SetCurrentDir Set the current work directory, if the operation is successful, return true, function prototype As follows: BOOL __FASTCALL setCurrentdir (const onswout);

5. CREATEDIR creates a new directory, if the operation is successful, return true, otherwise return the fake, the function prototype is as follows: BOOL __FASTCALL CREATEDIR (Const Ansistring Dir); 6. Removedir Deletes the specified directory, if the operation is successful, return true, otherwise return fake , the following function prototype: bool __fastcall RemoveDir (const AnsiString Dir); four .Borland C Builder VCL 1. upperCase string functions specified character string is converted to uppercase AnsiString, the following function prototype: AnsiString __fastcall upperCase (const AnsiString S) 2. LowerCase converts the specified Ansistring string to lowercase form, the function prototype is as follows: Ansistring __fastcall limited; 3. CompareStr compares two ansistring strings, the function prototype is as follows: int __fastcall compareStr (Const Ansistring S1, Const Ansistring S2); 4. Comparext Compare two ansistring strings, function prototypes as follows: int __fastcall compareter (const ANSISTRING S1, Const Ansistring S2); 5. Strlen Returns the length of the string, the function protector is as follows: cardinal __fastcall strlen (Const Char * STR); 6. Strend returns a string end pointer, the function prototype is as follows: char * __fastcall strend (const char * str); 7. Strmove From the source string to the purpose of the character string specified number of characters, the function prototype is as follows: CHAR * __FASTCALL STRMOVE (CHAR * DEST, Const Char * Source, Cardinal Count); 8. Strcopy copies the source string to the destination string, the function prototype is as follows: char * __fastcall strcopy (char * dest, const char * SOURCE) ; 9. Streec copy the source string into the destination string and returns the target string The tail pointer, the function prototype is as follows: char * __fast, const char * source; 10.Strlcopy Specifies the number of characters to the destination string to the destination string and returns the source string pointer, the function prototype is as follows : char * __fastcall strlcopy (CHAR * DEST, Const Char * Source, Cardinal Maxlen); 11.Strpcopy copies the source string of the ansistring type to the destination string and returns the target string pointer, the function prototype is as follows: char * __fastcall StrPcopy; 12.StrPLCopy Specifies the source string (Ansistring type) to copy the number of characters to the destination string, and return to the target string pointer, the function prototype is as follows: char * __fastcall strplcopy (charr * DEST, CONST ANSISTRING SOURCE, CARDINAL MAXLEN; 13.Strcat Connect two strings, and return to the target string pointer, the function prototype is as follows: char * __fastcall strcat (char * dest, const char * Source); 14.Strlcat The specified number of source strings are connected to the destination string, and return to the target string pointer, the function prototype is as follows: char * __fastcall strlcat (char * dest, const char * source, cardinal maxlen);

15. Strcomp two strings are compared, return comparison results, the function prototype is as follows: int __fastcall strcomp (const char * str1, const char * str2); 16.Stricomp two strings compare each other (regardless of case), Returns the result of the comparison, the function prototype is as follows: int __fastcall strix (const char * str1, const char * str2); 17.Strlcomp compare operations for two strings specified by the number, the function prototype is as follows: int __fastcall strlcomp (Const char * Str1, const char * str2, cardinal maxlen; 18.STRSCAN looks for a specific character in the specified string and returns the pointer of the first specific character in the string, the function prototype is as follows: char * __fastcall strscan (Const char * STR, CHAR CHR); 19.Strrscan looks for a specific character in the specified string and returns the pointer of the last specific character in the string, the function prototype is as follows: char * __fastcall strrscan (const char * str, char chr) 20. StrPOS looks for STR2 specified in the string specified by Strl, and returns the pointer of the STR2 in STR2 in STR2, the function prototype is as follows: char * __fastcall strpos (const char * str1, const CHAR * STR2); 21.Strupper converts strings to uppercase forms, function prototype as follows: char * _ str); 22.Strlow converts strings to lowercase form, function prototype as follows: char * __fastcall strlower CHAR * STR); 23.StrPAS converts the specified string to ansistring type string object, the function prototype is as follows: Ansistring __fastcall strpaas (const char * str); 24.stralloc Assign the memory of the specified byte in the string and returns Memory pointer, function prototype as follows: char * __fastcall stralloc (cardinal size); 25.StrbufSize Returns * Str's size, The function prototype is as follows: Cardinal __fastcall strbufsize (const char * str); 26. StrNew allocates space for specified string in the heap, and copy string to this space, the function prototype is as follows: char * __fastcall strnew (const char * strn ); Groupborland C Builder VCL Value Conversion Function 1. INTOSTR converts an integer to ansistring string, the function prototype is as follows: Ansistring __fastcall INTOSTR (INT VALUE); 2. INTTOHEX converts integers to hexadecimal strings, functions The prototype is as follows: Ansistring __fastcall INTTOHEX (INT VALUE, INT DITITS); 3. STRTOINT converts the ANSISTRING string into an integer value, if the conversion is not converted, generate the EconvertError exception, the function prototype is as follows: int __fastcall strt (const ANSISTRING S); 4 . StrToIntDef AnsiString the string into a numerical value, the following function prototype: int __fastcall StrToIntDef (const System :: AnsiString S, int Default); 5 FloatToStr AnsiString string converting floating-point numbers, the following function prototype:. AnsiString __fastcall FloatToStr ( Extended value);

转载请注明原文地址:https://www.9cbs.com/read-13155.html

New Post(0)