Public Member Functions | Private Attributes | Static Private Attributes
ecl::Converter< std::vector< char >, char * > Class Template Reference

Converts a char string of human readable hexes to a byte array. More...

#include <to_byte_array.hpp>

Inheritance diagram for ecl::Converter< std::vector< char >, char * >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

std::vector< char > operator() (const char *input) ecl_debug_throw_decl(StandardException)
virtual ~Converter ()

Private Attributes

char byte
unsigned int state

Static Private Attributes

static const unsigned int waiting_first_digit = 2
static const unsigned int waiting_second_digit = 3
static const unsigned int waiting_x = 1
static const unsigned int waiting_zero = 0

Detailed Description

template<>
class ecl::Converter< std::vector< char >, char * >

Converts a char string of human readable hexes to a byte array.

Parses a string of hexes into a character byte array.

See also:
Converter

Definition at line 192 of file to_byte_array.hpp.


Constructor & Destructor Documentation

virtual ecl::Converter< std::vector< char >, char * >::~Converter ( ) [inline, virtual]

Reimplemented in ecl::Converter< std::vector< char >, void >.

Definition at line 288 of file to_byte_array.hpp.


Member Function Documentation

std::vector<char> ecl::Converter< std::vector< char >, char * >::operator() ( const char *  input) [inline]

Converts a string of human readable hexes into a byte array.

The string should contain bytes written as a '0x' followed by two hex digits. e.g.

 0x32 0x64 0x64  0x54

This throws an exception and/or configures the error() function if an unexpected char is discovered.

Parameters:
input: the character string to be converted.
Returns:
vector<char> : the byte array.
Exceptions:
StandardException: throws if unexpected char is discovered (debug mode only).

Definition at line 211 of file to_byte_array.hpp.


Member Data Documentation

char ecl::Converter< std::vector< char >, char * >::byte [private]

Definition at line 292 of file to_byte_array.hpp.

unsigned int ecl::Converter< std::vector< char >, char * >::state [private]

Definition at line 291 of file to_byte_array.hpp.

const unsigned int ecl::Converter< std::vector< char >, char * >::waiting_first_digit = 2 [static, private]

Definition at line 295 of file to_byte_array.hpp.

const unsigned int ecl::Converter< std::vector< char >, char * >::waiting_second_digit = 3 [static, private]

Definition at line 296 of file to_byte_array.hpp.

const unsigned int ecl::Converter< std::vector< char >, char * >::waiting_x = 1 [static, private]

Definition at line 294 of file to_byte_array.hpp.

const unsigned int ecl::Converter< std::vector< char >, char * >::waiting_zero = 0 [static, private]

Definition at line 293 of file to_byte_array.hpp.


The documentation for this class was generated from the following file:


ecl_converters
Author(s): Daniel Stonier
autogenerated on Wed Aug 26 2015 11:27:10