LibOFX

context.hh
1
5 /***************************************************************************
6 * *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
12 ***************************************************************************/
13
14 #ifndef CONTEXT_H
15 #define CONTEXT_H
16 #include <string.h>
17 #include <time.h> // for time_t
18 #include "libofx.h"
19 #include "ParserEventGeneratorKit.h"
20
21 #include <string>
22
23 class LibofxContext
24 {
25 private:
26 LibofxFileFormat _current_file_type;
27
28 LibofxProcStatusCallback _statusCallback;
29 LibofxProcAccountCallback _accountCallback;
30 LibofxProcSecurityCallback _securityCallback;
31 LibofxProcTransactionCallback _transactionCallback;
32 LibofxProcStatementCallback _statementCallback;
33 LibofxProcPositionCallback _positionCallback;
34
35 void * _statementData;
36 void * _accountData;
37 void * _transactionData;
38 void * _securityData;
39 void * _statusData;
40 void * _positionData;
41
42 std::string _dtdDir;
43
44 public:
45 LibofxContext();
46 ~LibofxContext();
47
48 LibofxFileFormat currentFileType() const;
49 void setCurrentFileType(LibofxFileFormat t);
50
51 const std::string &dtdDir() const
52 {
53 return _dtdDir;
54 };
55 void setDtdDir(const std::string &s)
56 {
57 _dtdDir = s;
58 };
59
60 int statementCallback(const struct OfxStatementData data);
61 int accountCallback(const struct OfxAccountData data);
62 int transactionCallback(const struct OfxTransactionData data);
63 int securityCallback(const struct OfxSecurityData data);
64 int statusCallback(const struct OfxStatusData data);
65 int positionCallback(const struct OfxPositionData data);
66
67 void setStatusCallback(LibofxProcStatusCallback cb, void *user_data);
68 void setAccountCallback(LibofxProcAccountCallback cb, void *user_data);
69 void setSecurityCallback(LibofxProcSecurityCallback cb, void *user_data);
70 void setTransactionCallback(LibofxProcTransactionCallback cb, void *user_data);
71 void setStatementCallback(LibofxProcStatementCallback cb, void *user_data);
72 void setPositionCallback(LibofxProcPositionCallback cb, void *user_data);
73
74
75 };//End class LibofxContext
76
77
78
79
80 #endif
OfxSecurityData
An abstraction of a security, such as a stock, mutual fund, etc.
Definition: inc/libofx.h:369
OfxTransactionData
An abstraction of a transaction in an account.
Definition: inc/libofx.h:693
OfxAccountData
An abstraction of an account.
Definition: inc/libofx.h:287
LibofxProcStatementCallback
int(* LibofxProcStatementCallback)(const struct OfxStatementData data, void *statement_data)
The callback function for the OfxStatementData structure.
Definition: inc/libofx.h:1153
OfxStatusData
An abstraction of an OFX STATUS element.
Definition: inc/libofx.h:225
OfxStatementData
An abstraction of an account statement.
Definition: inc/libofx.h:1068
LibofxFileFormat
LibofxFileFormat
Definition: inc/libofx.h:137
LibofxContext
Definition: context.hh:23
LibofxProcTransactionCallback
int(* LibofxProcTransactionCallback)(const struct OfxTransactionData data, void *transaction_data)
The callback function for the OfxTransactionData structure.
Definition: inc/libofx.h:1057
LibofxProcStatusCallback
int(* LibofxProcStatusCallback)(const struct OfxStatusData data, void *status_data)
The callback function for the OfxStatusData structure.
Definition: inc/libofx.h:274
LibofxProcSecurityCallback
int(* LibofxProcSecurityCallback)(const struct OfxSecurityData data, void *security_data)
The callback function for the OfxSecurityData structure.
Definition: inc/libofx.h:631
LibofxProcAccountCallback
int(* LibofxProcAccountCallback)(const struct OfxAccountData data, void *account_data)
The callback function for the OfxAccountData structure.
Definition: inc/libofx.h:360
LibofxProcPositionCallback
int(* LibofxProcPositionCallback)(const struct OfxPositionData data, void *position_data)
The callback function for the OfxPositionData structure.
Definition: inc/libofx.h:1281
OfxPositionData
An abstraction of a security position held in an account.
Definition: inc/libofx.h:1172