Introduction to C ++ Builder VCL library function

zhaozj2021-02-16  100

I. Orland C Builder VCL Memory Management Function 1. Allocmem Assigns the memory block of the specified byte in the team and initializes each byte of the assigned to 0. The prototype is as follows: void * __fastcall allocmem (cardinal size); 2 Sysfreemem releases the specified memory block. The function prototype is as follows: INT __fastcall sysfreemem (void * p); 3. SysReallocMem requires reassign the memory specified by the parameter size. The function prototype is as follows: void * __fastcall sysReallocMem (void * p, int size );

II. Borland C Builder VCL file Operation Function 1. FileOpen Open the specified file, if returned as positive, the operation is successful, the return value is the file handle: If the return value is -1, the operation failure, the function prototype is as follows: int __fastcall fileopen (const system :: answer filename, int mode); 2. FileCreate Create a new file with the specified file name, if the positive number is returned, indicating success, return value is a file handle, if the return value is -1 Indicating the failure of the operation. The function prototype is as follows: int __fastcall filecreate (const system :: Ansistring filename); 3. FileRead Read the data of the specified byte from the file to the buffer, the function returns the number of bytes, functions that actually read. The prototype is as follows; int __fastcall foughread (int Handle, Void * Buffer, int count); 4. FileWrite writes the buffer data to the current location of the specified file to go to the number of bytes actually written in the actual write If returned to -1, the operation generates an error, the function prototype is as follows: int __fastcall filewrite (int COUNT); 5. Fileseek Adjust the file pointer to the new location, if the operation is successful, return The new file location, if the operation fails, the function returns -1, the function prototype is as follows: int __fastcall fileseek; 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 :: ANSISTRING FILENAME); 8. FileExists is used to test the specified file to exist, If there is a return, otherwise return, the function prototype is as follows: BOOL __FASTCALL FILEEXISTS (const system :: Ansistring FileName ); 9. FilegetDate Returns the DOS time tag of the specified file, 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, Returns 0, otherwise the error code is returned, 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, if the operation is successful, return 0, the function prototype is as follows; int __fastcall filesetattr (const system :: Ansistring filename, int attr);

13.FindFirst In the specified file directory, search for files that meet the specific attribute parameters, if the function returns 0 if the function is successfully found, 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 successfully find the eligible file, then the function returns 0, otherwise the function returns an error code, function The prototype is as follows: int __fastcall findnext; 15.FindClose releases the memory resources applied for the FindFirst operation, the function prototype is as follows: void __fastcall findclose (TsearchRec &; f); 16.deletefile Remove 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 DELETEFILE (const ANSISTISTRING DELETEFILE (const ANSISTRING DELENAME); 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 change how the file extension, the function prototype is as follows: AnsiString __fastcall ChangeFileExt (const AnsiString FileName, const AnsiString extension); 19.ExtractFilePath return to work the path of the specified file, the function prototype is as follows: AnsiString __fastcall ExtractFilePath (const AnsiString FileName); 20.ExtractFileDir working directory returns the specified file, the following function prototype: AnsiString __fastcall ExtractFileDir (const AnsiString FileName); 21.ExtractFileDrive return the drive of 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 specified file extension, the following function prototype: ANSISTRING __FASTCALL ExtractFileExt (const anstring filename);

Third, the 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, return -1, the function prototype is as follows: int __fastcall diskfree (Byte Drive); 2. Disksize Returns the space for the specified disk, if the operation is successful, return disk space, return -1, function prototype as follows: int __fastcall disksize; 3. getCurrentDir returns the current working directory, the function prototype is as follows: Ansistring __fastcall getcurrentdir (); 4. SetCurrentDir Sets the current work directory, if the operation is successful, the function prototype is as follows: BOOL __FASTCALL SETCURRENTDIR (const anestring dir); 5. CREATEDIR Creates a new directory, if the operation is successful, return true, return true, Otherwise, return, the function prototype is as follows: BOOL __FASTCALL CREATEDIR (Const Ansistring Dir); 6. RemoveDir Deletes the specified directory, if the operation is successful, return to the true, otherwise return, the function prototype is as follows: BOOL __FASTCALL Removedir (const anestring dir);

Four. Orland C Builder VCL string function 1. Uppercase converts the specified Ansistring string to uppercase form, the function prototype is as follows: ANSISTRING __FASTCALL UPPERCASE (Const Ansistring S); 2. LowerCase converts the specified Ansistring string to lowercase form , the following function prototype: AnsiString __fastcall LowerCase (const AnsiString S); 3. CompareStr AnsiString compare two strings, the following function prototype: int __fastcall CompareStr (const AnsiString S1, const AnsiString S2); 4. CompareText compare two strings AnsiString The function prototype is as follows: INT __FASTCALL COMPARETEXT (Const Ansistring S1, Const AnsiString S2); 5. Strlen Returns the length of the string, the function prototype is as follows: cardinal __fastcall strlease; 6. Strend Returns the skewarn 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, the 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; 9. Stregopy copies the source string to the destination string And return to the target string end pointer, the function prototype is as follows: char * __fastcall strecopy; 10.Strlcopy Specify the source string to the destination string and return the character The 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 (CHAR * DEST, Const Anstring Source); 12.StrPLCopy Specifies the source string (Ansistring type) to copy to the destination string, and return to the target string pointer, the function prototype is as follows: char * __fastcall strplcopy (char * 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 will specify 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, function prototypes as follows: int __fastcall strcomp (const char * str1, const char * STR2); 16. StriComp two strings Compare (no matter in case), return comparison results, the function prototype is as follows: int __fastcall stricsp (const char * str1, const char * str2); 17.Strlcomp pair two strings The specified number of characters is compared, 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 string A pointer of a particular character, 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 a pointer to 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 by Str2 in string, and returns the first child character in STR2 in Str2 The pointer, the function prototype as follows: char * __fastcall strpos (const char * str1, const char * str2); 21.Strupper converts strings to uppercase form, function prototype as follows: char * __fastcall struffper (char * STR); 22. Strlower converts strings to lowercase forms, the function prototype is as follows: char * _ str); 23.StrPAS converts the specified string to ansistring type string object, the function prototype is as follows: Ansistring __fastcall STRP AS (const char * str); 24.stralloc Assign the memory of the specified byte in the string and returns the memory pointer, the function prototype is as follows: char * __fastcall stralloc (cardinal size); 25.StrbufSize Returns * Str's size points to memory 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 into this space, the function prototype is as follows: char * __fastcall strnew (const char * STR);

5. Numerical conversion function of Orland C Builder VCL 1. INTOSTR converts an integer to ansistring string, the function prototype is as follows: ANSISTRING __FASTCALL INTOSTR (INTTOHEX); 2. INTTOHEX converts the integer into a hexadecimal string, the function 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 the AnsiString 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 ); STRTOFLOAT converts the ANSISTRING string into a floating point value, the function prototype is as follows: 8.0TOSTRING S); 7. FLOATTOSTRF converts the floating point number to the Ansistring string of the specified format, the function prototype is as follows: Ansistring __fastcall FLOATTOSTRF (Extended Value, Tfloatformat Format, Int Precision, Int Digits);

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

New Post(0)