📄 stafstring.h
字号:
/***********************************************************************/STAFRC_t STAFStringNumOfWords(STAFStringConst_t aString, unsigned int *num, unsigned int *osRC);/***********************************************************************//* STAFStringAssign - Assigns a STAFString to another STAFString, clea-*//* ning up any resources taken by the target string *//* *//* Accepts: (In) A STAFString_t (target) *//* (In) A STAFString_t (source) *//* (Out) A pointer to an OS return code (may be NULL) *//* *//* Returns: kSTAFOk on success *//* other on error *//***********************************************************************/STAFRC_t STAFStringAssign(STAFString_t aTarget, STAFStringConst_t aSource, unsigned int *osRC);/***********************************************************************//* STAFStringGetBuffer - Returns a pointer to the buffer containing *//* the bytes that represent a STAFString *//* *//* Accepts: (In) A STAFString_t *//* (Out) A pointer to the buffer *//* (Out) A pointer to the length of the buffer *//* (Out) A pointer to an OS return code (may be NULL) *//* *//* Returns: kSTAFOk on success *//* other on error *//***********************************************************************/STAFRC_t STAFStringGetBuffer(STAFStringConst_t aString, const char **buffer, unsigned int *len, unsigned int *osRC);/***********************************************************************//* STAFStringToLowerCase - Converts only Latin Alphabet letters A-Z to *//* a-z from a STAFString *//* *//* Accepts: (In)/(Out) A STAFString_t to convert *//* (Out) A pointer to an OS return code (may be NULL) *//* *//* Returns: kSTAFOk on success *//* other on error *//***********************************************************************/STAFRC_t STAFStringToLowerCase(STAFString_t aString, unsigned int *osRC);/***********************************************************************//* STAFStringToUpperCase - Converts only Latin Alphabet letters a-z to *//* A-Z from a STAFString *//* *//* Accepts: (In)/(Out) A STAFString_t to convert *//* (Out) A pointer to an OS return code (may be NULL) *//* *//* Returns: kSTAFOk on success *//* other on error *//***********************************************************************/STAFRC_t STAFStringToUpperCase(STAFString_t aString, unsigned int *osRC);/***********************************************************************//* STAFStringReplace - Replaces all oldStrings in a STAFString with *//* newString fixing the length of the string if *//* necessary *//* *//* Accepts: (In)/(Out) A STAFString_t to modify *//* (In) The STAFString to be replaced *//* (In) The STAFString to replace with *//* (Out) A pointer to an OS return code (may be NULL) *//* *//* Returns: kSTAFOk on success *//* other on error *//***********************************************************************/STAFRC_t STAFStringReplace(STAFString_t aString, STAFStringConst_t oldString, STAFStringConst_t newString, unsigned int *osRC);/***********************************************************************//* STAFStringToCurrentCodePage - Returns a buffer of size len contain- *//* ing the current codepage representa- *//* tion of a STAFString *//* *//* Accepts: (In) A STAFString_t *//* (Out) A buffer with the local codepage characters *//* (Out) The size of the allocated buffer *//* (Out) A pointer to an OS return code (may be NULL) *//* *//* Returns: kSTAFOk on success *//* other on error *//* *//* Note : This function allocates memory that must be freed up with *//* STAFStringFreeBuffer. *//* *//* Note : The returned buffer has a terminating NULL byte. This *//* byte is not counted in the length which is returned. *//* *//***********************************************************************/STAFRC_t STAFStringToCurrentCodePage(STAFStringConst_t aString, char **to, unsigned int *len, unsigned int *osRC);/***********************************************************************//* STAFStringConcatenate - Concatenates a STAFString with another *//* STAFString *//* *//* Accepts: (In)/(Out) A STAFString_t *//* (In) A STAFString_t *//* (Out) A pointer to an OS return code (may be NULL) *//* *//* Returns: kSTAFOk on success *//* other on error *//***********************************************************************/STAFRC_t STAFStringConcatenate(STAFString_t aString, STAFStringConst_t aSource, unsigned int *osRC);/***********************************************************************//* STAFStringCountSubStrings - Counts the number of times a particular *//* substring appears in a STAFString *//* *//* Accepts: (In) A STAFString_t *//* (In) A STAFString_t *//* (Out) The count of substrings *//* (Out) A pointer to an OS return code (may be NULL) *//* *//* Returns: kSTAFOk on success *//* other on error *//***********************************************************************/STAFRC_t STAFStringCountSubStrings(STAFStringConst_t aString, STAFStringConst_t aSubStr, unsigned int *count, unsigned int *osRC);/***********************************************************************//* STAFStringStripCharsOfType - Strips chars of a type from the left, *//* right, or both sides of a STAFString *//* *//* Accepts: (In)/(Out) A STAFString_t *//* (In) A STAFUTF8CharType_t *//* (In) 0->trim left, 1->trim right, 2->trim both *//* (Out) A pointer to an OS return code (may be NULL) *//* *//* Returns: kSTAFOk on success *//* other on error *//***********************************************************************/STAFRC_t STAFStringStripCharsOfType(STAFString_t aInOutStr, STAFUTF8CharType_t aType, unsigned int side, unsigned int *osRC);/***********************************************************************//* STAFStringToUInt - Returns the numeric value of a STAFString *//* *//* Accepts: (In) A STAFString_t *//* (Out) A pointer to the numeric value of the string *//* (In) The base in which the value is represented [1..16] *//* (Out) A pointer to an OS return code (may be NULL) *//* *//* Returns: kSTAFOk on success *//* other on error *//***********************************************************************/STAFRC_t STAFStringToUInt(STAFStringConst_t aString, unsigned int *value, unsigned int base, unsigned int *osRC);/***********************************************************************//* STAFStringLength - Returns the char or byte length of a STAFString *//* *//* Accepts: (In) A STAFString_t *//* (Out) A pointer to the char length of the string *//* (In) 0->char length of string, 1->byte length of string *//* (Out) A pointer to an OS return code (may be NULL) *//* *//* Returns: kSTAFOk on success *//* other on error *//***********************************************************************/STAFRC_t STAFStringLength(STAFStringConst_t aString, unsigned int *len, unsigned int corb, unsigned int *osRC);/***********************************************************************//* STAFStringSizeOfChar - Returns the number of bytes contained in a *//* particular char of a STAFString *//* *//* Accepts: (In) A STAFString_t *//* (In) The index of the char to measure (0 based) *//* (In) 0->char index, 1->byte index *//* (Out) A pointer to the byte length of a char of a string *//* (Out) A pointer to an OS return code (may be NULL) *//* *//* Returns: kSTAFOk on success *//* other on error *//***********************************************************************/STAFRC_t STAFStringSizeOfChar(STAFStringConst_t aString, unsigned int index, unsigned int corb, unsigned int *len, unsigned int *osRC);/***********************************************************************//* STAFStringByteIndexOfChar - Returns the byte location in the string *//* buffer of a specified char *//* *//* Accepts: (In) A STAFString_t *//* (In) The char index *//* (Out) A pointer to the byte location of the char *//* (Out) A pointer to an OS return code (may be NULL) *//* */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -