LibOFX: ofx_containers.hh Source File

- Main Page
- Namespaces
- Data Structures
- Files
- Related Pages

- File List
- Globals

# ofx_containers.hh

Go to the documentation of this file.

    00001 /***************************************************************************
    00002                           ofx_proc_rs.h
    00003                              -------------------
    00004     copyright            : (C) 2002 by Benoit Grégoire
    00005     email                : bock@step.polymtl.ca
    00006 ***************************************************************************/
    00013 /***************************************************************************
    00014  *                                                                         *
    00015  *   This program is free software; you can redistribute it and/or modify  *
    00016  *   it under the terms of the GNU General Public License as published by  *
    00017  *   the Free Software Foundation; either version 2 of the License, or     *
    00018  *   (at your option) any later version.                                   *
    00019  *                                                                         *
    00020  ***************************************************************************/
    00021 #ifndef OFX_PROC_H
    00022 #define OFX_PROC_H
    00023 #include "libofx.h"
    00024 #include "tree.hh"
    00025 #include "context.hh"
    00026
    00027 using namespace std;
    00028
    00033 class OfxGenericContainer {
    00034  public:
    00035   string type;
    00036   string tag_identifier;
    00037   OfxGenericContainer *parentcontainer;
    00038   LibofxContext *libofx_context;
    00039
    00040   OfxGenericContainer(LibofxContext *p_libofx_context);
    00041   OfxGenericContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer);
    00042   OfxGenericContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
    00043
    00044   virtual ~OfxGenericContainer(){};
    00045
    00052   virtual void add_attribute(const string identifier, const string value);
    00058   virtual int gen_event();
    00059
    00065   virtual int add_to_main_tree();
    00066
    00068     OfxGenericContainer* getparent();
    00069 };//End class OfxGenericObject
    00070
    00075 class OfxDummyContainer:public OfxGenericContainer {
    00076  public:
    00077   OfxDummyContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
    00078   void add_attribute(const string identifier, const string value);
    00079 };
    00080
    00085 class OfxPushUpContainer:public OfxGenericContainer {
    00086  public:
    00087
    00088   OfxPushUpContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
    00089   void add_attribute(const string identifier, const string value);
    00090 };
    00091
    00093 class OfxStatusContainer:public OfxGenericContainer {
    00094  public:
    00095   OfxStatusData data;
    00096
    00097   OfxStatusContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
    00098   ~OfxStatusContainer();
    00099   void add_attribute(const string identifier, const string value);
    00100 };
    00101
    00106 class OfxBalanceContainer:public OfxGenericContainer {
    00107  public:
    00108   /* Not yet complete see spec 1.6 p.63 */
    00109   //char name[OFX_BALANCE_NAME_LENGTH];
    00110   //char description[OFX_BALANCE_DESCRIPTION_LENGTH];
    00111   //enum BalanceType{DOLLAR, PERCENT, NUMBER} balance_type;
    00112   double amount;
    00113   int amount_valid;
    00114   time_t date;
    00115   int date_valid;
    00116
    00117   OfxBalanceContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
    00118   ~OfxBalanceContainer();
    00119   void add_attribute(const string identifier, const string value);
    00120 };
    00121
    00122 /***************************************************************************
    00123  *                          OfxStatementContainer                          *
    00124  ***************************************************************************/
    00129 class OfxStatementContainer:public OfxGenericContainer {
    00130  public:
    00131   OfxStatementData data;
    00132
    00133   OfxStatementContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
    00134   ~OfxStatementContainer();
    00135   void add_attribute(const string identifier, const string value);
    00136   virtual int add_to_main_tree();
    00137   virtual int gen_event();
    00138   void add_account(OfxAccountData * account_data);
    00139   void add_balance(OfxBalanceContainer* ptr_balance_container);
    00140 //  void add_transaction(const OfxTransactionData transaction_data);
    00141
    00142 };
    00143
    00144 /***************************************************************************
    00145  *                           OfxAccountContaine r                          *
    00146  ***************************************************************************/
    00151 class OfxAccountContainer:public OfxGenericContainer {
    00152  public:
    00153   OfxAccountData data;
    00154
    00155   OfxAccountContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
    00156   ~OfxAccountContainer();
    00157   void add_attribute(const string identifier, const string value);
    00158   int add_to_main_tree();
    00159   virtual int gen_event();
    00160  private:
    00161   void gen_account_id(void);
    00162   char bankid[OFX_BANKID_LENGTH];
    00163   char branchid[OFX_BRANCHID_LENGTH];
    00164   char acctid[OFX_ACCTID_LENGTH];
    00165   char acctkey[OFX_ACCTKEY_LENGTH];
    00166   char brokerid[OFX_BROKERID_LENGTH];
    00167 };
    00168
    00169 /***************************************************************************
    00170  *                           OfxSecurityContainer                          *
    00171  ***************************************************************************/
    00174 class OfxSecurityContainer:public OfxGenericContainer {
    00175  public:
    00176   OfxSecurityData data;
    00177
    00178   OfxSecurityContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
    00179   ~OfxSecurityContainer();
    00180   void add_attribute(const string identifier, const string value);
    00181   virtual int gen_event();
    00182   virtual int add_to_main_tree();
    00183  private:
    00184   OfxStatementContainer * parent_statement;
    00185 };
    00186
    00187
    00188 /***************************************************************************
    00189  *                        OfxTransactionContainer                          *
    00190  ***************************************************************************/
    00193 class OfxTransactionContainer:public OfxGenericContainer {
    00194  public:
    00195   OfxTransactionData data;
    00196
    00197   OfxTransactionContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
    00198   ~OfxTransactionContainer();
    00199   virtual void add_attribute(const string identifier, const string value);
    00200   void add_account(OfxAccountData * account_data);
    00201
    00202   virtual int gen_event();
    00203   virtual int add_to_main_tree();
    00204  private:
    00205   OfxStatementContainer * parent_statement;
    00206 };
    00207
    00212 class OfxBankTransactionContainer:public OfxTransactionContainer {
    00213  public:
    00214   OfxBankTransactionContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
    00215   void add_attribute(const string identifier, const string value);
    00216 };
    00217
    00222 class OfxInvestmentTransactionContainer:public OfxTransactionContainer {
    00223  public:
    00224   OfxInvestmentTransactionContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
    00225
    00226   void add_attribute(const string identifier, const string value);
    00227 };
    00228
    00229 /***************************************************************************
    00230  *                             OfxMainContainer                            *
    00231  ***************************************************************************/
    00236 class OfxMainContainer:public OfxGenericContainer {
    00237 public:
    00238   OfxMainContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
    00239   ~OfxMainContainer();
    00240   int add_container(OfxGenericContainer * container);
    00241   int add_container(OfxStatementContainer * container);
    00242   int add_container(OfxAccountContainer * container);
    00243   int add_container(OfxTransactionContainer * container);
    00244   int add_container(OfxSecurityContainer * container);
    00245   int gen_event();
    00246   OfxSecurityData * find_security(string unique_id);
    00247 private:
    00248   tree<OfxGenericContainer *> security_tree;
    00249   tree<OfxGenericContainer *> account_tree;
    00250 };
    00251
    00252
    00253 #endif