S2OPC OPCUA Toolkit
|
Go to the source code of this file.
Functions | |
int | SOPC_strncmp_ignore_case (const char *s1, const char *s2, size_t size) |
Compare 2 string in a case-insensitive manner. Comparison returns 0 if size characters were considered identical or s1 and s2 were identical and terminated by a '\0' character. | |
int | SOPC_strcmp_ignore_case (const char *s1, const char *s2) |
Compare 2 string in a case-insensitive manner. Comparison returns 0 if all characters are identical. | |
int | SOPC_strcmp_ignore_case_alt_end (const char *s1, const char *s2, char endCharacter) |
Compare 2 string in a case-insensitive manner until endCharacter or '\0' character found. Comparison returns 0 if all characters are identical and s1 and s2 end is reached with endCharacter or '\0' character. | |
SOPC_ReturnStatus | SOPC_strtouint8_t (const char *sz, uint8_t *n, int base, char cEnd) |
Read a uint8_t from the string with strtoul. | |
SOPC_ReturnStatus | SOPC_strtouint16_t (const char *sz, uint16_t *n, int base, char cEnd) |
Read a uint16_t from the string with strtoul. | |
SOPC_ReturnStatus | SOPC_strtouint32_t (const char *sz, uint32_t *n, int base, char cEnd) |
Read a uint32_t from the string with strtoul. | |
bool | SOPC_strtoint (const char *data, size_t len, uint8_t width, void *dest) |
Read a signed integer from the string with strtoll. | |
bool | SOPC_strtouint (const char *data, size_t len, uint8_t width, void *dest) |
Read an unsigned integer from the string with strtoull. | |
bool | SOPC_strtodouble (const char *data, size_t len, uint8_t width, void *dest) |
Read a double from the string with strtod. | |
char * | SOPC_strdup (const char *s) |
Duplicate the given C string and return copy. | |
SOPC_ReturnStatus | SOPC_StrConcat (const char *left, const char *right, char **str) |
Concatenates the two given C strings. | |
int SOPC_strncmp_ignore_case | ( | const char * | s1, |
const char * | s2, | ||
size_t | size ) |
Compare 2 string in a case-insensitive manner. Comparison returns 0 if size
characters were considered identical or s1
and s2
were identical and terminated by a '\0' character.
s1 | A non null string terminated by '\0' character |
s2 | A non null string terminated by '\0' character |
size | Maximum number of characters compared for computing result. |
int SOPC_strcmp_ignore_case | ( | const char * | s1, |
const char * | s2 ) |
Compare 2 string in a case-insensitive manner. Comparison returns 0 if all characters are identical.
s1 | A non null string terminated by '\0' character |
s2 | A non null string terminated by '\0' character |
int SOPC_strcmp_ignore_case_alt_end | ( | const char * | s1, |
const char * | s2, | ||
char | endCharacter ) |
Compare 2 string in a case-insensitive manner until endCharacter
or '\0' character found. Comparison returns 0 if all characters are identical and s1
and s2
end is reached with endCharacter
or '\0' character.
s1 | A non null string terminated by '\0' character (and which might contain endCharacter ) |
s2 | A non null string terminated by '\0' character (and which might contain endCharacter ) |
endCharacter | An alternative endCharacter to consider for stopping comparison. |
SOPC_ReturnStatus SOPC_strtouint8_t | ( | const char * | sz, |
uint8_t * | n, | ||
int | base, | ||
char | cEnd ) |
Read a uint8_t from the string with strtoul.
sz | A pointer to the CString containing the number. |
n | A pointer to the uint8_t. |
base | The base in which the number is written. See strtoul for more about /p base. |
cEnd | Termination char. The first char of the unconsumed part of sz shall be this. May be '\0'. |
SOPC_ReturnStatus SOPC_strtouint16_t | ( | const char * | sz, |
uint16_t * | n, | ||
int | base, | ||
char | cEnd ) |
Read a uint16_t from the string with strtoul.
sz | A pointer to the CString containing the number. |
n | A pointer to the uint16_t. |
base | The base in which the number is written. See strtoul for more about /p base. |
cEnd | Termination char. The first char of the unconsumed part of sz shall be this. May be '\0'. |
SOPC_ReturnStatus SOPC_strtouint32_t | ( | const char * | sz, |
uint32_t * | n, | ||
int | base, | ||
char | cEnd ) |
Read a uint32_t from the string with strtoul.
sz | A pointer to the CString containing the number. |
n | A pointer to the uint32_t. |
base | The base in which the number is written. See strtoul for more about /p base. |
cEnd | Termination char. The first char of the unconsumed part of sz shall be this. May be '\0'. |
bool SOPC_strtoint | ( | const char * | data, |
size_t | len, | ||
uint8_t | width, | ||
void * | dest ) |
Read a signed integer from the string with strtoll.
data | A pointer to the CString containing the number in base 10 |
len | The length of the CString to use for parsing, it shall be <= 20 |
width | The number of bits of the signed integer |
dest | The destination pointer containing the integer value parsed, it shall be of integer type int<width>_t |
bool SOPC_strtouint | ( | const char * | data, |
size_t | len, | ||
uint8_t | width, | ||
void * | dest ) |
Read an unsigned integer from the string with strtoull.
data | A pointer to the CString containing the number in base 10 |
len | The length of the CString to use for parsing, it shall be <= 20 |
width | The number of bits of the unsigned integer |
dest | The destination pointer containing the integer value parsed, it shall be of integer type uint<width>_t |
bool SOPC_strtodouble | ( | const char * | data, |
size_t | len, | ||
uint8_t | width, | ||
void * | dest ) |
Read a double from the string with strtod.
data | A pointer to the CString containing the double value |
len | The length of the CString to use for parsing, it shall be <= 339 |
width | The number of bits of the double |
dest | The destination pointer containing the integer value parsed, it shall be of type float if width == 32 and double if width == 64 |
char * SOPC_strdup | ( | const char * | s | ) |
Duplicate the given C string and return copy.
s | The C string to duplicate |
SOPC_ReturnStatus SOPC_StrConcat | ( | const char * | left, |
const char * | right, | ||
char ** | str ) |
Concatenates the two given C strings.
left | The C string at the left side. |
right | The C string at the right side. |
str | The newly C string = left + right . You should free it with SOPC_Free. |