|  | Home | Documentation | Conversion functions updated Tue Jun 30 2020 by Robert van Engelen |

- Main Page
- Modules
- Classes
- Files

Functions
Conversion functions

This module defines conversion functions of values of various types to and from strings. More...

## Functions
int | soap_s2byte (struct soap *soap, const char *string, char *value)
| Convert a decimal string to a signed 8 bit byte (char) integer value. More...
int | soap_s2short (struct soap *soap, const char *string, short *value)
| Convert a decimal string to a signed 16 bit integer value. More...
int | soap_s2int (struct soap *soap, const char *string, int *value)
| Convert a decimal string to a signed 32 bit integer value. More...
int | soap_s2long (struct soap *soap, const char *string, long *value)
| Convert a decimal string to a signed `long` integer value. More...
int | soap_s2LONG64 (struct soap *soap, const char *string, LONG64 *value)
| Convert a decimal string to a signed 64 bit integer value. More...
int | soap_s2float (struct soap *soap, const char *string, float *value)
| Convert a decimal string to a float value. More...
int | soap_s2double (struct soap *soap, const char *string, double *value)
| Convert a decimal string to a double float value. More...
int | soap_s2unsignedByte (struct soap *soap, const char *string, unsigned char *value)
| Convert a decimal string to an unsigned 8 bit byte (unsigned char) integer value. More...
int | soap_s2unsignedShort (struct soap *soap, const char *string, unsigned short *value)
| Convert a decimal string to an unsigned 16 bit integer value. More...
int | soap_s2unsignedInt (struct soap *soap, const char *string, unsigned int *value)
| Convert a decimal string to an unsigned 32 bit integer value. More...
int | soap_s2unsignedLong (struct soap *soap, const char *string, unsigned long *value)
| Convert a decimal string to an unsigned `long` integer value. More...
int | soap_s2ULONG64 (struct soap *soap, const char *string, ULONG64 *value)
| Convert a decimal string to an unsigned 64 bit integer value. More...
int | soap_s2char (struct soap *soap, const char *string, char **value, int flag, long minlen, long maxlen, const char *pattern)
| Copy a string (ASCII or UTF-8) to a new string while converting and validating the string contents. More...
int | soap_s2stdchar (struct soap *soap, const char *string, std::string *value, int flag, long minlen, long maxlen, const char *pattern)
| Copy a string (ASCII or UTF-8) to a new string while converting and validating the string contents. More...
int | soap_s2wchar (struct soap *soap, const char *string, wchar_t **value, int flag, long minlen, long maxlen, const char *pattern)
| Copy a string (ASCII or UTF-8) to a new wide string while converting and validating the string contents. More...
int | soap_s2stdwchar (struct soap *soap, const char *string, std::wstring *value, int flag, long minlen, long maxlen, const char *pattern)
| Copy a string (ASCII or UTF-8) to a new wide string while converting and validating the string contents. More...
int | soap_s2QName (struct soap *soap, const char *string, char **value, long minlen, long maxlen, const char *pattern)
| Copy a string (ASCII or UTF-8) to a new QName string while normalizing and validating the string contents. More...
int | soap_s2stdQName (struct soap *soap, const char *string, std::string *value, long minlen, long maxlen, const char *pattern)
| Copy a string (ASCII or UTF-8) to a new QName string while normalizing and validating the string contents. More...
int | soap_s2dateTime (struct soap *soap, const char *string, time_t *value)
| Convert a string with `xsd:dateTime` contents to a `time_t` value. More...
char * | soap_s2base64 (struct soap *soap, const unsigned char *data, char *base64, int len)
| Encode binary data as a base64-formatted string. More...
char * | soap_s2hex (struct soap *soap, const unsigned char *data, char *hex, int len)
| Encode binary data as a hex-formatted string. More...
const char * | soap_byte2s (struct soap *soap, char value)
| Convert a signed 8 bit byte (char) integer to a decimal string. More...
const char * | soap_short2s (struct soap *soap, short value)
| Convert a signed 16 bit integer to a decimal string. More...
const char * | soap_int2s (struct soap *soap, int value)
| Convert a signed 32 bit integer to a decimal string. More...
const char * | soap_long2s (struct soap *soap, long value)
| Convert a signed `long` integer to a decimal string. More...
const char * | soap_LONG642s (struct soap *soap, LONG64 value)
| Convert a signed 64 bit integer to a decimal string. More...
const char * | soap_float2s (struct soap *soap, float value)
| Convert a float value to a decimal string. More...
const char * | soap_double2s (struct soap *soap, double value)
| Convert a double float value to a decimal string. More...
const char * | soap_unsignedByte2s (struct soap *soap, unsigned char value)
| Convert an unsigned 8 bit byte (char) integer to a decimal string. More...
const char * | soap_unsignedShort2s (struct soap *soap, unsigned short value)
| Convert an unsigned 16 bit integer to a decimal string. More...
const char * | soap_unsignedInt2s (struct soap *soap, unsigned int value)
| Convert an unsigned 32 bit integer to a decimal string. More...
const char * | soap_unsignedLong2s (struct soap *soap, unsigned long value)
| Convert an unsigned `long` integer to a decimal string. More...
const char * | soap_ULONG642s (struct soap *soap, ULONG64 value)
| Convert an unsigned 64 bit integer to a decimal string. More...
const char * | soap_wchar2s (struct soap *soap, const wchar_t *value)
| Convert a wide string to a UTF-8 encoded string. More...
const char * | soap_dateTime2s (struct soap *soap, time_t value)
| Convert a `time_t` value to a string with `xsd:dateTime` contents. More...
const char * | soap_base642s (struct soap *soap, const char *base64, char *data, size_t maxdatalen, int *datalen)
| Decode a base64-formatted string to binary data. More...
const char * | soap_hex2s (struct soap *soap, const char *hex, char *data, size_t maxdatalen, int *datalen)
| Decode a hex-formatted string to binary data. More...

## Detailed Description

This module defines conversion functions of values of various types to and from strings.

## Function Documentation

const char* soap_base642s | ( | struct soap * | soap,
|  | const char * | base64,
|  | char * | data,
|  | size_t | maxdatalen,
|  | int * | datalen
| ) |  |

Decode a base64-formatted string to binary data.

This function decodes the specified `base64` string to binary data. The `data` parameter is a buffer of length `maxdatalen` to store the decoded data or NULL to dynamically allocate the decoded data in managed memory which is returned. The length of the decoded data is stored in the length variable pointed to by `datalen` when non-NULL. Returns the decoded binary string that is 0-terminated if `maxdatalen` is sufficiently large, or returns NULL if an error occurred.

Returns
  decoded string or NULL when an error occurred

Parameters

  soap | `soap` context
  base64 | base64 string
  data | buffer to store the decoded data or NULL to allocate one
  maxdatalen | size of the buffer
  datalen | pointer to the length variable to assign or NULL

const char* soap_byte2s | ( | struct soap * | soap,
|  | char | value
| ) |  |

Convert a signed 8 bit byte (char) integer to a decimal string.

This function converts the specified signed 8 bit byte (char) integer to a decimal string stored in the temporary buffer `soap::tmpbuf`. Returns `soap::tmpbuf`.

Returns
  the decimal number stored in the `soap::tmpbuf` string buffer

Parameters

  soap | `soap` context
  value | integer value to convert to decimal string

const char* soap_dateTime2s | ( | struct soap * | soap,
|  | time_t | value
| ) |  |

Convert a `time_t` value to a string with `xsd:dateTime` contents.

This function converts the specified `time_t` value to a string with `xsd:dateTime` contents stored in the temporary buffer `soap::tmpbuf`. Returns `soap::tmpbuf`.

See also
  `WITH_NOZONE`.

Returns
  the `xsd:dateTime` string stored in the `soap::tmpbuf` string buffer

Parameters

  soap | `soap` context
  value | value to convert

