Common string routines.
More...
#include "api/string_helper.h"
Common string routines.
- Note
- CStringHelper need never be instantiated - all its methods are static and stateless.
static string integra_api::CStringHelper::date_to_string |
( |
const struct tm & |
date | ) |
|
|
static |
Convert date/time to string.
- Parameters
-
- Returns
- ISO 8601 formatted string representation of the date/time
static CError integra_api::CStringHelper::string_to_date |
( |
const string & |
string, |
|
|
struct tm & |
output |
|
) |
| |
|
static |
Convert string to date/time.
- Parameters
-
| string | the string to convert. Expects string in ISO 8601 form eg 2012-07-20T14:42 |
[out] | the | converted date/time |
- Returns
- CError::SUCCESS or CError::INPUT_ERROR
static bool integra_api::CStringHelper::string_to_string_vector |
( |
const string & |
input, |
|
|
string_vector & |
output |
|
) |
| |
|
static |
Unpack single-string representation of an array of strings.
These packed strings are used by the AudioSettings and MidiSettings interfaces, to encode lists of drivers/devices. Each string in the array is prepended by its length and a colon, allowing unambiguous unpacking. Example: { "First Item", "Second Item" } becomes "10:First Item11:Second Item"
- Parameters
-
| input | A single string representing an array of strings |
[out] | output | Container in which to store results |
- Returns
- true if successful, false if input doesn't conform to packing format
static string integra_api::CStringHelper::string_vector_to_string |
( |
const string_vector & |
strings | ) |
|
|
static |
Create string-representation of an array of strings.
These packed strings are used by the AudioSettings and MidiSettings interfaces, to encode lists of drivers/devices. Each string in the array is prepended by its length and a colon, allowing unambiguous unpacking. Example: { "First Item", "Second Item" } becomes "10:First Item11:Second Item"
- Parameters
-
strings | array of strings to pack |
- Returns
- the single packed string
static string integra_api::CStringHelper::trim |
( |
const string & |
input | ) |
|
|
static |
Trim whitespace from start and end of a string.
- Parameters
-
- Returns
- trimmed version of the string
static bool integra_api::CStringHelper::validate_node_name |
( |
const string & |
name | ) |
|
|
static |
Test whether the node name is valid.
- Parameters
-
name | the node name to test |
- Returns
- true if name contains no invalid characters, otherwise false
const int integra_api::CStringHelper::string_buffer_length = 1024 |
|
static |
A standard length for string buffers.
- Note
- wherever possible libIntegra uses resizable std::string. Fixed length string buffers are when required by external libraries such as minizip
The documentation for this class was generated from the following file: