sbgECom Library
5.2.590-stable
Interface SBG Systems IMU/AHRS/INS
|
Character string. More...
Go to the source code of this file.
Data Structures | |
struct | _SbgString |
struct | _SbgStringIterator |
Macros | |
#define | SBG_STRING_INTERNAL_BUFFER_MIN_SIZE (4) |
#define | SBG_STRING_INTERNAL_BUFFER_DEFAULT_SIZE (16) |
Typedefs | |
typedef struct _SbgString | SbgString |
typedef struct _SbgStringIterator | SbgStringIterator |
Character string.
The MIT license
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SBG_STRING_INTERNAL_BUFFER_MIN_SIZE (4) |
Minimum size of the internal buffer, in bytes.
This constant must be strictly positive in order to guarantee that no errors can occur during the construction of an empty string.
#define SBG_STRING_INTERNAL_BUFFER_DEFAULT_SIZE (16) |
Default size of the internal buffer, in bytes.
typedef struct _SbgString SbgString |
String.
The buffer contains a C null-terminated string. The null-terminating character is not considered to be part of the string content.
Attempts to modify a read-only string lead to undefined behavior.
Attempts to modify a string while the last modification operation error is set are canceled and return the last error code.
typedef struct _SbgStringIterator SbgStringIterator |
String iterator.
SBG_COMMON_LIB_API void sbgStringConstructEmpty | ( | SbgString * | pString | ) |
String constructor.
The rationale for this constructor is to guarantee that no errors may occur on the construction of empty strings.
[in] | pString | String. |
References SBG_COMMON_LIB_API.
SBG_COMMON_LIB_API SbgErrorCode sbgStringConstruct | ( | SbgString * | pString, |
const SbgString * | pSourceString ) |
String constructor.
The string content is initialized from the given source string. If that string is NULL, the string is initialized with an empty content.
[in] | pString | String. |
[in] | pSourceString | Source string, may be NULL. |
References SBG_COMMON_LIB_API.
SBG_COMMON_LIB_API SbgErrorCode sbgStringConstructCString | ( | SbgString * | pString, |
const char * | pCString ) |
String constructor.
The string content is initialized from the given C null-terminated string.
[in] | pString | String. |
[in] | pCString | C null-terminated string. |
References SBG_COMMON_LIB_API.
SBG_COMMON_LIB_API SbgErrorCode sbgStringConstructVF | ( | SbgString * | pString, |
const char * | pFormat, | ||
va_list | args ) |
String constructor.
The string content is initialized from formatted data from a variable argument list.
[in] | pString | String. |
[in] | pFormat | Format. |
[in] | args | Variable argument list. |
References SBG_COMMON_LIB_API.
SBG_COMMON_LIB_API SbgErrorCode SBG_COMMON_LIB_API SbgErrorCode sbgStringConstructF | ( | SbgString * | pString, |
const char * | pFormat, | ||
... ) |
String constructor.
The string content is initialized from formatted data.
[in] | pString | String. |
[in] | pFormat | Format. |
References SBG_COMMON_LIB_API.
SBG_COMMON_LIB_API SbgErrorCode SBG_COMMON_LIB_API SbgErrorCode SBG_COMMON_LIB_API SbgErrorCode sbgStringConstructStatic | ( | SbgString * | pString, |
const char * | pCString, | ||
char * | pBuffer, | ||
size_t | size ) |
String constructor.
The string content is initialized from the given C null-terminated string.
If the C null-terminated string is NULL then the string contains the content of the given buffer before construction. In this case the content of the given buffer must be a C null-terminated string.
The given buffer is owned by the string and must not be modified while the string is in use. After destroying the string, the buffer contains the content of the string immediately before destruction.
[in] | pString | String. |
[in] | pCString | C null-terminated string, may be NULL. |
[in] | pBuffer | Buffer. |
[in] | size | Buffer size, in bytes. |
References SBG_COMMON_LIB_API, and sbgStringConstructStatic().
Referenced by sbgStringConstructStatic().
SBG_COMMON_LIB_API void sbgStringConstructReadOnly | ( | SbgString * | pString, |
const char * | pCString ) |
String constructor.
The string cannot be modified.
The given C null-terminated string provides both the statically allocated buffer for the string, as well as its content. It is owned by the string and must not be modified.
[in] | pString | String. |
[in] | pCString | C null-terminated string. |
References SBG_COMMON_LIB_API, and sbgStringConstructReadOnly().
Referenced by sbgStringConstructReadOnly().
SBG_COMMON_LIB_API void sbgStringDestroy | ( | SbgString * | pString | ) |
String destructor.
[in] | pString | String. |
References SBG_COMMON_LIB_API, and sbgStringDestroy().
Referenced by sbgStringDestroy().
SBG_COMMON_LIB_API int32_t sbgStringCompare | ( | const SbgString * | pString, |
const SbgString * | pOtherString ) |
Compare a string to another string.
[in] | pString | String. |
[in] | pOtherString | Other string. |
References SBG_COMMON_LIB_API, and sbgStringCompare().
Referenced by sbgStringCompare().
SBG_COMMON_LIB_API int32_t sbgStringCompareCString | ( | const SbgString * | pString, |
const char * | pCString ) |
Compare a string to a C null-terminated string.
[in] | pString | String. |
[in] | pCString | C null-terminated string. |
References SBG_COMMON_LIB_API, and sbgStringCompareCString().
Referenced by sbgStringCompareCString().
SBG_COMMON_LIB_API int32_t sbgStringCompareIgnoreCase | ( | const SbgString * | pString, |
const SbgString * | pOtherString ) |
Compare a string to another string, ignoring case differences.
[in] | pString | String. |
[in] | pOtherString | Other string. |
References SBG_COMMON_LIB_API, and sbgStringCompareIgnoreCase().
Referenced by sbgStringCompareIgnoreCase().
SBG_COMMON_LIB_API int32_t sbgStringCompareIgnoreCaseCString | ( | const SbgString * | pString, |
const char * | pCString ) |
Compare a string to a C null-terminated string, ignoring case differences.
[in] | pString | String. |
[in] | pCString | C null-terminated string. |
References SBG_COMMON_LIB_API, and sbgStringCompareIgnoreCaseCString().
Referenced by sbgStringCompareIgnoreCaseCString().
SBG_COMMON_LIB_API size_t sbgStringHash | ( | const SbgString * | pString | ) |
Compute the hash value of a string.
[in] | pString | String. |
References SBG_COMMON_LIB_API, and sbgStringHash().
Referenced by sbgStringHash().
SBG_COMMON_LIB_API size_t sbgStringGetLength | ( | const SbgString * | pString | ) |
Get the length of a string (not including the terminating null character), in bytes.
[in] | pString | String. |
References SBG_COMMON_LIB_API, and sbgStringGetLength().
Referenced by sbgStringGetLength().
SBG_COMMON_LIB_API const char * sbgStringGetCString | ( | const SbgString * | pString | ) |
Get a C null-terminated string version of a string.
The pointer returned remains valid until the next modification operation on the string.
[in] | pString | String. |
References SBG_COMMON_LIB_API, and sbgStringGetCString().
Referenced by sbgStringGetCString().
SBG_COMMON_LIB_API SbgErrorCode sbgStringCharAt | ( | const SbgString * | pString, |
size_t | index, | ||
char * | pChar ) |
Get a character in a string.
[in] | pString | String. |
[in] | index | Index. |
[out] | pChar | Character. |
References SBG_COMMON_LIB_API, and sbgStringCharAt().
Referenced by sbgStringCharAt().
SBG_COMMON_LIB_API size_t sbgStringFind | ( | const SbgString * | pString, |
const SbgString * | pStringToFind ) |
Get the index of the first occurrence of a string in a string.
[in] | pString | String. |
[in] | pStringToFind | String to find. |
References SBG_COMMON_LIB_API, and sbgStringFind().
Referenced by sbgStringFind().
SBG_COMMON_LIB_API size_t sbgStringFindCString | ( | const SbgString * | pString, |
const char * | pCString ) |
Get the index of the first occurrence of the given C null-terminated string in a string.
[in] | pString | String. |
[in] | pCString | C null-terminated string. |
References SBG_COMMON_LIB_API, and sbgStringFindCString().
Referenced by sbgStringFindCString().
SBG_COMMON_LIB_API SbgErrorCode sbgStringSubstring | ( | const SbgString * | pString, |
size_t | startIndex, | ||
size_t | endIndex, | ||
SbgString * | pSubstring ) |
Get a substring from a string.
The substring must be constructed before calling this function. If an error occurs, the last error of the substring is set by this function.
[in] | pString | String. |
[in] | startIndex | Start index. |
[in] | endIndex | End index. |
[out] | pSubstring | Substring. |
References SBG_COMMON_LIB_API, and sbgStringSubstring().
Referenced by sbgStringSubstring().
SBG_COMMON_LIB_API bool sbgStringStartsWith | ( | const SbgString * | pString, |
const char * | pCString ) |
Check if a C null-terminated string is at the beginning of a string.
[in] | pString | String. |
[in] | pCString | C null-terminated string. |
References SBG_COMMON_LIB_API, and sbgStringStartsWith().
Referenced by sbgStringStartsWith().
SBG_COMMON_LIB_API bool sbgStringEndsWith | ( | const SbgString * | pString, |
const char * | pCString ) |
Check if a C null-terminated string is at the end of a string.
[in] | pString | String. |
[in] | pCString | C null-terminated string. |
References SBG_COMMON_LIB_API, and sbgStringEndsWith().
Referenced by sbgStringEndsWith().
SBG_COMMON_LIB_API SbgErrorCode sbgStringGetLastError | ( | const SbgString * | pString | ) |
Get the last error of a modification operation on a string.
[in] | pString | String. |
References SBG_COMMON_LIB_API, and sbgStringGetLastError().
Referenced by sbgStringGetLastError().
SBG_COMMON_LIB_API void sbgStringClearLastError | ( | SbgString * | pString | ) |
Clear the last modification operation error of a string.
[in] | pString | String. |
References SBG_COMMON_LIB_API, and sbgStringClearLastError().
Referenced by sbgStringClearLastError().
SBG_COMMON_LIB_API SbgErrorCode sbgStringSetCharAt | ( | SbgString * | pString, |
size_t | index, | ||
char | c ) |
Set a character in a string.
The given index must be strictly lower than the string length. The given character must not be a null character.
[in] | pString | String. |
[in] | index | Index. |
[in] | c | Character. |
References SBG_COMMON_LIB_API, and sbgStringSetCharAt().
Referenced by sbgStringSetCharAt().
SBG_COMMON_LIB_API SbgErrorCode sbgStringAppend | ( | SbgString * | pString, |
const SbgString * | pAppendString ) |
Append a string to another string.
[in] | pString | String. |
[in] | pAppendString | String to append. |
References SBG_COMMON_LIB_API, and sbgStringAppend().
Referenced by sbgStringAppend().
SBG_COMMON_LIB_API SbgErrorCode sbgStringAppendCString | ( | SbgString * | pString, |
const char * | pCString ) |
Append a C null-terminated string to a string.
[in] | pString | String. |
[in] | pCString | C null-terminated string. |
References SBG_COMMON_LIB_API, and sbgStringAppendCString().
Referenced by sbgStringAppendCString().
SBG_COMMON_LIB_API SbgErrorCode sbgStringAppendVF | ( | SbgString * | pString, |
const char * | pFormat, | ||
va_list | args ) |
Append formatted data from a variable argument list to a string.
The string format, as well as the variable argument list, are the same as for vprintf.
[in] | pString | String. |
[in] | pFormat | Format. |
[in] | args | Variable argument list. |
References SBG_COMMON_LIB_API, and sbgStringAppendVF().
Referenced by sbgStringAppendVF().
SBG_COMMON_LIB_API SbgErrorCode SBG_COMMON_LIB_API SbgErrorCode sbgStringAppendF | ( | SbgString * | pString, |
const char * | pFormat, | ||
... ) |
Append formatted data to a string.
The string format, as well as the variable arguments, are the same as for printf.
[in] | pString | String. |
[in] | pFormat | Format. |
References SBG_COMMON_LIB_API, and sbgStringAppendF().
Referenced by sbgStringAppendF().
SBG_COMMON_LIB_API SbgErrorCode SBG_COMMON_LIB_API SbgErrorCode SBG_COMMON_LIB_API SbgErrorCode sbgStringAssign | ( | SbgString * | pString, |
const SbgString * | pAssignString ) |
Assign a string to another string.
[in] | pString | String. |
[in] | pAssignString | String to assign. |
References SBG_COMMON_LIB_API, and sbgStringAssign().
Referenced by sbgStringAssign().
SBG_COMMON_LIB_API SbgErrorCode sbgStringAssignCString | ( | SbgString * | pString, |
const char * | pCString ) |
Assign a C null-terminated string to a string.
[in] | pString | String. |
[in] | pCString | C null-terminated string. |
References SBG_COMMON_LIB_API, and sbgStringAssignCString().
Referenced by sbgStringAssignCString().
SBG_COMMON_LIB_API SbgErrorCode sbgStringAssignVF | ( | SbgString * | pString, |
const char * | pFormat, | ||
va_list | args ) |
Assign formatted data from a variable argument list to a string.
The string format, as well as the variable argument list, are the same as for vprintf.
[in] | pString | String. |
[in] | pFormat | Format. |
[in] | args | Variable argument list. |
References SBG_COMMON_LIB_API, and sbgStringAssignVF().
Referenced by sbgStringAssignVF().
SBG_COMMON_LIB_API SbgErrorCode SBG_COMMON_LIB_API SbgErrorCode sbgStringAssignF | ( | SbgString * | pString, |
const char * | pFormat, | ||
... ) |
Assign formatted data to a string.
The string format, as well as the variable arguments, are the same as for printf.
[in] | pString | String. |
[in] | pFormat | Format. |
References SBG_COMMON_LIB_API, and sbgStringAssignF().
Referenced by sbgStringAssignF().
SBG_COMMON_LIB_API SbgErrorCode SBG_COMMON_LIB_API SbgErrorCode SBG_COMMON_LIB_API SbgErrorCode sbgStringMove | ( | SbgString * | pString, |
SbgString * | pSourceString ) |
Move content between two strings.
On return, if successful, the source string is empty.
[in] | pString | String. |
[in] | pSourceString | Source string. |
References SBG_COMMON_LIB_API, and sbgStringMove().
Referenced by sbgStringMove().
SBG_COMMON_LIB_API SbgErrorCode sbgStringMoveCString | ( | SbgString * | pString, |
char * | pCString ) |
Move a dynamically allocated C null-terminated string into a string.
The C string must have been allocated using a standard C allocation function, such as malloc() or strdup().
On return, if successful, the C string buffer is owned by the string.
[in] | pString | String. |
[in] | pCString | C null-terminated string. |
References SBG_COMMON_LIB_API, and sbgStringMoveCString().
Referenced by sbgStringMoveCString().
SBG_COMMON_LIB_API char * sbgStringExtract | ( | SbgString * | pString | ) |
Extract the content of a string.
If successful, the content returned is a C null-terminated string, becomes owned by the caller, may be released with free(), and the given string becomes empty.
[in] | pString | String. |
References SBG_COMMON_LIB_API, and sbgStringExtract().
Referenced by sbgStringExtract().
SBG_COMMON_LIB_API SbgErrorCode sbgStringClear | ( | SbgString * | pString | ) |
Clear a string.
After returning from this call the string is empty.
[in] | pString | String. |
References SBG_COMMON_LIB_API, and sbgStringClear().
Referenced by sbgStringClear().
SBG_COMMON_LIB_API SbgErrorCode sbgStringToUpperCase | ( | SbgString * | pString | ) |
Convert all the characters of a string to upper case.
[in] | pString | String. |
References SBG_COMMON_LIB_API, and sbgStringToUpperCase().
Referenced by sbgStringToUpperCase().
SBG_COMMON_LIB_API SbgErrorCode sbgStringToLowerCase | ( | SbgString * | pString | ) |
Convert all the characters of a string to lower case.
[in] | pString | String. |
References SBG_COMMON_LIB_API, and sbgStringToLowerCase().
Referenced by sbgStringToLowerCase().
SBG_COMMON_LIB_API SbgErrorCode sbgStringTrimLeft | ( | SbgString * | pString | ) |
Remove all spacing characters at the beginning of a string.
[in] | pString | String. |
References SBG_COMMON_LIB_API, and sbgStringTrimLeft().
Referenced by sbgStringTrimLeft().
SBG_COMMON_LIB_API SbgErrorCode sbgStringTrimRight | ( | SbgString * | pString | ) |
Remove all spacing characters at the end of a string.
[in] | pString | String. |
References SBG_COMMON_LIB_API, and sbgStringTrimRight().
Referenced by sbgStringTrimRight().
SBG_COMMON_LIB_API SbgErrorCode sbgStringTrim | ( | SbgString * | pString | ) |
Remove all spacing characters at the beginning and the end of a string.
[in] | pString | String. |
References SBG_COMMON_LIB_API, and sbgStringTrim().
Referenced by sbgStringTrim().
SBG_COMMON_LIB_API void sbgStringTruncate | ( | SbgString * | pString, |
size_t | length ) |
Truncate a string.
If the given length is greater than or equal to the length of the string, this function doesn't modify the string.
[in] | pString | String. |
[in] | length | Length, in bytes. |
References SBG_COMMON_LIB_API, and sbgStringTruncate().
Referenced by sbgStringTruncate().
SBG_COMMON_LIB_API SbgErrorCode sbgStringFromInt8 | ( | SbgString * | pString, |
int8_t | value ) |
Convert and assign a 8-bits signed integer value to a string.
[in] | pString | String. |
[in] | value | Value. |
References SBG_COMMON_LIB_API, and sbgStringFromInt8().
Referenced by sbgStringFromInt8().
SBG_COMMON_LIB_API SbgErrorCode sbgStringToInt8 | ( | const SbgString * | pString, |
int8_t * | pValue ) |
Convert a string to a 8-bits signed integer value.
[in] | pString | String. |
[out] | pValue | Value. |
References SBG_COMMON_LIB_API, and sbgStringToInt8().
Referenced by sbgStringToInt8().
SBG_COMMON_LIB_API SbgErrorCode sbgStringFromUint8 | ( | SbgString * | pString, |
uint8_t | value ) |
Convert and assign a 8-bits unsigned integer value to a string.
[in] | pString | String. |
[in] | value | Value |
References SBG_COMMON_LIB_API, and sbgStringFromUint8().
Referenced by sbgStringFromUint8().
SBG_COMMON_LIB_API SbgErrorCode sbgStringToUint8 | ( | const SbgString * | pString, |
uint8_t * | pValue ) |
Convert a string to a 8-bits unsigned integer value.
[in] | pString | String. |
[out] | pValue | Value. |
References SBG_COMMON_LIB_API, and sbgStringToUint8().
Referenced by sbgStringToUint8().
SBG_COMMON_LIB_API SbgErrorCode sbgStringFromInt16 | ( | SbgString * | pString, |
int16_t | value ) |
Convert and assign a 16-bits signed integer value to a string.
[in] | pString | String. |
[in] | value | Value. |
References SBG_COMMON_LIB_API, and sbgStringFromInt16().
Referenced by sbgStringFromInt16().
SBG_COMMON_LIB_API SbgErrorCode sbgStringToInt16 | ( | const SbgString * | pString, |
int16_t * | pValue ) |
Convert a string to a 16-bits signed integer value.
[in] | pString | String. |
[out] | pValue | Value. |
References SBG_COMMON_LIB_API, and sbgStringToInt16().
Referenced by sbgStringToInt16().
SBG_COMMON_LIB_API SbgErrorCode sbgStringFromUint16 | ( | SbgString * | pString, |
uint16_t | value ) |
Convert and assign a 16-bits unsigned integer value to a string.
[in] | pString | String. |
[in] | value | Value |
References SBG_COMMON_LIB_API, and sbgStringFromUint16().
Referenced by sbgStringFromUint16().
SBG_COMMON_LIB_API SbgErrorCode sbgStringToUint16 | ( | const SbgString * | pString, |
uint16_t * | pValue ) |
Convert a string to a 16-bits unsigned integer value.
[in] | pString | String. |
[out] | pValue | Value. |
References SBG_COMMON_LIB_API, and sbgStringToUint16().
Referenced by sbgStringToUint16().
SBG_COMMON_LIB_API SbgErrorCode sbgStringFromInt32 | ( | SbgString * | pString, |
int32_t | value ) |
Convert and assign a 32-bits signed integer value to a string.
[in] | pString | String. |
[in] | value | Value. |
References SBG_COMMON_LIB_API, and sbgStringFromInt32().
Referenced by sbgStringFromInt32().
SBG_COMMON_LIB_API SbgErrorCode sbgStringToInt32 | ( | const SbgString * | pString, |
int32_t * | pValue ) |
Convert a string to a 32-bits signed integer value.
[in] | pString | String. |
[out] | pValue | Value. |
References SBG_COMMON_LIB_API, and sbgStringToInt32().
Referenced by sbgStringToInt32().
SBG_COMMON_LIB_API SbgErrorCode sbgStringFromUint32 | ( | SbgString * | pString, |
uint32_t | value ) |
Convert and assign a 32-bits unsigned integer value to a string.
[in] | pString | String. |
[in] | value | Value |
References SBG_COMMON_LIB_API, and sbgStringFromUint32().
Referenced by sbgStringFromUint32().
SBG_COMMON_LIB_API SbgErrorCode sbgStringToUint32 | ( | const SbgString * | pString, |
uint32_t * | pValue ) |
Convert a string to a 32-bits unsigned integer value.
[in] | pString | String. |
[out] | pValue | Value. |
References SBG_COMMON_LIB_API, and sbgStringToUint32().
Referenced by sbgStringToUint32().
SBG_COMMON_LIB_API SbgErrorCode sbgStringFromInt64 | ( | SbgString * | pString, |
int64_t | value ) |
Convert and assign a 64-bits signed integer value to a string.
[in] | pString | String. |
[in] | value | Value. |
References SBG_COMMON_LIB_API, and sbgStringFromInt64().
Referenced by sbgStringFromInt64().
SBG_COMMON_LIB_API SbgErrorCode sbgStringToInt64 | ( | const SbgString * | pString, |
int64_t * | pValue ) |
Convert a string to a 64-bits signed integer value.
[in] | pString | String. |
[out] | pValue | Value. |
References SBG_COMMON_LIB_API, and sbgStringToInt64().
Referenced by sbgStringToInt64().
SBG_COMMON_LIB_API SbgErrorCode sbgStringFromUint64 | ( | SbgString * | pString, |
uint64_t | value ) |
Convert and assign a 64-bits unsigned integer value to a string.
[in] | pString | String. |
[in] | value | Value |
References SBG_COMMON_LIB_API, and sbgStringFromUint64().
Referenced by sbgStringFromUint64().
SBG_COMMON_LIB_API SbgErrorCode sbgStringToUint64 | ( | const SbgString * | pString, |
uint64_t * | pValue ) |
Convert a string to a 64-bits unsigned integer value.
[in] | pString | String. |
[out] | pValue | Value. |
References SBG_COMMON_LIB_API, and sbgStringToUint64().
Referenced by sbgStringToUint64().
SBG_COMMON_LIB_API SbgErrorCode sbgStringFromFloat | ( | SbgString * | pString, |
float | value ) |
Convert and assign a float value to a string.
[in] | pString | String. |
[in] | value | Value. |
References SBG_COMMON_LIB_API, and sbgStringFromFloat().
Referenced by sbgStringFromFloat().
SBG_COMMON_LIB_API SbgErrorCode sbgStringToFloat | ( | const SbgString * | pString, |
float * | pValue ) |
Convert a string to a float value.
[in] | pString | String. |
[out] | pValue | Value. |
References SBG_COMMON_LIB_API, and sbgStringToFloat().
Referenced by sbgStringToFloat().
SBG_COMMON_LIB_API SbgErrorCode sbgStringFromDouble | ( | SbgString * | pString, |
double | value ) |
Convert and assign a double value to a string.
[in] | pString | String. |
[in] | value | Value. |
References SBG_COMMON_LIB_API, and sbgStringFromDouble().
Referenced by sbgStringFromDouble().
SBG_COMMON_LIB_API SbgErrorCode sbgStringToDouble | ( | const SbgString * | pString, |
double * | pValue ) |
Convert a string to a double value.
[in] | pString | String. |
[out] | pValue | Value. |
References SBG_COMMON_LIB_API, and sbgStringToDouble().
Referenced by sbgStringToDouble().
SBG_COMMON_LIB_API SbgErrorCode sbgStringFromStreamBuffer | ( | SbgString * | pString, |
SbgStreamBuffer * | pStream ) |
Read a string from a stream buffer.
[in] | pString | String. |
[in] | pStream | Stream buffer. |
References SBG_COMMON_LIB_API, and sbgStringFromStreamBuffer().
Referenced by sbgStringFromStreamBuffer().
SBG_COMMON_LIB_API SbgErrorCode sbgStringToStreamBuffer | ( | const SbgString * | pString, |
SbgStreamBuffer * | pStream ) |
Write a string to a stream buffer.
[in] | pString | String. |
[out] | pStream | Stream buffer. |
References SBG_COMMON_LIB_API, and sbgStringToStreamBuffer().
Referenced by sbgStringToStreamBuffer().
SBG_COMMON_LIB_API void sbgStringIteratorConstruct | ( | SbgStringIterator * | pIterator, |
const SbgString * | pString ) |
String iterator constructor.
If the given string is modified while the iterator is used, the behavior is undefined.
[in] | pIterator | String iterator. |
[in] | pString | String. |
References SBG_COMMON_LIB_API, and sbgStringIteratorConstruct().
Referenced by sbgStringIteratorConstruct().
SBG_COMMON_LIB_API SbgErrorCode sbgStringIteratorWalk | ( | SbgStringIterator * | pIterator, |
const char * | pSeparators, | ||
bool | skipEmptyTokens, | ||
SbgString * | pToken ) |
Walk to the next token of a string.
The token string must be constructed before calling this function. If an error occurs, the last error of the token string is set by this function.
[in] | pIterator | String iterator. |
[in] | pSeparators | C null-terminated string containing separator characters. |
[in] | skipEmptyTokens | If true, empty tokens are skipped. |
[out] | pToken | Token. |
References SBG_COMMON_LIB_API, and sbgStringIteratorWalk().
Referenced by sbgStringIteratorWalk().
SBG_COMMON_LIB_API SbgErrorCode sbgStringCopy | ( | char * | pDestination, |
const char * | pSource, | ||
size_t | destMaxSize ) |
Safely copy source string to destination according to destination provided buffer size.
This method tends to replace strncpy where you would like to safely copy a string with buffer overflow checking. If the provided output buffer is too small, the method will return a valid NULL terminated C string in destination. This condition will be returned using SBG_BUFFER_OVERFLOW error code.
[out] | pDestination | The destination string that should hold the copied input string. |
[in] | pSource | The source NULL terminated C string to copy to the destination. |
[in] | destMaxSize | The destination buffer size including the null terminating char. |
References SBG_COMMON_LIB_API, and sbgStringCopy().
Referenced by sbgStringCopy().
SBG_COMMON_LIB_API const char * sbgStringFirstValidChar | ( | const char * | pInputStr | ) |
Skip all spacing characters from the beginning of a string.
[in] | pInputStr | Pointer on a read only string to trim. |
References SBG_COMMON_LIB_API, and sbgStringFirstValidChar().
Referenced by sbgStringFirstValidChar().