const char* soap_double2s | ( | struct soap * | soap,
|  | double | value
| ) |  |

Convert a double float value to a decimal string.

This function converts the specified double precision floating point value to a decimal string stored in the temporary buffer `soap::tmpbuf`. Returns `soap::tmpbuf`.

Returns
  the decimal number stored in the `soap::tmpbuf` string buffer

Parameters

  soap | `soap` context
  value | double float value to convert to decimal string

const char* soap_float2s | ( | struct soap * | soap,
|  | float | value
| ) |  |

Convert a float value to a decimal string.

This function converts the specified single precision floating point value to a decimal string stored in the temporary buffer `soap::tmpbuf`. Returns `soap::tmpbuf`.

Returns
  the decimal number stored in the `soap::tmpbuf` string buffer

Parameters

  soap | `soap` context
  value | float value to convert to decimal string

const char* soap_hex2s | ( | struct soap * | soap,
|  | const char * | hex,
|  | char * | data,
|  | size_t | maxdatalen,
|  | int * | datalen
| ) |  |

Decode a hex-formatted string to binary data.

This function decodes the specified `hex` string to binary data. The `data` parameter is a buffer of length `maxdatalen` to store the decoded data or NULL to dynamically allocate the decoded data in managed memory which is returned. The length of the decoded data is stored in the length variable pointed to by `datalen` when non-NULL. Returns the decoded binary string that is 0-terminated if `maxdatalen` is sufficiently large, or returns NULL if an error occurred.

Returns
  decoded string or NULL when an error occurred

Parameters

  soap | `soap` context
  hex | hex string
  data | buffer to store the decoded data or NULL to allocate one
  maxdatalen | size of the buffer
  datalen | pointer to the length variable to assign or NULL

const char* soap_int2s | ( | struct soap * | soap,
|  | int | value
| ) |  |

Convert a signed 32 bit integer to a decimal string.

This function converts the specified signed 32 bit integer to a decimal string stored in the temporary buffer `soap::tmpbuf`. Returns `soap::tmpbuf`.

Returns
  the decimal number stored in the `soap::tmpbuf` string buffer

Parameters

  soap | `soap` context
  value | integer value to convert to decimal string

const char* soap_long2s | ( | struct soap * | soap,
|  | long | value
| ) |  |

Convert a signed `long` integer to a decimal string.

This function converts the specified signed `long` integer to a decimal string stored in the temporary buffer `soap::tmpbuf`. Returns `soap::tmpbuf`.

Returns
  the decimal number stored in the `soap::tmpbuf` string buffer

Parameters

  soap | `soap` context
  value | integer value to convert to decimal string

const char* soap_LONG642s | ( | struct soap * | soap,
|  | LONG64 | value
| ) |  |

Convert a signed 64 bit integer to a decimal string.

This function converts the specified signed 64 bit integer to a decimal string stored in the temporary buffer `soap::tmpbuf`. Returns `soap::tmpbuf`.

Returns
  the decimal number stored in the `soap::tmpbuf` string buffer

Parameters

  soap | `soap` context
  value | integer value to convert to decimal string

char* soap_s2base64 | ( | struct soap * | soap,
|  | const unsigned char * | data,
|  | char * | base64,
|  | int | len
| ) |  |

Encode binary data as a base64-formatted string.

This function encodes the specified binary `data` of length `len` as a base64-formatted string stored in the specified `base64` buffer or allocated in managed memory when `base64` is NULL. Note that `base64` should be large enough to store the encoded string, i.e. (`len` + 2) / 3 * 4 + 1 bytes. Returns the string or NULL when an error occurred and sets `soap::error` to a `soap_status` value.

Returns
  the converted string or NULL when an error occurred

Parameters

  soap | `soap` context
  data | data to encode
  base64 | buffer to store base64 string or NULL
  len | length of the data to encode

int soap_s2byte | ( | struct soap * | soap,
|  | const char * | string,
|  | char * | value
| ) |  |

