FIX::CheckSumConvertor Struct Reference

Converts checksum to/from a string. More...

`#include <FieldConvertors.h>`

## Static Public Member Functions

static std::string | convert (int value) throw ( FieldConvertError )
static bool | convert (const std::string &value, int &result)
static int | convert (const std::string &value) throw ( FieldConvertError )

## Detailed Description

Converts checksum to/from a string.

Definition at line 212 of file FieldConvertors.h.

## Member Function Documentation

## convert() [1/3]

static int FIX::CheckSumConvertor::convert | ( | const std::string & | value | ) |
throw | ( | FieldConvertError
| ) |  |

inline static

Definition at line 231 of file FieldConvertors.h.

{
return IntConvertor::convert( value );
}
FIX::IntConvertor::convert
static std::string convert(signed_int value)
Definition: FieldConvertors.h:153

References FIX::IntConvertor::convert().

## convert() [2/3]

static bool FIX::CheckSumConvertor::convert | ( | const std::string & | value,
|  | int & | result
| ) |  |

inline static

Definition at line 226 of file FieldConvertors.h.

{
return IntConvertor::convert( value, result );
}

References FIX::IntConvertor::convert().

## convert() [3/3]

static std::string FIX::CheckSumConvertor::convert | ( | int | value | ) |
throw | ( | FieldConvertError
| ) |  |

inline static

Definition at line 214 of file FieldConvertors.h.

{
if ( value > 255 || value < 0 ) throw FieldConvertError();
char result[3];
if( integer_to_string_padded(result, sizeof(result), value) != result )
{
throw FieldConvertError();
}
return std::string( result, sizeof( result ) );
}
FIX::integer_to_string_padded
char * integer_to_string_padded(char *buf, const size_t len, signed_int t, const char paddingChar='0')
Definition: FieldConvertors.h:132

References FIX::integer_to_string_padded().

Referenced by FIX::CheckSumField::getValue(), and FIX::CheckSumField::setValue().

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

- FieldConvertors.h