LibOFX
ofx_containers.hh
Go to the documentation of this file.
1 /***************************************************************************
2  ofx_proc_rs.h
3  -------------------
4  copyright : (C) 2002 by Benoit Gr�goire
5  email : benoitg@coeus.ca
6 ***************************************************************************/
13 /***************************************************************************
14  * *
15  * This program is free software; you can redistribute it and/or modify *
16  * it under the terms of the GNU General Public License as published by *
17  * the Free Software Foundation; either version 2 of the License, or *
18  * (at your option) any later version. *
19  * *
20  ***************************************************************************/
21 #ifndef OFX_PROC_H
22 #define OFX_PROC_H
23 #include "libofx.h"
24 #include "tree.hh"
25 #include "context.hh"
26 
27 using namespace std;
28 
34 {
35 public:
36  string type;
37  string tag_identifier;
38  OfxGenericContainer *parentcontainer;
39  LibofxContext *libofx_context;
40 
41  OfxGenericContainer(LibofxContext *p_libofx_context);
42  OfxGenericContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer);
43  OfxGenericContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
44 
45  virtual ~OfxGenericContainer() {};
46 
53  virtual void add_attribute(const string identifier, const string value);
59  virtual int gen_event();
60 
66  virtual int add_to_main_tree();
67 
69  OfxGenericContainer* getparent();
70 };//End class OfxGenericObject
71 
77 {
78 public:
79  OfxDummyContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
80  void add_attribute(const string identifier, const string value);
81 };
82 
88 {
89 public:
90 
91  OfxPushUpContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
92  void add_attribute(const string identifier, const string value);
93 };
94 
97 {
98 public:
99  OfxStatusData data;
100 
101  OfxStatusContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
103  void add_attribute(const string identifier, const string value);
104 };
105 
111 {
112 public:
113  /* Not yet complete see spec 1.6 p.63 */
114  //char name[OFX_BALANCE_NAME_LENGTH];
115  //char description[OFX_BALANCE_DESCRIPTION_LENGTH];
116  //enum BalanceType{DOLLAR, PERCENT, NUMBER} balance_type;
117  double amount;
118  int amount_valid;
119  time_t date;
120  int date_valid;
121 
122  OfxBalanceContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
124  void add_attribute(const string identifier, const string value);
125 };
126 
127 /***************************************************************************
128  * OfxStatementContainer *
129  ***************************************************************************/
135 {
136 public:
137  OfxStatementData data;
138 
139  OfxStatementContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
141  void add_attribute(const string identifier, const string value);
142  virtual int add_to_main_tree();
143  virtual int gen_event();
144  void add_account(OfxAccountData * account_data);
145  void add_balance(OfxBalanceContainer* ptr_balance_container);
146 // void add_transaction(const OfxTransactionData transaction_data);
147 
148 };
149 
150 /***************************************************************************
151  * OfxAccountContaine r *
152  ***************************************************************************/
158 {
159 public:
160  OfxAccountData data;
161 
162  OfxAccountContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
164  void add_attribute(const string identifier, const string value);
165  int add_to_main_tree();
166  virtual int gen_event();
167 private:
168  void gen_account_id(void);
169  char bankid[OFX_BANKID_LENGTH];
170  char branchid[OFX_BRANCHID_LENGTH];
171  char acctid[OFX_ACCTID_LENGTH];
172  char acctkey[OFX_ACCTKEY_LENGTH];
173  char brokerid[OFX_BROKERID_LENGTH];
174 };
175 
176 /***************************************************************************
177  * OfxSecurityContainer *
178  ***************************************************************************/
182 {
183 public:
184  OfxSecurityData data;
185 
186  OfxSecurityContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
188  void add_attribute(const string identifier, const string value);
189  virtual int gen_event();
190  virtual int add_to_main_tree();
191 private:
192  OfxStatementContainer * parent_statement;
193 };
194 
195 
196 /***************************************************************************
197  * OfxTransactionContainer *
198  ***************************************************************************/
202 {
203 public:
204  OfxTransactionData data;
205 
206  OfxTransactionContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
208  virtual void add_attribute(const string identifier, const string value);
209  void add_account(OfxAccountData * account_data);
210 
211  virtual int gen_event();
212  virtual int add_to_main_tree();
213 private:
214  OfxStatementContainer * parent_statement;
215 };
216 
222 {
223 public:
224  OfxBankTransactionContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
225  void add_attribute(const string identifier, const string value);
226 };
227 
233 {
234 public:
235  OfxInvestmentTransactionContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
236 
237  void add_attribute(const string identifier, const string value);
238 };
239 
240 /***************************************************************************
241  * OfxMainContainer *
242  ***************************************************************************/
248 {
249 public:
250  OfxMainContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
251  ~OfxMainContainer();
252  int add_container(OfxGenericContainer * container);
253  int add_container(OfxStatementContainer * container);
254  int add_container(OfxAccountContainer * container);
255  int add_container(OfxTransactionContainer * container);
256  int add_container(OfxSecurityContainer * container);
257  int gen_event();
258  OfxSecurityData * find_security(string unique_id);
259 private:
260  tree<OfxGenericContainer *> security_tree;
261  tree<OfxGenericContainer *> account_tree;
262 };
263 
264 
265 #endif
An abstraction of an account.
Definition: inc/libofx.h:271
Represents a security, such as a stock or bond.
A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer.
Represents a generic transaction.
Represents a statement for either a bank account or a credit card account.
An abstraction of an OFX STATUS element.
Definition: inc/libofx.h:209
Represents a bank or credid card transaction.
A container to hold a OFX SGML element for which you want the parent to process it's data elements...
An abstraction of a security, such as a stock, mutual fund, etc.
Definition: inc/libofx.h:352
An abstraction of a transaction in an account.
Definition: inc/libofx.h:475
Represents a bank or credid card transaction.
Represents a bank account or a credit card account.
The root container. Created by the <OFX> OFX element or by the export functions.
An abstraction of an account statement.
Definition: inc/libofx.h:637
A container to holds OFX SGML elements that LibOFX knows nothing about.
Represents the <BALANCE> OFX SGML entity.
Represents the <STATUS> OFX SGML entity.