Convert a decimal string to a signed 8 bit byte (char) integer value.

This function converts the specified decimal string to a signed 8 bit byte (char) integer value. Returns `SOAP_OK` or a `soap_status` error code such as `SOAP_TYPE` when the string could not be converted.

Returns
  `SOAP_OK` or a `soap_status` error code

Parameters

  soap | `soap` context
  string | string to convert
  value | pointer to a variable to assign the converted value to

int soap_s2char | ( | struct soap * | soap,
|  | const char * | string,
|  | char ** | value,
|  | int | flag,
|  | long | minlen,
|  | long | maxlen,
|  | const char * | pattern
| ) |  |

Copy a string (ASCII or UTF-8) to a new string while converting and validating the string contents.

This function copies the specified string to a new string allocated in managed memory. The specified string is validated against the `minlen` and `maxlen` constraints and against the `pattern` XSD regex when non-NULL and when the `soap::fsvalidate` callback is assigned to perform this check. The minimum and maximum length constraints are 0 and `soap::maxlength`, respectively, when `minlen` or `maxlen` are specified as negative values. The string length verification takes UTF-8 multi-byte encoding into account when the `SOAP_C_UTFSTRING` mode flag is enabled. The `flag` parameter controls the conversion as follows: 0 = no conversion, 4 = collapse white space and normalize white space with blanks, 5 = collapse white space. Returns `SOAP_OK` or a `soap_status` error code.

Returns
  `SOAP_OK` or a `soap_status` error code

Parameters

  soap | `soap` context
  string | string to convert
  value | pointer to a variable to assign the new string to
  flag | controls conversion (0, 4 or 5)
  minlen | minimum string length constraint, when non-negative
  maxlen | maximum string length constraint, when non-negative
  pattern | XSD regex pattern constraint, when non-NULL

int soap_s2dateTime | ( | struct soap * | soap,
|  | const char * | string,
|  | time_t * | value
| ) |  |

Convert a string with `xsd:dateTime` contents to a `time_t` value.

This function converts the specified string with `xsd:dateTime` contents to a `time_t` value. Returns `SOAP_OK` or a `soap_status` error code such as `SOAP_TYPE` when the string could not be converted.

See also
  `WITH_NOZONE`.

Returns
  `SOAP_OK` or a `soap_status` error code

Parameters

  soap | `soap` context
  string | string to convert
  value | pointer to a variable to assign the converted value to

int soap_s2double | ( | struct soap * | soap,
|  | const char * | string,
|  | double * | value
| ) |  |

Convert a decimal string to a double float value.

This function converts the specified decimal string to a double precision float value. Also converts `NaN` and `Inf`. Returns `SOAP_OK` or a `soap_status` error code such as `SOAP_TYPE` when the string could not be converted.

Returns
  `SOAP_OK` or a `soap_status` error code

Parameters

  soap | `soap` context
  string | string to convert
  value | pointer to a variable to assign the converted value to

int soap_s2float | ( | struct soap * | soap,
|  | const char * | string,
|  | float * | value
| ) |  |

Convert a decimal string to a float value.

This function converts the specified decimal string to a single precision float value. Also converts `NaN` and `Inf`. Returns `SOAP_OK` or a `soap_status` error code such as `SOAP_TYPE` when the string could not be converted.

Returns
  `SOAP_OK` or a `soap_status` error code

Parameters

  soap | `soap` context
  string | string to convert
  value | pointer to a variable to assign the converted value to

char* soap_s2hex | ( | struct soap * | soap,
|  | const unsigned char * | data,
|  | char * | hex,
|  | int | len
| ) |  |

Encode binary data as a hex-formatted string.

This function encodes the specified binary `data` of length `len` as a hex-formatted string stored in the specified `hex` buffer or allocated in managed memory when `hex` is NULL. Note that `hex` should be large enough to store the encoded string, i.e. 2 * `len` + 1 bytes. Returns the string or NULL when an error occurred and sets `soap::error` to a `soap_status` value.

