Static Public Member Functions | List of all members
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
)
inlinestatic

Definition at line 667 of file FieldConvertors.h.

◆ convert() [2/2]

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

Definition at line 652 of file FieldConvertors.h.

652  {
653  if( value.size() != 8 ) throw FieldConvertError(value);
654 
655  int i = 0;
656  for( int c=0; c<8; ++c )
657  if( !IS_DIGIT(value[i++]) ) throw FieldConvertError(value);
658 
659  int year, mon, mday;
660 
661  i = 0;
662 
663  year = value[i++] - '0';
664  year = 10 * year + value[i++] - '0';
665  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:
IS_DIGIT
#define IS_DIGIT(x)
Definition: FieldConvertors.h:66

Generated on Wed Apr 29 2020 19:41:30 for QuickFIX by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2001