FIX::UtcDateConvertor Struct Reference

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

`#include <FieldConvertors.h>`

## Static Public Member Functions

static std::string | convert (const UtcDate &value) throw ( FieldConvertError )
static UtcDate | convert (const std::string &value) throw ( FieldConvertError )

## Detailed Description

Converts a UtcDate to/from a string.

Definition at line 650 of file FieldConvertors.h.

## Member Function Documentation

## convert() [1/2]

static UtcDate FIX::UtcDateConvertor::convert | ( | const std::string & | value | ) |
throw | ( | FieldConvertError
| ) |  |

inline static

Definition at line 667 of file FieldConvertors.h.

## convert() [2/2]

static std::string FIX::UtcDateConvertor::convert | ( | const UtcDate & | value | ) |
throw | ( | FieldConvertError
| ) |  |

inline static

Definition at line 652 of file FieldConvertors.h.

{
if( value.size() != 8 ) throw FieldConvertError(value);
int i = 0;
for( int c=0; c<8; ++c )
if( !IS_DIGIT(value[i++]) ) throw FieldConvertError(value);
int year, mon, mday;
i = 0;
year = value[i++] - '0';
year = 10 * year + value[i++] - '0';
year = 10 * year + value[i++] - '0';

References IS_DIGIT.

Referenced by FIX::UtcTimeStampField::getValue(), FIX::UtcTimeStampField::operator!=(), and FIX::UtcTimeStampField::operator<().

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

- FieldConvertors.h

IS_DIGIT
#define IS_DIGIT(x)
Definition: FieldConvertors.h:66