Static Public Member Functions | List of all members
FIX::BoolConvertor Struct Reference

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

#include <FieldConvertors.h>

Static Public Member Functions

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

Detailed Description

Converts boolean to/from a string.

Definition at line 520 of file FieldConvertors.h.

Member Function Documentation

static std::string FIX::BoolConvertor::convert ( bool  value)
inlinestatic

Definition at line 522 of file FieldConvertors.h.

Referenced by FIX::DataDictionary::checkValidFormat(), convert(), FIX::Dictionary::getBool(), FIX::BoolField::getValue(), FIX::Dictionary::setBool(), and FIX::BoolField::setValue().

523  {
524  const char ch = value ? 'Y' : 'N';
525  return std::string( 1, ch );
526  }
static bool FIX::BoolConvertor::convert ( const std::string &  value,
bool &  result 
)
inlinestatic

Definition at line 528 of file FieldConvertors.h.

529  {
530  if( value.size() != 1 ) return false;
531  switch( value[0] )
532  {
533  case 'Y': result = true; break;
534  case 'N': result = false; break;
535  default: return false;
536  }
537 
538  return true;
539  }
static bool FIX::BoolConvertor::convert ( const std::string &  value)
throw (FieldConvertError
)
inlinestatic

Definition at line 541 of file FieldConvertors.h.

References convert().

543  {
544  bool result = false;
545  if( !convert( value, result ) )
546  throw FieldConvertError(value);
547  else
548  return result;
549  }
static std::string convert(bool value)

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

Generated on Sat Mar 29 2014 15:13:34 for QuickFIX by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2001