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
27using namespace std;
28
34{
35public:
36 string type;
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
70};//End class OfxGenericObject
71
77{
78public:
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{
89public:
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{
100public:
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{
109public:
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{
123public:
124 /* Not yet complete see spec 1.6 p.63 */
125 //std::string name;
126 //std::string description;
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{
159public:
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{
182public:
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();
190private:
191 void gen_account_id(void);
192 std::string m_bankid;
193 std::string m_branchid;
194 std::string m_acctid;
195 std::string m_acctkey;
196 std::string m_brokerid;
197};
198
199/***************************************************************************
200 * OfxSecurityContainer *
201 ***************************************************************************/
205{
206public:
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();
214private:
215 OfxStatementContainer * parent_statement;
216};
217
218
219/***************************************************************************
220 * OfxPositionContainer *
221 ***************************************************************************/
225{
226public:
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();
235private:
236 OfxStatementContainer * parent_statement;
237};
238
239
240/***************************************************************************
241 * OfxTransactionContainer *
242 ***************************************************************************/
246{
247public:
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();
257private:
258 OfxStatementContainer * parent_statement;
259};
260
266{
267public:
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{
278public:
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{
293public:
294 OfxMainContainer(LibofxContext *p_libofx_context, OfxGenericContainer *para_parentcontainer, string para_tag_identifier);
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);
304private:
305 tree<OfxGenericContainer *> security_tree;
306 tree<OfxGenericContainer *> account_tree;
307};
308
309
310#endif
Represents a bank account or a credit card account.
virtual int gen_event()
Generate libofx.h events.
void add_attribute(const string identifier, const string value)
Add data to a container object.
int add_to_main_tree()
Add this container to the main tree.
Represents the <BALANCE>, <INVBAL> or <INV401KBAL> OFX SGML entity.
void add_attribute(const string identifier, const string value)
Add data to a container object.
Represents a bank or credid card transaction.
void add_attribute(const string identifier, const string value)
Add data to a container object.
A container to hold OFX SGML elements that LibOFX knows nothing about.
void add_attribute(const string identifier, const string value)
Add data to a container object.
A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer.
OfxGenericContainer * getparent()
Returns the parent container object (the one representing the containing OFX SGML element)
virtual void add_attribute(const string identifier, const string value)
Add data to a container object.
virtual int gen_event()
Generate libofx.h events.
virtual int add_to_main_tree()
Add this container to the main tree.
A container to hold OFX SGML elements for <INV401K>
void add_attribute(const string identifier, const string value)
Add data to a container object.
Represents a bank or credid card transaction.
void add_attribute(const string identifier, const string value)
Add data to a container object.
The root container. Created by the <OFX> OFX element or by the export functions.
int gen_event()
Generate libofx.h events.
Represents an investment position, such as a stock or bond.
void add_attribute(const string identifier, const string value)
Add data to a container object.
virtual int add_to_main_tree()
Add this container to the main tree.
virtual int gen_event()
Generate libofx.h events.
A container to hold a OFX SGML element for which you want the parent to process it's data elements.
void add_attribute(const string identifier, const string value)
Add data to a container object.
Represents a security, such as a stock or bond.
virtual int gen_event()
Generate libofx.h events.
void add_attribute(const string identifier, const string value)
Add data to a container object.
virtual int add_to_main_tree()
Add this container to the main tree.
Represents a statement for either a bank account or a credit card account.
virtual int gen_event()
Generate libofx.h events.
virtual int add_to_main_tree()
Add this container to the main tree.
void add_attribute(const string identifier, const string value)
Add data to a container object.
Represents the <STATUS> OFX SGML entity.
void add_attribute(const string identifier, const string value)
Add data to a container object.
Represents a generic transaction.
virtual int gen_event()
Generate libofx.h events.
virtual void add_attribute(const string identifier, const string value)
Add data to a container object.
virtual int add_to_main_tree()
Add this container to the main tree.
Definition tree.hh:106
Main header file containing the LibOfx API.
An abstraction of an account.
Definition libofx.h:277
An abstraction of a security position held in an account.
Definition libofx.h:1162
An abstraction of a security, such as a stock, mutual fund, etc.
Definition libofx.h:359
An abstraction of an account statement.
Definition libofx.h:1058
An abstraction of an OFX STATUS element.
Definition libofx.h:215
An abstraction of a transaction in an account.
Definition libofx.h:683