UTBufferValues.h File Reference

Go to the source code of this file.

Functions

void pack_uint16_little_endian (uint16 value, byte *buffer)
void pack_uint16_big_endian (uint16 value, byte *buffer)
void pack_uint16_native_endian (uint16 value, byte *buffer)
void pack_uint32_little_endian (uint32 value, byte *buffer)
void pack_uint32_big_endian (uint32 value, byte *buffer)
void pack_uint32_native_endian (uint32 value, byte *buffer)
void pack_uint64_little_endian (uint64 value, byte *buffer)
void pack_uint64_big_endian (uint64 value, byte *buffer)
void pack_uint64_native_endian (uint64 value, byte *buffer)
uint16 extract_uint16_little_endian (const byte *buffer)
uint16 extract_uint16_big_endian (const byte *buffer)
uint16 extract_uint16_native_endian (const byte *buffer)
uint32 extract_uint32_little_endian (const byte *buffer)
uint32 extract_uint32_big_endian (const byte *buffer)
uint32 extract_uint32_native_endian (const byte *buffer)
uint64 extract_uint64_little_endian (const byte *buffer)
uint64 extract_uint64_big_endian (const byte *buffer)
uint64 extract_uint64_native_endian (const byte *buffer)
int get_hex_byte (const utf8 *text, out byte *value)
int get_hex_byte (stringliteral *text, out byte *value)
void put_hex_byte (byte value, out utf8 *buffer)
bool get_hex_nibble (utf8 c, out byte *value)
void put_hex_nibble (byte value, out utf8 *buffer)
int convert_string_to_uint8 (const utf8 *string, out uint8 *value)
int convert_string_to_uint8 (const stringliteral *string, out uint8 *value)
int convert_wstring_to_uint8 (const wchar_t *string, out uint8 *value)
int convert_string_to_int8 (const utf8 *string, out int8 *value)
int convert_string_to_int8 (const stringliteral *string, out int8 *value)
int convert_wstring_to_int8 (const wchar_t *string, out int8 *value)
int convert_string_to_int16 (const utf8 *string, out int16 *value)
int convert_string_to_int16 (const stringliteral *string, out int16 *value)
int convert_wstring_to_int16 (const wchar_t *string, out int16 *value)
int convert_string_to_uint16 (const utf8 *string, out uint16 *value)
int convert_string_to_uint16 (const stringliteral *string, out uint16 *value)
int convert_wstring_to_uint16 (const wchar_t *string, out uint16 *value)
int convert_string_to_uint32 (const utf8 *string, out uint32 *value)
int convert_string_to_uint32 (const stringliteral *string, out uint32 *value)
int convert_wstring_to_uint32 (const wchar_t *string, out uint32 *value)
int convert_string_to_int32 (const utf8 *string, out int32 *value)
int convert_string_to_int32 (const stringliteral *string, out int32 *value)
int convert_wstring_to_int32 (const wchar_t *string, out int32 *value)
int convert_string_to_uint64 (const utf8 *string, out uint64 *value)
int convert_string_to_uint64 (const stringliteral *string, out uint64 *value)
int convert_wstring_to_uint64 (const wchar_t *string, out uint64 *value)
int convert_string_to_int64 (const utf8 *string, out int64 *value)
int convert_string_to_int64 (const stringliteral *string, out int64 *value)
int convert_wstring_to_int64 (const wchar_t *string, out int64 *value)

Function Documentation

void pack_uint16_little_endian ( uint16  value,
byte buffer 
)

Packs a uint16 into a buffer in little endian format, accounting for target CPU alignment requirements and endianness if applicable.

void pack_uint16_big_endian ( uint16  value,
byte buffer 
)

Packs a uint16 into a buffer in big endian format, accounting for target CPU alignment requirements and endianness if applicable.

void pack_uint16_native_endian ( uint16  value,
byte buffer 
)

Packs a uint16 into a buffer in native endian format, accounting for target CPU alignment requirements.

void pack_uint32_little_endian ( uint32  value,
byte buffer 
)

Packs a uint32 into a buffer in little endian format, accounting for target CPU alignment requirements and endianness if applicable.

void pack_uint32_big_endian ( uint32  value,
byte buffer 
)

Packs a uint32 into a buffer in big endian format, accounting for target CPU alignment requirements and endianness if applicable.

void pack_uint32_native_endian ( uint32  value,
byte buffer 
)

Packs a uint32 into a buffer in native endian format, accounting for target CPU alignment requirements.

void pack_uint64_little_endian ( uint64  value,
byte buffer 
)

Packs a uint64 into a buffer in little endian format, accounting for target CPU alignment requirements and endianness if applicable.

void pack_uint64_big_endian ( uint64  value,
byte buffer 
)

Packs a uint64 into a buffer in big endian format, accounting for target CPU alignment requirements and endianness if applicable.

void pack_uint64_native_endian ( uint64  value,
byte buffer 
)

Packs a uint64 into a buffer in native endian format, accounting for target CPU alignment requirements.

uint16 extract_uint16_little_endian ( const byte buffer  ) 

Extracts a uint16 from a buffer in little endian format, accounting for target CPU alignment requirements and endianness if applicable.

uint16 extract_uint16_big_endian ( const byte buffer  ) 

Extracts a uint16 from a buffer in big endian format, accounting for target CPU alignment requirements and endianness if applicable.

uint16 extract_uint16_native_endian ( const byte buffer  ) 

Extracts a uint16 from a buffer in native endian format, accounting for target CPU alignment requirements.

uint32 extract_uint32_little_endian ( const byte buffer  ) 

Extracts a uint32 from a buffer in little endian format, accounting for target CPU alignment requirements and endianness if applicable.

uint32 extract_uint32_big_endian ( const byte buffer  ) 

Extracts a uint32 from a buffer in big endian format, accounting for target CPU alignment requirements and endianness if applicable.

uint32 extract_uint32_native_endian ( const byte buffer  ) 

Extracts a uint32 from a buffer in native endian format, accounting for target CPU alignment requirements.

uint64 extract_uint64_little_endian ( const byte buffer  ) 

Extracts a uint64 from a buffer in little endian format, accounting for target CPU alignment requirements and endianness if applicable.

uint64 extract_uint64_big_endian ( const byte buffer  ) 

Extracts a uint64 from a buffer in big endian format, accounting for target CPU alignment requirements and endianness if applicable.

uint64 extract_uint64_native_endian ( const byte buffer  ) 

Extracts a uint64 from a buffer in native endian format, accounting for target CPU alignment requirements.

int get_hex_byte ( const utf8 text,
out byte value 
)

Converts a sequence of two ("7f") or four ("0x7f") UTF8 characters containing a hexadecimal byte in character format (actually restricted to the ASCII subset 0-9, a-f, A-F) to its corresponding actual byte value. The text can begin with 0x. Returns the number of characters converted, or 0 if a valid hex byte was not present at the specified location. The text does not need to be null terminated. The value pointer can be NULL to merely check that text points to a valid hex byte.

int get_hex_byte ( stringliteral text,
out byte value 
) [inline]

Converts a sequence of two ("7f") or four ("0x7f") UTF8 characters containing a hexadecimal byte in character format (actually restricted to the ASCII subset 0-9, a-f, A-F) to its corresponding actual byte value. The text can begin with 0x. Returns the number of characters converted, or 0 if a valid hex byte was not present at the specified location. The text does not need to be null terminated. The value pointer can be NULL to merely check that text points to a valid hex byte.

Definition at line 317 of file UTBufferValues.h.

void put_hex_byte ( byte  value,
out utf8 buffer 
)

Converts a byte value to hexadecimal stored in a pair of UTF8 characters, for example 0x6f would be converted to "6f". No terminating null character is appended.

bool get_hex_nibble ( utf8  c,
out byte value 
)

Converts a hex nibble from UTF8 (actually restricted to the ASCII subset 0-9, a-f, A-F) to its corresponding actual value of the nibble, for example 'e' would be converted to 0xe. Returns true if the input character was a valid hexadecimal character, otherwise the function returns false. The text does not need to be null terminated. The value pointer can be NULL to merely check that c is a valid hex nibble.

void put_hex_nibble ( byte  value,
out utf8 buffer 
)

Converts a nibble value to hexadecimal stored in a UTF8 character, for example 0xe would be converted to "e". If the value is not in the range 0 to 0xf, an assertion failure occurs. No terminating null character is appended.

int convert_string_to_uint8 ( const utf8 string,
out uint8 value 
)

String to uint8 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid uint8 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

int convert_string_to_uint8 ( const stringliteral string,
out uint8 value 
) [inline]

String to uint8 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid uint8 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

Definition at line 368 of file UTBufferValues.h.

int convert_wstring_to_uint8 ( const wchar_t *  string,
out uint8 value 
)

String to uint8 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid uint8 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

int convert_string_to_int8 ( const utf8 string,
out int8 value 
)

String to int8 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid int8 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

int convert_string_to_int8 ( const stringliteral string,
out int8 value 
) [inline]

String to int8 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid int8 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

Definition at line 411 of file UTBufferValues.h.

int convert_wstring_to_int8 ( const wchar_t *  string,
out int8 value 
)

String to int8 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid int8 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

int convert_string_to_int16 ( const utf8 string,
out int16 value 
)

String to int16 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid int16 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

int convert_string_to_int16 ( const stringliteral string,
out int16 value 
) [inline]

String to int16 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid int16 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

Definition at line 454 of file UTBufferValues.h.

int convert_wstring_to_int16 ( const wchar_t *  string,
out int16 value 
)

String to int16 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid int16 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

int convert_string_to_uint16 ( const utf8 string,
out uint16 value 
)

String to uint16 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid uint16 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

int convert_string_to_uint16 ( const stringliteral string,
out uint16 value 
) [inline]

String to uint16 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid uint16 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

Definition at line 497 of file UTBufferValues.h.

int convert_wstring_to_uint16 ( const wchar_t *  string,
out uint16 value 
)

String to uint16 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid uint16 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

int convert_string_to_uint32 ( const utf8 string,
out uint32 value 
)

String to uint32 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid uint32 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

int convert_string_to_uint32 ( const stringliteral string,
out uint32 value 
) [inline]

String to uint32 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid uint32 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

Definition at line 540 of file UTBufferValues.h.

int convert_wstring_to_uint32 ( const wchar_t *  string,
out uint32 value 
)

String to uint32 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid uint32 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

int convert_string_to_int32 ( const utf8 string,
out int32 value 
)

String to int32 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid int32 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

int convert_string_to_int32 ( const stringliteral string,
out int32 value 
) [inline]

String to int32 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid int32 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

Definition at line 583 of file UTBufferValues.h.

int convert_wstring_to_int32 ( const wchar_t *  string,
out int32 value 
)

String to int32 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid int32 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

int convert_string_to_uint64 ( const utf8 string,
out uint64 value 
)

String to uint64 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid uint64 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

int convert_string_to_uint64 ( const stringliteral string,
out uint64 value 
) [inline]

String to uint64 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid uint64 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

Definition at line 626 of file UTBufferValues.h.

int convert_wstring_to_uint64 ( const wchar_t *  string,
out uint64 value 
)

String to uint64 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid uint64 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

int convert_string_to_int64 ( const utf8 string,
out int64 value 
)

String to int64 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid int64 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

int convert_string_to_int64 ( const stringliteral string,
out int64 value 
) [inline]

String to int64 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid int64 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.

Definition at line 669 of file UTBufferValues.h.

int convert_wstring_to_int64 ( const wchar_t *  string,
out int64 value 
)

String to int64 conversion function which is better than scanf or atoi since those functions don't provide a mechanism for checking that it was actually a valid integer. The text can begin with 0x, in which case the value will be treated as being hexadecimal, otherwise it will be treated as being decimal. Returns the number of characters converted, or 0 if a valid int64 was not present at the specified location. As long as the text is followed by one or more characters which cannot be interpreted as being a part of an integer, it does not need to be null terminated. The value pointer can be NULL to merely check that string points to a valid integer.


Generated on Tue Dec 14 22:35:05 2010 for UT library by  doxygen 1.6.1