build/libofx-0.10.0/lib/ofx_containers.hh
Go to the documentation of this file.
/***************************************************************************
ofx_proc_rs.h
-------------------
copyright : (C) 2002 by Benoit Gr�goire
email : benoitg@coeus.ca
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef OFX_PROC_H
#define OFX_PROC_H
#include "libofx.h"
#include "tree.hh"
#include "context.hh"
using namespace std;
class OfxGenericContainer
{
public:
string type;
string tag_identifier;
OfxGenericContainer *parentcontainer;
LibofxContext *libofx_context;
OfxGenericContainer(LibofxContext *p_libofx_context);
OfxGenericContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer);
OfxGenericContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
virtual ~OfxGenericContainer() {};
virtual void add_attribute(const string identifier, const string value);
virtual int gen_event();
virtual int add_to_main_tree();
OfxGenericContainer* getparent();
};//End class OfxGenericObject
class OfxDummyContainer: public OfxGenericContainer
{
public:
OfxDummyContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
void add_attribute(const string identifier, const string value);
};
class OfxInv401kContainer: public OfxGenericContainer
{
public:
OfxInv401kContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
void add_attribute(const string identifier, const string value);
};
class OfxPushUpContainer: public OfxGenericContainer
{
public:
OfxPushUpContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
void add_attribute(const string identifier, const string value);
};
class OfxStatusContainer: public OfxGenericContainer
{
public:
OfxStatusData data;
OfxStatusContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
~OfxStatusContainer();
void add_attribute(const string identifier, const string value);
};
class OfxBalanceContainer: public OfxGenericContainer
{
public:
/* Not yet complete see spec 1.6 p.63 */
//char name[OFX_BALANCE_NAME_LENGTH];
//char description[OFX_BALANCE_DESCRIPTION_LENGTH];
//enum BalanceType{DOLLAR, PERCENT, NUMBER} balance_type;
double amount;
bool amount_valid;
time_t date;
bool date_valid;
double margin_balance;
bool margin_balance_valid;
double short_balance;
bool short_balance_valid;
double buying_power;
bool buying_power_valid;
OfxBalanceContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
~OfxBalanceContainer();
void add_attribute(const string identifier, const string value);
};
/***************************************************************************
* OfxStatementContainer *
***************************************************************************/
class OfxStatementContainer: public OfxGenericContainer
{
public:
OfxStatementData data;
OfxStatementContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
~OfxStatementContainer();
void add_attribute(const string identifier, const string value);
virtual int add_to_main_tree();
virtual int gen_event();
void add_account(OfxAccountData * account_data);
void add_balance(OfxBalanceContainer* ptr_balance_container);
// void add_transaction(const OfxTransactionData transaction_data);
};
/***************************************************************************
* OfxAccountContainer *
***************************************************************************/
class OfxAccountContainer: public OfxGenericContainer
{
public:
OfxAccountData data;
OfxAccountContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
~OfxAccountContainer();
void add_attribute(const string identifier, const string value);
int add_to_main_tree();
virtual int gen_event();
private:
void gen_account_id(void);
char bankid[OFX_BANKID_LENGTH];
char branchid[OFX_BRANCHID_LENGTH];
char acctid[OFX_ACCTID_LENGTH];
char acctkey[OFX_ACCTKEY_LENGTH];
char brokerid[OFX_BROKERID_LENGTH];
};
/***************************************************************************
* OfxSecurityContainer *
***************************************************************************/
class OfxSecurityContainer: public OfxGenericContainer
{
public:
OfxSecurityData data;
OfxSecurityContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
~OfxSecurityContainer();
void add_attribute(const string identifier, const string value);
virtual int gen_event();
virtual int add_to_main_tree();
private:
OfxStatementContainer * parent_statement;
};
/***************************************************************************
* OfxPositionContainer *
***************************************************************************/
class OfxPositionContainer: public OfxGenericContainer
{
public:
OfxPositionData data;
OfxPositionContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
~OfxPositionContainer();
void add_attribute(const string identifier, const string value);
void add_account(OfxAccountData * account_data);
virtual int gen_event();
virtual int add_to_main_tree();
private:
OfxStatementContainer * parent_statement;
};
/***************************************************************************
* OfxTransactionContainer *
***************************************************************************/
class OfxTransactionContainer: public OfxGenericContainer
{
public:
OfxTransactionData data;
OfxTransactionContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
~OfxTransactionContainer();
virtual void add_attribute(const string identifier, const string value);
void add_account(OfxAccountData * account_data);
virtual int gen_event();
virtual int add_to_main_tree();
private:
OfxStatementContainer * parent_statement;
};
class OfxBankTransactionContainer: public OfxTransactionContainer
{
public:
OfxBankTransactionContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
void add_attribute(const string identifier, const string value);
};
class OfxInvestmentTransactionContainer: public OfxTransactionContainer
{
public:
OfxInvestmentTransactionContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
void add_attribute(const string identifier, const string value);
};
/***************************************************************************
* OfxMainContainer *
***************************************************************************/
class OfxMainContainer: public OfxGenericContainer
{
public:
OfxMainContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
~OfxMainContainer();
int add_container(OfxGenericContainer * container);
int add_container(OfxStatementContainer * container);
int add_container(OfxAccountContainer * container);
int add_container(OfxTransactionContainer * container);
int add_container(OfxSecurityContainer * container);
int add_container(OfxPositionContainer * container);
int gen_event();
OfxSecurityData * find_security(string unique_id);
private:
tree<OfxGenericContainer *> security_tree;
tree<OfxGenericContainer *> account_tree;
};
#endif
OfxAccountData
An abstraction of an account.
Definition: inc/libofx.h:276
OfxSecurityContainer
Represents a security, such as a stock or bond.
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:204
OfxBalanceContainer::short_balance_valid
bool short_balance_valid
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:139
OfxBalanceContainer::date
time_t date
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:130
OfxGenericContainer
A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer.
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:33
OfxPositionData
An abstraction of a security position held in an account.
Definition: inc/libofx.h:1161
OfxTransactionContainer
Represents a generic transaction.
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:245
std
LibofxContext
Definition: build/libofx-0.10.0/lib/context.hh:25
OfxBalanceContainer::amount
double amount
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:128
OfxGenericContainer::tag_identifier
string tag_identifier
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:37
OfxStatementContainer
Represents a statement for either a bank account or a credit card account.
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:157
OfxBalanceContainer::date_valid
bool date_valid
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:131
OfxStatusData
An abstraction of an OFX STATUS element.
Definition: inc/libofx.h:214
OfxInvestmentTransactionContainer
Represents a bank or credid card transaction.
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:276
OfxGenericContainer::type
string type
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:36
OfxPushUpContainer
A container to hold a OFX SGML element for which you want the parent to process it&#39;s data elements...
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:98
OfxPositionContainer
Represents an investment position, such as a stock or bond.
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:224
tree
Definition: build/libofx-0.10.0/lib/tree.hh:105
OfxSecurityData
An abstraction of a security, such as a stock, mutual fund, etc.
Definition: inc/libofx.h:358
OfxTransactionData
An abstraction of a transaction in an account.
Definition: inc/libofx.h:682
OfxBankTransactionContainer
Represents a bank or credid card transaction.
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:265
OfxAccountContainer
Represents a bank account or a credit card account.
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:180
OfxMainContainer
The root container. Created by the <OFX> OFX element or by the export functions.
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:291
OfxStatementData
An abstraction of an account statement.
Definition: inc/libofx.h:1057
OfxDummyContainer
A container to hold OFX SGML elements that LibOFX knows nothing about.
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:76
OfxBalanceContainer
Represents the <BALANCE>, <INVBAL> or <INV401KBAL> OFX SGML entity.
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:121
OfxBalanceContainer::margin_balance_valid
bool margin_balance_valid
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:135
OfxInv401kContainer
A container to hold OFX SGML elements for <INV401K>
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:87
OfxStatusContainer
Represents the <STATUS> OFX SGML entity.
Definition: build/libofx-0.10.0/lib/ofx_containers.hh:107