#include <cel_misc.h>
List of all members.
Detailed Description
Utility functions to manipulate Hexa-decimal numbers.
Member Function Documentation
| static int Celartem::Hex::_1char |
( |
int |
chr |
) |
[inline, static] |
Converts one of a character of [0-9A-Fa-f] into an integral value.
- Parameters:
-
| chr | a character code of [0-9A-Fa-f]. |
- Returns:
- The value corresponding to the character.
Referenced by fromStrToInt().
| static int Celartem::Hex::_1digit |
( |
int |
n |
) |
[inline, static] |
Converts a value of [0 15] into an ASCII character that represents the value.
- Parameters:
-
- Returns:
- The character corresponding to the input value.
Referenced by fromByte().
| static void Celartem::Hex::fromByte |
( |
UChar1 * |
buffer, |
|
|
u8 |
n | |
|
) |
| | [inline, static] |
Converts an u8 number into 2-byte long string without any '\0' termination.
- Parameters:
-
| buffer | A buffer to get the result; it should be larger than 2 byte. |
| n | the number to be converted. |
| static size_t Celartem::Hex::fromString |
( |
u8 * |
outBin, |
|
|
size_t |
inSize, |
|
|
const String & |
str | |
|
) |
| | [static] |
Converts a string into binary data.
- Parameters:
-
| outBin | Buffer to receive the result binary. |
| inSize | The size of the buffer. |
| str | hex encoded binary. This can be contain non hexa-decimal characters, which are simply skipped during the conversion. |
- Returns:
- Returns the number of bytes actually written to the buffer.
| static void Celartem::Hex::fromString |
( |
SimpleArray< u8 > & |
outBin, |
|
|
const String & |
str | |
|
) |
| | [static] |
Converts a string into binary data.
- Parameters:
-
| outBin | Buffer to receive the result binary. |
| str | hex encoded binary. This can be contain non hexa-decimal characters, which are simply skipped during the conversion. |
| static int Celartem::Hex::fromStrToInt |
( |
const UChar1 * |
str, |
|
|
size_t |
length | |
|
) |
| | [inline, static] |
Converts a hexa-decimal notation of a number into an integral value. Please note that this function does not care about overflow.
- Parameters:
-
| str | A string that represents some number in hexa-decimal notation. |
| length | The length of the string. |
- Returns:
- The value.
| static String Celartem::Hex::toString |
( |
const u8 * |
bin, |
|
|
size_t |
size, |
|
|
const String & |
sep | |
|
) |
| | [static] |
Converts a binary array into string.
- Parameters:
-
| bin | Pointer to a binary block. |
| size | The size of the binary block specified by bin . |
| sep | A string to split the string that represents the string. If you want to get strings like "00:11:22:33" then this is ":" . |
- Returns:
- The string notation of the binary.
The documentation for this struct was generated from the following file: