S2OPC OPCUA Toolkit
Loading...
Searching...
No Matches
sopc_helper_string.h
Go to the documentation of this file.
1/*
2 * Licensed to Systerel under one or more contributor license
3 * agreements. See the NOTICE file distributed with this work
4 * for additional information regarding copyright ownership.
5 * Systerel licenses this file to you under the Apache
6 * License, Version 2.0 (the "License"); you may not use this
7 * file except in compliance with the License. You may obtain
8 * a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#ifndef SOPC_HELPER_STRING_H_
21#define SOPC_HELPER_STRING_H_
22
23#include <inttypes.h>
24#include <stdbool.h>
25#include <stddef.h>
26
27#include "sopc_enums.h"
28
41int SOPC_strncmp_ignore_case(const char* s1, const char* s2, size_t size);
42
53int SOPC_strcmp_ignore_case(const char* s1, const char* s2);
54
67int SOPC_strcmp_ignore_case_alt_end(const char* s1, const char* s2, char endCharacter);
68
80SOPC_ReturnStatus SOPC_strtouint8_t(const char* sz, uint8_t* n, int base, char cEnd);
81
93SOPC_ReturnStatus SOPC_strtouint16_t(const char* sz, uint16_t* n, int base, char cEnd);
94
106SOPC_ReturnStatus SOPC_strtouint32_t(const char* sz, uint32_t* n, int base, char cEnd);
107
118bool SOPC_strtoint(const char* data, size_t len, uint8_t width, void* dest);
119
130bool SOPC_strtouint(const char* data, size_t len, uint8_t width, void* dest);
131
143bool SOPC_strtodouble(const char* data, size_t len, uint8_t width, void* dest);
144
152char* SOPC_strdup(const char* s);
153
163SOPC_ReturnStatus SOPC_StrConcat(const char* left, const char* right, char** str);
164
165#endif /* SOPC_HELPER_STRING_H_ */
enum _SOPC_ReturnStatus SOPC_ReturnStatus
Common enumerations for S2OPC.
char * SOPC_strdup(const char *s)
Duplicate the given C string and return copy.
SOPC_ReturnStatus SOPC_strtouint8_t(const char *sz, uint8_t *n, int base, char cEnd)
Read a uint8_t from the string with strtoul.
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....
SOPC_ReturnStatus SOPC_strtouint32_t(const char *sz, uint32_t *n, int base, char cEnd)
Read a uint32_t from the string with strtoul.
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 considere...
bool SOPC_strtouint(const char *data, size_t len, uint8_t width, void *dest)
Read an unsigned integer from the string with strtoull.
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.
bool SOPC_strtodouble(const char *data, size_t len, uint8_t width, void *dest)
Read a double from the string with strtod.
bool SOPC_strtoint(const char *data, size_t len, uint8_t width, void *dest)
Read a signed integer from the string with strtoll.
SOPC_ReturnStatus SOPC_strtouint16_t(const char *sz, uint16_t *n, int base, char cEnd)
Read a uint16_t from the string with strtoul.