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 531 of file FieldConvertors.h.

Member Function Documentation

◆ convert() [1/3]

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

Definition at line 533 of file FieldConvertors.h.

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

534  {
535  const char ch = value ? 'Y' : 'N';
536  return std::string( 1, ch );
537  }

◆ convert() [2/3]

static bool FIX::BoolConvertor::convert ( const std::string &  value,
bool &  result 
)
inlinestatic

Definition at line 539 of file FieldConvertors.h.

540  {
541  if( value.size() != 1 ) return false;
542  switch( value[0] )
543  {
544  case 'Y': result = true; break;
545  case 'N': result = false; break;
546  default: return false;
547  }
548 
549  return true;
550  }

◆ convert() [3/3]

static bool FIX::BoolConvertor::convert ( const std::string &  value)
throw (FieldConvertError
)
inlinestatic

Definition at line 552 of file FieldConvertors.h.

References FIX::EmptyConvertor::convert().

554  {
555  bool result = false;
556  if( !convert( value, result ) )
557  throw FieldConvertError(value);
558  else
559  return result;
560  }
static std::string convert(bool value)

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

Generated on Thu Sep 5 2019 11:07:58 for QuickFIX by doxygen 1.8.13 written by Dimitri van Heesch, © 1997-2001