Currency Class Reference

#include <ql/currency.hpp>

Inheritance diagram for Currency:

Inheritance graph
[legend]
List of all members.

Detailed Description

Currency specification


Public Member Functions

 Currency ()
 default constructor
Inspectors
const std::string & name () const
 currency name, e.g, "U.S. Dollar"
const std::string & code () const
 ISO 4217 three-letter code, e.g, "USD".
Integer numericCode () const
 ISO 4217 numeric code, e.g, "840".
const std::string & symbol () const
 symbol, e.g, "$"
const std::string & fractionSymbol () const
 fraction symbol, e.g, "¢"
Integer fractionsPerUnit () const
 number of fractionary parts in a unit, e.g, 100
const Roundingrounding () const
 rounding convention
std::string format () const
 output format
Other information
bool empty () const
 is this a usable instance?
const CurrencytriangulationCurrency () const
 currency used for triangulated exchange when required

Protected Attributes

boost::shared_ptr< Data > data_

Related Functions

(Note that these are not member functions.)

bool operator== (const Currency &, const Currency &)
bool operator!= (const Currency &, const Currency &)
std::ostream & operator<< (std::ostream &, const Currency &)


Constructor & Destructor Documentation

Currency (  ) 

default constructor

Instances built via this constructor have undefined behavior. Such instances can only act as placeholders and must be reassigned to a valid currency before being used.


Member Function Documentation

std::string format (  )  const

output format

The format will be fed three positional parameters, namely, value, code, and symbol, in this order.


Friends And Related Function Documentation

bool operator== ( const Currency ,
const Currency  
) [related]

bool operator!= ( const Currency ,
const Currency  
) [related]

std::ostream & operator<< ( std::ostream &  ,
const Currency  
) [related]