Zi Qi Yap / Mbed OS SPS30_TEST

Dependencies:   SPS30-sensor

Embed: (wiki syntax)

« Back to documentation index

Data Structure Conversions

Data Structure Conversions

Functions

char * StringToChar (const std::string &str)
 Converts a C++ string to C-string; Use free() to release mem after copying the content.
std::string IntToHex (uint32_t i)
 Converts an int-type to string-type hex.
std::string IntToString (int v)
 Converts an int-type to string.
char * DoubleToChar (char *str, double v, int decimal_digits)
 Converts an double-type to a C-string with variable number of decimal places.
int StringToInt (const std::string &str)
 Converts a C++ string to an integer.

Function Documentation

char* DoubleToChar ( char *  str,
double  v,
int  decimal_digits 
)

Converts an double-type to a C-string with variable number of decimal places.

Author:
Lau Lee Hong
Parameters:
strbuffer to store result
vvalue
decimal_digitsnumber of decimal places
Returns:
Null-terminated charcter array of double value with user-defined number of decimal places

Definition at line 62 of file conversions.cpp.

std::string IntToHex ( uint32_t  i )

Converts an int-type to string-type hex.

Author:
Lau Lee Hong
Parameters:
iInteger to be converted to hex string
Returns:
Hexadecimal of string format

Definition at line 34 of file conversions.cpp.

std::string IntToString ( int  v )

Converts an int-type to string.

Author:
Lau Lee Hong
Parameters:
i(int)integer to be converted (std::string)integer
Returns:
Integer of string format

Definition at line 47 of file conversions.cpp.

char* StringToChar ( const std::string &  str )

Converts a C++ string to C-string; Use free() to release mem after copying the content.

Author:
Lau Lee Hong
Parameters:
strC++ string
Returns:
Pointer to a null-terminated array of character

Definition at line 17 of file conversions.cpp.

int StringToInt ( const std::string &  str )

Converts a C++ string to an integer.

Author:
Lee Tze Han
Parameters:
strC++ string
Returns:
Integer from string representation

Definition at line 105 of file conversions.cpp.