Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWCurrencyBook



Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Synopsis

#include <rw/money/currbook.h>
ifstream strm("currency_book.in");
RWCurrencyBook b;
b.initialize(strm);

Related Java Class

com.roguewave.money.currency.v1_0.CurrencyBook

Description

Class RWCurrencyBook stores RWCurrency objects. Each currency in the currency book is identified by a unique mnemonic. A currency's mnemonic can only appear once--duplicates are not allowed.

Class RWCurrencyBook can be initialized from an istream. Money.h++ includes a file that can be used to initialize an RWCurrencyBook through an ifstream. Appendix B lists the countries and the currency mnemonics in the provided file.

Public Static Data Members

The following static data members define the strings that provide names for the name/value pairs used when initializing from a stream. They are initialized to the valid names described in RWCurrencyBook::initialize().

const RWCString mnemonicTag;
const RWCString codeTag;
const RWCString nameTag;
const RWCString fractionNameTag;
const RWCString wholeToFractionTag;
const RWCString introDateTag;
const RWCString expDateTag;
const RWCString beginToken;
const RWCString endToken;

Public Constructors

RWCurrencyBook();
RWCurrencyBook(const RWCurrencyBook& cb);

Public Member Operator

RWCurrencyBook& 
operator=(const RWCurrencyBook& cb);

Public Member Function

void
clear();
RWBoolean
contains(const RWCString& mnemonic) const;
size_t
entries() const;
RWBoolean 
find(const RWCString& mnemonic, RWCurrency& c) const;
RWTValSlist<RWCurrency>
getAllCurrencies() const;
RWTValSlist<RWString>
getAllCurrencyMnemonics() const;
RWBoolean
initialize(istream& strm);

NOTE:The previous contents of self are deleted when this function is invoked.
RWBoolean 
insert(const RWCurrency& currency);
RWBoolean 
remove(const RWCString& mnemonic);
void 
restoreFrom(RWFile&);
void 
restoreFrom(RWvistream&);
void 
saveOn(RWFile&) const;
void 
saveOn(RWvostream&) const;

Related Global Operators

RWvostream& 
operator<<(RWvostream& strm, const RWCurrencyBook& c);
RWFile& 
operator<<(RWFile& file, const RWCurrencyBook& c);
RWvistream& 
operator>>(RWvistream& strm, const RWCurrencyBook& c);
RWFile& 
operator>>(RWFile& strm, const RWCurrencyBook& c);
ostream& 
operator<<(ostream& strm, const RWCurrencyBook& b);
ostream& 
operator>>(istream& strm, RWCurrencyBook& b);


Previous fileTop of DocumentContentsIndexNext file

©Copyright 1999, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.