LibOFX
build/libofx-0.10.0/lib/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  OfxInv401kContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
91  void add_attribute(const string identifier, const string value);
92 };
93 
99 {
100 public:
101 
102  OfxPushUpContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
103  void add_attribute(const string identifier, const string value);
104 };
105 
108 {
109 public:
110  OfxStatusData data;
111 
112  OfxStatusContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
114  void add_attribute(const string identifier, const string value);
115 };
116 
122 {
123 public:
124  /* Not yet complete see spec 1.6 p.63 */
125  //char name[OFX_BALANCE_NAME_LENGTH];
126  //char description[OFX_BALANCE_DESCRIPTION_LENGTH];
127  //enum BalanceType{DOLLAR, PERCENT, NUMBER} balance_type;
128  double amount;
129  bool amount_valid;
130  time_t date;
132 
134  double margin_balance;
136 
138  double short_balance;
140 
142  double buying_power;
143  bool buying_power_valid;
144 
145  OfxBalanceContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
147  void add_attribute(const string identifier, const string value);
148 };
149 
150 /***************************************************************************
151  * OfxStatementContainer *
152  ***************************************************************************/
158 {
159 public:
160  OfxStatementData data;
161 
162  OfxStatementContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
164  void add_attribute(const string identifier, const string value);
165  virtual int add_to_main_tree();
166  virtual int gen_event();
167  void add_account(OfxAccountData * account_data);
168  void add_balance(OfxBalanceContainer* ptr_balance_container);
169 // void add_transaction(const OfxTransactionData transaction_data);
170 
171 };
172 
173 /***************************************************************************
174  * OfxAccountContainer *
175  ***************************************************************************/
181 {
182 public:
183  OfxAccountData data;
184 
185  OfxAccountContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
187  void add_attribute(const string identifier, const string value);
188  int add_to_main_tree();
189  virtual int gen_event();
190 private:
191  void gen_account_id(void);
192  char bankid[OFX_BANKID_LENGTH];
193  char branchid[OFX_BRANCHID_LENGTH];
194  char acctid[OFX_ACCTID_LENGTH];
195  char acctkey[OFX_ACCTKEY_LENGTH];
196  char brokerid[OFX_BROKERID_LENGTH];
197 };
198 
199 /***************************************************************************
200  * OfxSecurityContainer *
201  ***************************************************************************/
205 {
206 public:
207  OfxSecurityData data;
208 
209  OfxSecurityContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
211  void add_attribute(const string identifier, const string value);
212  virtual int gen_event();
213  virtual int add_to_main_tree();
214 private:
215  OfxStatementContainer * parent_statement;
216 };
217 
218 
219 /***************************************************************************
220  * OfxPositionContainer *
221  ***************************************************************************/
225 {
226 public:
227  OfxPositionData data;
228 
229  OfxPositionContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
231  void add_attribute(const string identifier, const string value);
232  void add_account(OfxAccountData * account_data);
233  virtual int gen_event();
234  virtual int add_to_main_tree();
235 private:
236  OfxStatementContainer * parent_statement;
237 };
238 
239 
240 /***************************************************************************
241  * OfxTransactionContainer *
242  ***************************************************************************/
246 {
247 public:
248  OfxTransactionData data;
249 
250  OfxTransactionContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
252  virtual void add_attribute(const string identifier, const string value);
253  void add_account(OfxAccountData * account_data);
254 
255  virtual int gen_event();
256  virtual int add_to_main_tree();
257 private:
258  OfxStatementContainer * parent_statement;
259 };
260 
266 {
267 public:
268  OfxBankTransactionContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
269  void add_attribute(const string identifier, const string value);
270 };
271 
277 {
278 public:
279  OfxInvestmentTransactionContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
280 
281  void add_attribute(const string identifier, const string value);
282 };
283 
284 /***************************************************************************
285  * OfxMainContainer *
286  ***************************************************************************/
292 {
293 public:
294  OfxMainContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
295  ~OfxMainContainer();
296  int add_container(OfxGenericContainer * container);
297  int add_container(OfxStatementContainer * container);
298  int add_container(OfxAccountContainer * container);
299  int add_container(OfxTransactionContainer * container);
300  int add_container(OfxSecurityContainer * container);
301  int add_container(OfxPositionContainer * container);
302  int gen_event();
303  OfxSecurityData * find_security(string unique_id);
304 private:
305  tree<OfxGenericContainer *> security_tree;
306  tree<OfxGenericContainer *> account_tree;
307 };
308 
309 
310 #endif
An abstraction of an account.
Definition: inc/libofx.h:276
Represents a security, such as a stock or bond.
A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer.
An abstraction of a security position held in an account.
Definition: inc/libofx.h:1161
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:214
Represents a bank or credid card transaction.
A container to hold a OFX SGML element for which you want the parent to process it&#39;s data elements...
Represents an investment position, such as a stock or bond.
An abstraction of a security, such as a stock, mutual fund, etc.
Definition: inc/libofx.h:358
An abstraction of a transaction in an account.
Definition: inc/libofx.h:682
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:1057
A container to hold OFX SGML elements that LibOFX knows nothing about.
Represents the <BALANCE>, <INVBAL> or <INV401KBAL> OFX SGML entity.
A container to hold OFX SGML elements for <INV401K>
Represents the <STATUS> OFX SGML entity.