#include <calibration.hpp>
template<class SI_CHAR>
class sl_oc::tools::SI_ConvertA< SI_CHAR >
Null conversion class for MBCS/UTF-8 to char (or equivalent).
Definition at line 2553 of file calibration.hpp.
◆ SI_ConvertA() [1/3]
◆ SI_ConvertA() [2/3]
◆ SI_ConvertA() [3/3]
◆ ConvertFromStore()
template<class SI_CHAR >
bool sl_oc::tools::SI_ConvertA< SI_CHAR >::ConvertFromStore |
( |
const char * |
a_pInputData, |
|
|
size_t |
a_uInputDataLen, |
|
|
SI_CHAR * |
a_pOutputData, |
|
|
size_t |
a_uOutputDataSize |
|
) |
| |
|
inline |
Convert the input string from the storage format to SI_CHAR. The storage format is always UTF-8 or MBCS.
- Parameters
-
a_pInputData | Data in storage format to be converted to SI_CHAR. |
a_uInputDataLen | Length of storage format data in bytes. This must be the actual length of the data, including NULL byte if NULL terminated string is required. |
a_pOutputData | Pointer to the output buffer to received the converted data. |
a_uOutputDataSize | Size of the output buffer in SI_CHAR. |
- Returns
- true if all of the input data was successfully converted.
Definition at line 2610 of file calibration.hpp.
2616 if (a_uInputDataLen > a_uOutputDataSize) {
2619 memcpy(a_pOutputData, a_pInputData, a_uInputDataLen);
◆ ConvertToStore()
template<class SI_CHAR >
bool sl_oc::tools::SI_ConvertA< SI_CHAR >::ConvertToStore |
( |
const SI_CHAR * |
a_pInputData, |
|
|
char * |
a_pOutputData, |
|
|
size_t |
a_uOutputDataSize |
|
) |
| |
|
inline |
Convert the input string to the storage format of this data. The storage format is always UTF-8 or MBCS.
- Parameters
-
a_pInputData | NULL terminated source string to convert. All of the data will be converted including the terminating NULL character. |
a_pOutputData | Pointer to the buffer to receive the converted string. |
a_uOutputDataSize | Size of the output buffer in char. |
- Returns
- true if all of the input data, including the terminating NULL character was successfully converted.
Definition at line 2652 of file calibration.hpp.
2657 size_t uInputLen = strlen((
const char *) a_pInputData) + 1;
2658 if (uInputLen > a_uOutputDataSize) {
2663 memcpy(a_pOutputData, a_pInputData, uInputLen);
◆ operator=()
◆ SizeFromStore()
Calculate the number of SI_CHAR required for converting the input from the storage format. The storage format is always UTF-8 or MBCS.
- Parameters
-
a_pInputData | Data in storage format to be converted to SI_CHAR. |
a_uInputDataLen | Length of storage format data in bytes. This must be the actual length of the data, including NULL byte if NULL terminated string is required. |
- Returns
- Number of SI_CHAR required by the string when converted. If there are embedded NULL bytes in the input data, only the string up and not including the NULL byte will be converted.
-
-1 cast to size_t on a conversion error.
Definition at line 2587 of file calibration.hpp.
2590 (void) a_pInputData;
2591 SI_ASSERT(a_uInputDataLen != (
size_t) - 1);
2594 return a_uInputDataLen;
◆ SizeToStore()
Calculate the number of char required by the storage format of this data. The storage format is always UTF-8 or MBCS.
- Parameters
-
a_pInputData | NULL terminated string to calculate the number of bytes required to be converted to storage format. |
- Returns
- Number of bytes required by the string when converted to storage format. This size always includes space for the terminating NULL character.
-
-1 cast to size_t on a conversion error.
Definition at line 2633 of file calibration.hpp.
2636 return strlen((
const char *) a_pInputData) + 1;
The documentation for this class was generated from the following file: