FIX::IntConvertor Struct Reference

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

`#include <FieldConvertors.h>`

## Static Public Member Functions

static std::string | convert (signed_int value)
static bool | convert (std::string::const_iterator str, std::string::const_iterator end, signed_int &result)
static bool | convert (const std::string &value, signed_int &result)
static signed_int | convert (const std::string &value) throw ( FieldConvertError )

## Detailed Description

Converts integer to/from a string.

Definition at line 168 of file FieldConvertors.h.

## Member Function Documentation

## convert() [1/4]

static signed_int FIX::IntConvertor::convert | ( | const std::string & | value | ) |
throw | ( | FieldConvertError
| ) |  |

inline static

Definition at line 217 of file FieldConvertors.h.

{
throw FieldConvertError();
}
return std::string( result, sizeof( result ) );
}

## convert() [2/4]

static bool FIX::IntConvertor::convert | ( | const std::string & | value,
|  | signed_int & | result
| ) |  |

inline static

Definition at line 212 of file FieldConvertors.h.

{
static std::string convert( int value )
throw( FieldConvertError )

References FIX::CheckSumConvertor::convert().

## convert() [3/4]

static std::string FIX::IntConvertor::convert | ( | signed_int | value | ) |

inline static

Definition at line 170 of file FieldConvertors.h.

{
isNegative = true;
if( ++str == end )
return false;

Referenced by FIX::DataDictionary::checkHasValue(), FIX::CheckSumConvertor::convert(), FIX::Session::doTargetTooHigh(), FIX::Dictionary::getString(), FIX::DoubleField::getValue(), FIX::HttpServer::HttpServer(), FIX::integer_to_string_padded(), FIX::Session::nextReject(), FIX::DoubleField::operator double(), and FIX::HttpConnection::processSession().

## convert() [4/4]

static bool FIX::IntConvertor::convert | ( | std::string::const_iterator | str,
|  | std::string::const_iterator | end,
|  | signed_int & | result
| ) |  |

inline static

Definition at line 180 of file FieldConvertors.h.

{
const unsigned_int c = *str - '0';
if( c > 9 ) return false;
x = 10 * x + c;
} while ( ++str != end );
if( isNegative )
x = -unsigned_int(x);
result = x;
return true;
}
static bool convert( const std::string& value, signed_int& result )
{
return convert( value.begin(), value.end(), result );
}
static signed_int convert( const std::string& value )
throw( FieldConvertError )
{
signed_int result = 0;
if( !convert( value.begin(), value.end(), result ) )
throw FieldConvertError(value);
else
return result;
}
};

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

- FieldConvertors.h

FIX::IntConvertor::convert
static std::string convert(signed_int value)
Definition: FieldConvertors.h:170
FIX::unsigned_int
unsigned int unsigned_int
Definition: FieldConvertors.h:61
FIX::signed_int
int signed_int
Definition: FieldConvertors.h:60