Static Public Member Functions
FIX::BoolConvertor Struct Reference

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

#include <FieldConvertors.h>

List of all members.

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

static std::string FIX::BoolConvertor::convert ( bool  value) [inline, static]

Definition at line 533 of file FieldConvertors.h.

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

  {
    const char ch = value ? 'Y' : 'N';
    return std::string( 1, ch );
  }
static bool FIX::BoolConvertor::convert ( const std::string &  value,
bool &  result 
) [inline, static]

Definition at line 539 of file FieldConvertors.h.

  {
    if( value.size() != 1 ) return false;
    switch( value[0] )
    {
      case 'Y': result = true; break;
      case 'N': result = false; break;
      default: return false;
    }

    return true;
  }
static bool FIX::BoolConvertor::convert ( const std::string &  value) throw ( FieldConvertError ) [inline, static]

Definition at line 552 of file FieldConvertors.h.

References convert().

  {
    bool result = false;
    if( !convert( value, result ) )
      throw FieldConvertError(value);
    else
      return result;
  }

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

Generated on Mon Sep 15 2014 01:23:57 for QuickFIX by doxygen 1.7.6.1 written by Dimitri van Heesch, © 1997-2001