Returns
  the converted string or NULL when an error occurred

Parameters

  soap | `soap` context
  data | data to encode
  hex | buffer to store hex string or NULL
  len | length of the data to encode

int soap_s2int | ( | struct soap * | soap,
|  | const char * | string,
|  | int * | value
| ) |  |

Convert a decimal string to a signed 32 bit integer value.

This function converts the specified decimal string to a signed 32 bit integer value. Returns `SOAP_OK` or a `soap_status` error code such as `SOAP_TYPE` when the string could not be converted.

Returns
  `SOAP_OK` or a `soap_status` error code

Parameters

  soap | `soap` context
  string | string to convert
  value | pointer to a variable to assign the converted value to

int soap_s2long | ( | struct soap * | soap,
|  | const char * | string,
|  | long * | value
| ) |  |

Convert a decimal string to a signed `long` integer value.

This function converts the specified decimal string to a signed `long` integer value. Returns `SOAP_OK` or a `soap_status` error code such as `SOAP_TYPE` when the string could not be converted.

Returns
  `SOAP_OK` or a `soap_status` error code

Parameters

  soap | `soap` context
  string | string to convert
  value | pointer to a variable to assign the converted value to

int soap_s2LONG64 | ( | struct soap * | soap,
|  | const char * | string,
|  | LONG64 * | value
| ) |  |

Convert a decimal string to a signed 64 bit integer value.

This function converts the specified decimal string to a signed 64 bit integer value. Returns `SOAP_OK` or a `soap_status` error code such as `SOAP_TYPE` when the string could not be converted.

Returns
  `SOAP_OK` or a `soap_status` error code

Parameters

  soap | `soap` context
  string | string to convert
  value | pointer to a variable to assign the converted value to

int soap_s2QName | ( | struct soap * | soap,
|  | const char * | string,
|  | char ** | value,
|  | long | minlen,
|  | long | maxlen,
|  | const char * | pattern
| ) |  |

Copy a string (ASCII or UTF-8) to a new QName string while normalizing and validating the string contents.

This function copies the specified string to a new QName string allocated in managed memory. The specified string should be a QName or a space-separated list of QNames. A given QName is of the form `prefix:suffix` or `"URI":suffix`, where the latter is converted to the former form by this function by replacing the quoted URIs by prefixes using the `namespaces` table. The specified string is validated against the `minlen` and `maxlen` constraints and against the `pattern` XSD regex when non-NULL and when the `soap::fsvalidate` callback is assigned to perform this check. The minimum and maximum length constraints are 0 and `soap::maxlength`, respectively, when `minlen` or `maxlen` are specified as negative values. The string length verification takes UTF-8 multi-byte encoding into account when the `SOAP_C_UTFSTRING` mode flag is enabled. Returns `SOAP_OK` or a `soap_status` error code.

Returns
  `SOAP_OK` or a `soap_status` error code

Parameters

  soap | `soap` context
  string | string to convert
  value | pointer to a variable to assign the new string to
  minlen | minimum string length constraint, when non-negative
  maxlen | maximum string length constraint, when non-negative
  pattern | XSD regex pattern constraint, when non-NULL

int soap_s2short | ( | struct soap * | soap,
|  | const char * | string,
|  | short * | value
| ) |  |

Convert a decimal string to a signed 16 bit integer value.

This function converts the specified decimal string to a signed 16 bit integer value. Returns `SOAP_OK` or a `soap_status` error code such as `SOAP_TYPE` when the string could not be converted.

Returns
  `SOAP_OK` or a `soap_status` error code

Parameters

  soap | `soap` context
  string | string to convert
  value | pointer to a variable to assign the converted value to

int soap_s2stdchar | ( | struct soap * | soap,
|  | const char * | string,
|  | std::string * | value,
|  | int | flag,
|  | long | minlen,
|  | long | maxlen,
|  | const char * | pattern
| ) |  |

Copy a string (ASCII or UTF-8) to a new string while converting and validating the string contents.

This function copies the specified string to a new string allocated in managed memory. The specified string is validated against the `minlen` and `maxlen` constraints and against the `pattern` XSD regex when non-NULL and when the `soap::fsvalidate` callback is assigned to perform this check. The minimum and maximum length constraints are 0 and `soap::maxlength`, respectively, when `minlen` or `maxlen` are specified as negative values. The string length verification takes UTF-8 multi-byte encoding into account when the `SOAP_C_UTFSTRING` mode flag is enabled. The `flag` parameter controls the conversion as follows: 0 = no conversion, 4 = collapse white space and normalize white space with blanks, 5 = collapse white space. Returns `SOAP_OK` or a `soap_status` error code.

Returns
  `SOAP_OK` or a `soap_status` error code

Parameters

  soap | `soap` context
  string | string to convert
  value | pointer to a variable to assign the new string to
  flag | controls conversion (0, 4 or 5)
  minlen | minimum string length constraint, when non-negative
  maxlen | maximum string length constraint, when non-negative
  pattern | XSD regex pattern constraint, when non-NULL

int soap_s2stdQName | ( | struct soap * | soap,
|  | const char * | string,
|  | std::string * | value,
|  | long | minlen,
|  | long | maxlen,
|  | const char * | pattern
| ) |  |

Copy a string (ASCII or UTF-8) to a new QName string while normalizing and validating the string contents.

This function copies the specified string to a new QName string allocated in managed memory. The specified string should be a QName or a space-separated list of QNames. A given QName is of the form `prefix:suffix` or `"URI":suffix`, where the latter is converted to the former form by this function by replacing the quoted URIs by prefixes using the `namespaces` table. The specified string is validated against the `minlen` and `maxlen` constraints and against the `pattern` XSD regex when non-NULL and when the `soap::fsvalidate` callback is assigned to perform this check. The minimum and maximum length constraints are 0 and `soap::maxlength`, respectively, when `minlen` or `maxlen` are specified as negative values. The string length verification takes UTF-8 multi-byte encoding into account when the `SOAP_C_UTFSTRING` mode flag is enabled. Returns `SOAP_OK` or a `soap_status` error code.

Returns
  `SOAP_OK` or a `soap_status` error code

Parameters

  soap | `soap` context
  string | string to convert
  value | pointer to a variable to assign the new string to
  minlen | minimum string length constraint, when non-negative
  maxlen | maximum string length constraint, when non-negative
  pattern | XSD regex pattern constraint, when non-NULL

int soap_s2stdwchar | ( | struct soap * | soap,
|  | const char * | string,
|  | std::wstring * | value,
|  | int | flag,
|  | long | minlen,
|  | long | maxlen,
|  | const char * | pattern
| ) |  |

Copy a string (ASCII or UTF-8) to a new wide string while converting and validating the string contents.

This function copies the specified string to a new wide string allocated in managed memory. When the `SOAP_C_UTFSTRING` mode flag is enabled the specified string should contain UTF-8 contents or ASCII otherwise. The specified string is validated against the `minlen` and `maxlen` constraints and against the `pattern` XSD regex when non-NULL and when the `soap::fsvalidate` callback is assigned to perform this check. The minimum and maximum length constraints are 0 and `soap::maxlength`, respectively, when `minlen` or `maxlen` are specified as negative values. The `flag` parameter controls the conversion as follows: 0 = no conversion, 4 = collapse white space and normalize white space with blanks, 5 = collapse white space. Returns `SOAP_OK` or a `soap_status` error code.

See also
  `SOAP_C_UTFSTRING`, `WITH_REPLACE_ILLEGAL_UTF8`, `SOAP_UNKNOWN_UNICODE_CHAR`.

Returns
  `SOAP_OK` or a `soap_status` error code

Parameters

  soap | `soap` context
  string | string to convert
  value | pointer to a variable to assign the new string to
  flag | controls conversion (0, 4 or 5)
  minlen | minimum string length constraint, when non-negative
  maxlen | maximum string length constraint, when non-negative
  pattern | XSD regex pattern constraint, when non-NULL

int soap_s2ULONG64 | ( | struct soap * | soap,
|  | const char * | string,
|  | ULONG64 * | value
| ) |  |

Convert a decimal string to an unsigned 64 bit integer value.

This function converts the specified decimal string to an unsigned 64 bit integer value. Returns `SOAP_OK` or a `soap_status` error code such as `SOAP_TYPE` when the string could not be converted.

Returns
  `SOAP_OK` or a `soap_status` error code

Parameters

  soap | `soap` context
  string | string to convert
  value | pointer to a variable to assign the converted value to

int soap_s2unsignedByte | ( | struct soap * | soap,
|  | const char * | string,
|  | unsigned char * | value
| ) |  |

Convert a decimal string to an unsigned 8 bit byte (unsigned char) integer value.

This function converts the specified decimal string to an unsigned 8 bit byte (unsigned char) integer value. Returns `SOAP_OK` or a `soap_status` error code such as `SOAP_TYPE` when the string could not be converted.

Returns
  `SOAP_OK` or a `soap_status` error code

Parameters

  soap | `soap` context
  string | string to convert
  value | pointer to a variable to assign the converted value to

int soap_s2unsignedInt | ( | struct soap * | soap,
|  | const char * | string,
|  | unsigned int * | value
| ) |  |

Convert a decimal string to an unsigned 32 bit integer value.

This function converts the specified decimal string to an unsigned 32 bit integer value. Returns `SOAP_OK` or a `soap_status` error code such as `SOAP_TYPE` when the string could not be converted.

Returns
  `SOAP_OK` or a `soap_status` error code

Parameters

  soap | `soap` context
  string | string to convert
  value | pointer to a variable to assign the converted value to

int soap_s2unsignedLong | ( | struct soap * | soap,
|  | const char * | string,
|  | unsigned long * | value
| ) |  |

Convert a decimal string to an unsigned `long` integer value.

This function converts the specified decimal string to an unsigned `long` integer value. Returns `SOAP_OK` or a `soap_status` error code such as `SOAP_TYPE` when the string could not be converted.

Returns
  `SOAP_OK` or a `soap_status` error code

Parameters

  soap | `soap` context
  string | string to convert
  value | pointer to a variable to assign the converted value to

int soap_s2unsignedShort | ( | struct soap * | soap,
|  | const char * | string,
|  | unsigned short * | value
| ) |  |

Convert a decimal string to an unsigned 16 bit integer value.

This function converts the specified decimal string to an unsigned 16 bit integer value. Returns `SOAP_OK` or a `soap_status` error code such as `SOAP_TYPE` when the string could not be converted.

Returns
  `SOAP_OK` or a `soap_status` error code

Parameters

  soap | `soap` context
  string | string to convert
  value | pointer to a variable to assign the converted value to

int soap_s2wchar | ( | struct soap * | soap,
|  | const char * | string,
|  | wchar_t ** | value,
|  | int | flag,
|  | long | minlen,
|  | long | maxlen,
|  | const char * | pattern
| ) |  |

Copy a string (ASCII or UTF-8) to a new wide string while converting and validating the string contents.

This function copies the specified string to a new wide string allocated in managed memory. When the `SOAP_C_UTFSTRING` mode flag is enabled the specified string should contain UTF-8 contents or ASCII otherwise. The specified string is validated against the `minlen` and `maxlen` constraints and against the `pattern` XSD regex when non-NULL and when the `soap::fsvalidate` callback is assigned to perform this check. The minimum and maximum length constraints are 0 and `soap::maxlength`, respectively, when `minlen` or `maxlen` are specified as negative values. The `flag` parameter controls the conversion as follows: 0 = no conversion, 4 = collapse white space and normalize white space with blanks, 5 = collapse white space. Returns `SOAP_OK` or a `soap_status` error code.

