Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Currency Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWCurrencyBook

Module:  Currency   Group:  Currency


Does not inherit

Local Index

Members

Non-Members

Synopsis

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

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. Currency Module 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();
bool
contains(const RWCString& mnemonic) const;
size_t
entries() const;
bool 
find(const RWCString& mnemonic, RWCurrency& c) const;
RWTValSlist<RWCurrency>
getAllCurrencies() const;
RWTValSlist<RWString>
getAllCurrencyMnemonics() const;
bool
initialize(istream& strm);

NOTE -- The previous contents of self are deleted when this function is invoked.
bool 
insert(const RWCurrency& currency);
bool 
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 DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.