Public Member Functions | Private Attributes | Static Private Attributes | List of all members
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]

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 263 of file to_byte_array.hpp.

Constructor & Destructor Documentation

virtual ecl::Converter< std::vector< char >, char * >::~Converter ( )
inlinevirtual

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

Definition at line 391 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 283 of file to_byte_array.hpp.

Member Data Documentation

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

Definition at line 397 of file to_byte_array.hpp.

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

Definition at line 396 of file to_byte_array.hpp.

const unsigned int ecl::Converter< std::vector< char >, char * >::waiting_first_digit = 2
staticprivate

Definition at line 400 of file to_byte_array.hpp.

const unsigned int ecl::Converter< std::vector< char >, char * >::waiting_second_digit = 3
staticprivate

Definition at line 401 of file to_byte_array.hpp.

const unsigned int ecl::Converter< std::vector< char >, char * >::waiting_x = 1
staticprivate

Definition at line 399 of file to_byte_array.hpp.

const unsigned int ecl::Converter< std::vector< char >, char * >::waiting_zero = 0
staticprivate

Definition at line 398 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 Mon Jun 10 2019 13:08:22