See also
  `SOAP_C_UTFSTRING`, `WITH_REPLACE_ILLEGAL_UTF8`, `SOAP_UNKNOWN_UNICODE_CHAR`.

Returns
  `SOAP_OK` or a `soap_status` error code

Parameters

  soap | `soap` context
  string | string to convert
  value | pointer to a variable to assign the new string to
  flag | controls conversion (0, 4 or 5)
  minlen | minimum string length constraint, when non-negative
  maxlen | maximum string length constraint, when non-negative
  pattern | XSD regex pattern constraint, when non-NULL

const char* soap_short2s | ( | struct soap * | soap,
|  | short | value
| ) |  |

Convert a signed 16 bit integer to a decimal string.

This function converts the specified signed 16 bit integer to a decimal string stored in the temporary buffer `soap::tmpbuf`. Returns `soap::tmpbuf`.

Returns
  the decimal number stored in the `soap::tmpbuf` string buffer

Parameters

  soap | `soap` context
  value | integer value to convert to decimal string

const char* soap_ULONG642s | ( | struct soap * | soap,
|  | ULONG64 | value
| ) |  |

Convert an unsigned 64 bit integer to a decimal string.

This function converts the specified unsigned 64 bit integer to a decimal string stored in the temporary buffer `soap::tmpbuf`. Returns `soap::tmpbuf`.

Returns
  the decimal number stored in the `soap::tmpbuf` string buffer

Parameters

  soap | `soap` context
  value | integer value to convert to decimal string

const char* soap_unsignedByte2s | ( | struct soap * | soap,
|  | unsigned char | value
| ) |  |

Convert an unsigned 8 bit byte (char) integer to a decimal string.

This function converts the specified unsigned 8 bit byte (char) integer to a decimal string stored in the temporary buffer `soap::tmpbuf`. Returns `soap::tmpbuf`.

Returns
  the decimal number stored in the `soap::tmpbuf` string buffer

Parameters

  soap | `soap` context
  value | integer value to convert to decimal string

const char* soap_unsignedInt2s | ( | struct soap * | soap,
|  | unsigned int | value
| ) |  |

Convert an unsigned 32 bit integer to a decimal string.

This function converts the specified unsigned 32 bit integer to a decimal string stored in the temporary buffer `soap::tmpbuf`. Returns `soap::tmpbuf`.

Returns
  the decimal number stored in the `soap::tmpbuf` string buffer

Parameters

  soap | `soap` context
  value | integer value to convert to decimal string

const char* soap_unsignedLong2s | ( | struct soap * | soap,
|  | unsigned long | value
| ) |  |

Convert an unsigned `long` integer to a decimal string.

This function converts the specified unsigned `long` integer to a decimal string stored in the temporary buffer `soap::tmpbuf`. Returns `soap::tmpbuf`.

Returns
  the decimal number stored in the `soap::tmpbuf` string buffer

Parameters

  soap | `soap` context
  value | integer value to convert to decimal string

const char* soap_unsignedShort2s | ( | struct soap * | soap,
|  | unsigned short | value
| ) |  |

Convert an unsigned 16 bit integer to a decimal string.

This function converts the specified unsigned 16 bit integer to a decimal string stored in the temporary buffer `soap::tmpbuf`. Returns `soap::tmpbuf`.

Returns
  the decimal number stored in the `soap::tmpbuf` string buffer

Parameters

  soap | `soap` context
  value | integer value to convert to decimal string

const char* soap_wchar2s | ( | struct soap * | soap,
|  | const wchar_t * | value
| ) |  |

Convert a wide string to a UTF-8 encoded string.

This function converts the specified wide string to a UTF-8 encoded string allocated in managed memory. Returns the resulting string or NULL when an error occurred and sets `soap::error` to a `soap_status` value.

See also
  `WITH_REPLACE_ILLEGAL_UTF8`, `SOAP_UNKNOWN_UNICODE_CHAR`.

Returns
  UTF-8 encoded string allocated in managed memory or NULL when an error occurred

Parameters

  soap | `soap` context
  value | wide string to convert