github.com/castedo/isomon |
isomon::currency — ISO 4217 currency.
// In header: </home/castedo/src/isomon/currency.hpp> class currency { public: // construct/copy/destruct currency(); currency(std::string const &); currency(char const *); currency(int16_t); // public member functions bool is_currency() const; bool is_no_currency() const; std::string str() const; char const * c_str() const; int16_t isonum() const; int32_t num_digits() const; int32_t num_minors() const; bool operator==(currency) const; bool operator!=(currency) const; bool operator<(currency) const; bool operator<=(currency) const; bool operator>(currency) const; bool operator>=(currency) const; // friend functions friend std::istream & operator>>(std::istream &, currency &); };
currency
public member functionsbool is_currency() const;True if this is not special ISO "no currency" value "XXX" (999)
bool is_no_currency() const;True if this is special ISO "no currency" value "XXX" (999)
std::string str() const;return ISO 3-character code
char const * c_str() const;return ISO 3-character code as null-terminated C string
int16_t isonum() const;return ISO numeric code
int32_t num_digits() const;
return number of decimal digits for minor units, or return 0 if not applicable or unknown
int32_t num_minors() const;
return number of minor units per major unit, or return 0 if not applicable or unknown
bool operator==(currency rhs) const;
bool operator!=(currency rhs) const;
bool operator<(currency rhs) const;Ordering is the same as the ordering of ISO alphabetic code.
bool operator<=(currency rhs) const;
bool operator>(currency rhs) const;
bool operator>=(currency rhs) const;
currency
friend functionsfriend std::istream & operator>>(std::istream & is, currency & rhs);Read ISO alphabetic code (3 Latin letters)