Index  Source Files  Annotated Class List  Alphabetical Class List  Class Hierarchy  Graphical Class Hierarchy 

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


Member Function Documentation

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

Definition at line 353 of file FieldConvertors.h.

References convert().

00355   {
00356     bool result = false;
00357     if( !convert( value, result ) )
00358       throw FieldConvertError();
00359     else
00360       return result;
00361   }

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

Definition at line 340 of file FieldConvertors.h.

00341   {
00342     if( value.size() != 1 ) return false;
00343     switch( value[0] )
00344     {
00345       case 'Y': result = true; break;
00346       case 'N': result = false; break;
00347       default: return false;
00348     }
00349 
00350     return true;
00351   }

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

Definition at line 334 of file FieldConvertors.h.

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

00335   {
00336     const char ch = value ? 'Y' : 'N';
00337     return std::string( 1, ch );
00338   }


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

Generated on Mon Apr 5 21:00:04 2010 for QuickFIX by doxygen 1.6.1 written by Dimitri van Heesch, © 1997-2001