![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]() ![]() |
![]() [Introduction] [Overview] [Core reference] [3D reference] [GUI] IndexEFile_Load EFile_MkDir EFile_OpenFileLoad EFile_Save EStr_CurrentDir EStr_MillisecondsToString EStr_MicrosecondsToString EStr_NanosecondsToString EStr_StringToInt EStr_StringToIntChk EStr_StringToIntHex EStr_StringGetUnique EStr_StringGetAndAddUniqueA EStr_EqualW EStr_CorrectDirName EStr_CorrectPath EStr_GetPathName EStr_WCharNToASCII EStrDupWtoUTF8 EStrNDupWtoUTF8 EStr_StringAfterPrefix EStr_GetLine EFile_LoadA simple file reader with error checkingSyntax Arguments Description It adds a 0 at the end of the buffer, so if it was a text file it will be properly 0-terminated. Return value E_SUCCESS in all went well, otherwise the error code (E_NO_FILENAME, E_DIRECTORY, E_NO_READ_PERMISSION etc.) EFile_MkDirCreate a directorySyntax Arguments Description Creates a directory specified by PName. If PRecursive is TRUE, and directories above PName don't exist, it will create any directories leading to PName. Otherwise (if PRecursive is false), it returns an error. Return value E_SUCCESS if successful, otherwise an appropriate error code. EFile_OpenFileLoadA simple file reader with error checkingSyntax Arguments Description It adds a 0 at the end of the buffer, so if it was a text file it will be properly 0-terminated. Return value E_SUCCESS in all went well, otherwise the error code (E_NO_MEMORY) EFile_SaveA simple file saver, with error checkingSyntax Arguments Description Saves a data buffer to a file. Return value E_SUCCESS in all went well, otherwise the error code (E_NO_FILENAME, E_DIRECTORY, E_NO_READ_PERMISSION etc.) EStr_CurrentDirReturn the current working directorySyntax Arguments Description The resulting string will be allocated with EMalloc, so it will be the caller's responsibility to free it when it's not used any more. Return value The current working directory or NULL in case of an error EStr_MillisecondsToStringConvert milliseconds to a stringSyntax Arguments Description Converts milliseconds to a string with automatic switch to seconds, minutes or hours, depending on the value. If PAlign is TRUE, try to keep the string the same length (e.g " 3.450 ms"). This is useful, for example for interactively printing frame rendering times, so the string stays aligned as the value changes. Return value Pointer to the string. See also EStr_MicrosecondsToStringConvert microseconds to a stringSyntax Arguments Description Converts microseconds to a string with automatic switch to milliseconds, seconds, minutes or hours, depending on the value. If PAlign is TRUE, try to keep the string the same length (e.g " 3.450 ms"). This is useful, for example for interactively printing frame rendering times, so the string stays aligned as the value changes. Return value Pointer to the string. See also EStr_NanosecondsToStringConvert nanoseconds to a stringSyntax Arguments Description Converts nanoseconds to a string with automatic switch to microseconds, milliseconds, seconds, minutes or hours, depending on the value. If PAlign is TRUE, try to keep the string the same length (e.g " 3.450 ms"). This is useful, for example for interactively printing frame rendering times, so the string stays aligned as the value changes. Return value Pointer to the string. See also EStr_StringToIntConvert string to integerSyntax Argument Description Converts an ASCII string to an integer. No error checking is done. If the string does not contain a valid number, the result is indeterminate. Return value The resulting ingeter EStr_StringToIntChkConvert string to integer with error checkingSyntax Argument Description Converts an ASCII string to an integer. Error checking is done. If the string does not contain a valid number, the result is indeterminate and an error code is returned. Note that the resulting integer will be returned in PValueP. This is for consistency with error reporting (as the return value). PValueP may be NULL. In this case, only the error checking is performed. Return value Status code E_SUCCESS, E_NO_DATA, or E_INCOMPATIBLE_DATA EStr_StringToIntHexConvert string to integerSyntax Argument Description Converts an ASCII string to an integer. No error checking is done. If the string does not contain a valid number, the result is indeterminate. Return value The resulting ingeter EStr_StringGetUniqueCreate a string that is based on a given string, but is different from all the strings in an arraySyntax Arguments Description EStr_StringGetUnique() first checks if PString is in the array, PStrings. If it is not, it simply returns a duplicate of PString. If the string is found in the array, it adds a postfix '-x', where x is a number, and increments the number until the resulting string is unique. Return value A unique string, based on PString, or NULL in case of an error EStr_StringGetAndAddUniqueACreate a string that is based on a given string, but is different from all the strings in an arraySyntax Arguments Description EStr_StringGetUnique() first checks if PString is in the array, LStrings. If it is not, it simply returns a duplicate of PString. If the string is found in the array, it adds a postfix '-x', where x is a number, and increments the number until the resulting string is unique. Return value A unique string, based on PString, or NULL in case of an error EStr_EqualWCheck two wide-character strings if they are equalSyntax Arguments Description Checks if the two strings are equal. NULL pointers are accepted. 2 NULL pointers mean equality. Return value TRUE, if the strings are equal, FALSE otherwise. EStr_CorrectDirNameCorrect dir name:rect dir name: t dir name: ir name: name: e: // - remove multiple '//'s - remove multiple '//'s emove multiple '//'s ve multiple '//'s multiple '//'s tiple '//'s le '//'s '//'s 's // - expand ~ and environment variables Syntax Argument Description Corrects a directory name by removing multiple '/' characters and expanding '~' (home directory) and any environment variables. The resulting string will be allocated with EMalloc, so it will be the caller's responsibility to free it when it's not used any more. Return value The corrected directory path EStr_CorrectPathCorrect path namerect path name t path name ath name name me // - remove multiple '//'s - remove multiple '//'s emove multiple '//'s ve multiple '//'s multiple '//'s tiple '//'s le '//'s '//'s 's // - expand "~" and environment variables Syntax Argument Description Corrects a path name by removing multiple '/' characters and expanding '~' (home directory) and any environment variables. A path name may include a directory name + a file name at the end. The resulting string will be allocated with EMalloc, so it will be the caller's responsibility to free it when it's not used any more. Return value The corrected path EStr_GetPathNameGet path name from a full pathSyntax Arguments Description Returns the path name without any file name at the end. Return value None. EStr_WCharNToASCIIConvert a wide-character string to ASCIISyntax Argument Description Converts PLen wide characters to ASCII. Return value The number of characters that were within the ASCII range. See also EStrDupWtoUTF8Convert a wide-character string into UTF-8 formatSyntax Argument Description Allocates enough memory and converts a wide-character string into UTF-8 format. Return value Pointer to the new string, or NULL in case of an error. See also EStrNDupWtoUTF8Convert a wide-character string into UTF-8 formatSyntax Argument Description Allocates enough memory and converts a wide-character string into UTF-8 format. Return value Pointer to the new string, or NULL in case of an error. See also EStr_StringAfterPrefixGet string after a prefixSyntax Argument Description Skip a prefix in a string, if the string begins with that prefix. Return value If PStr begins with PPrefix, return the portion of PStr after that. Otherwise, PStr. EStr_GetLineGet a line from a bufferSyntax Arguments Description Processes a line in a buffer. Lines may be terminated with either 0x0A or 0x0D + 0x0A. Return value Offset to the beginning of the next line |