NAME
Account class
USAGE
#include "account.h" Account a = new Account();
AUTHOR
Joseph M. Robertson, jmr, jmrobert5@mchsi.com
COPYRIGHT
(c) 2001 by Joseph M. Robertson
CREATION DATE
11/18/99
HISTORY
NAME
Name - the account name, a string.
SYNOPSIS
string Account::Name() void Account::Name(string value)
PURPOSE
Use to get/set the account name. More than one account may be created, and this provides a convenient way to list, search and choose accounts. This is free and is not linked to any other inputs.
NAME
State - the account state, a string.
SYNOPSIS
string Account::State() void Account::State(string value)
PURPOSE
Use to get/set the account state. Accounts can have a state of operation regarding the datas validity. Open accounts are current and working. Closed accounts are inactive but still show in lists for reporting purposes. Inactive accounts are archived. They are only available for special reporting purposes. But generally are not visible.
NAME
Type - the account type, a string.
SYNOPSIS
string Account::Type() void Account::Type(string value)
PURPOSE
Use to get/set the account type. Accounts are typed within Quicken. This is defined by the first line of the qif file (the ! line item). Generally speaking we should not allow changes to the type, but it is a library and we can create new accounts so its here.
NAME
Balance - the account balance, a float value.
SYNOPSIS
float Account::Balance()
PURPOSE
Use to get the account balance. Account balances are tracked at each transaction (they are a part of the transaction class). So whenever a transaction is altered a calculation occurs from that point to the end of the list to recalc all the balances.
NAME
Size - the number of transactions in the account, a int value.
SYNOPSIS
int Account::Size()
PURPOSE
Use to get the number of transactions in the account.
NAME
File - the account filename, a string value.
SYNOPSIS
string Account::File()
PURPOSE
Use to get the filename that was read or that the account will be written to.
NAME
Read - open a qif file and populate the account.
SYNOPSIS
void Account::Read(string file)
PURPOSE
Use to open a qif data file and populate the account transaction list.
SIDE EFFECTS
Sets the filename value returned in Account::File and also used in Account::Write below.
NAME
Write - write the qif file to disk.
SYNOPSIS
void Account::Write() void Account::Write(string file)
PURPOSE
Use to save a qif data file to disk. If no input is given write will use 'filename' value set internally by the Account::Read method. Otherwise, a passed in value will be the filename. Normal POSIX path specs apply.
NAME
Add - add a new, blank transaction to the account transaction list.
SYNOPSIS
void Account::Add()
PURPOSE
Use to add a new, blank transaction to the account transaction list.
TODO
jmr... I think we should overload this. If given a delimited string, then populate the transaction before adding it the the vector.
NAME
Update - updates a transaction in the account with a new transaction object.
SYNOPSIS
void Account::Update(int index, Transaction *trans)
PURPOSE
To update the transaction item in the transaction list maintained by the account.
ERRORS
Throws a Msg::Msg exception to the caller.
TODO
jmr... Implement a method that puts string data into a transaction object.
NAME
Delete - deletes a transaction in the account.
SYNOPSIS
void Account::Delete(int index)
PURPOSE
To delete the transaction item from the account transaction list.
ERRORS
Throws a Msg::Msg exception to the caller.
SIDE EFFECTS
Calls Account::Rebalance to recalculate the account balances for each transaction after 'index'.
NAME
Void - voids a transaction in the account.
SYNOPSIS
void Account::Void(int index)
PURPOSE
To void the transaction item from the account transaction list.
SIDE EFFECTS
Calls Account::Rebalance to recalculate the account balances for each transaction after 'index'.
NAME
Get - retrieves a transaction in the account.
SYNOPSIS
Transaction Account::Get(int index)
PURPOSE
To retrieve a transaction item from the account transaction list.
RETURN VALUE
A copy of a Transaction object. See Tranaction class docs for methods that can be used.
NAME
Rebalance - recalculates the account balance.
TAGS
Private Method - for developers only
SYNOPSIS
void Account::Rebalance(int index)
PURPOSE
To recalculate the balance of each transaction item in the account transaction list after the point 'index'.
ERRORS
Throws a Msg::Msg exception to the caller.