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
24using namespace std;
26{
27private:
28 LibofxFileFormat _current_file_type;
29
30 LibofxProcStatusCallback _statusCallback;
31 LibofxProcAccountCallback _accountCallback;
32 LibofxProcSecurityCallback _securityCallback;
33 LibofxProcTransactionCallback _transactionCallback;
34 LibofxProcStatementCallback _statementCallback;
35 LibofxProcPositionCallback _positionCallback;
36
37 void * _statementData;
38 void * _accountData;
39 void * _transactionData;
40 void * _securityData;
41 void * _statusData;
42 void * _positionData;
43
44 std::string _dtdDir;
45
46public:
49
50 LibofxFileFormat currentFileType() const;
51 void setCurrentFileType(LibofxFileFormat t);
52
53 const std::string &dtdDir() const
54 {
55 return _dtdDir;
56 };
57 void setDtdDir(const std::string &s)
58 {
59 _dtdDir = s;
60 };
61
62 int statementCallback(const struct OfxStatementData data);
63 int accountCallback(const struct OfxAccountData data);
64 int transactionCallback(const struct OfxTransactionData data);
65 int securityCallback(const struct OfxSecurityData data);
66 int statusCallback(const struct OfxStatusData data);
67 int positionCallback(const struct OfxPositionData data);
68
69 void setStatusCallback(LibofxProcStatusCallback cb, void *user_data);
70 void setAccountCallback(LibofxProcAccountCallback cb, void *user_data);
71 void setSecurityCallback(LibofxProcSecurityCallback cb, void *user_data);
72 void setTransactionCallback(LibofxProcTransactionCallback cb, void *user_data);
73 void setStatementCallback(LibofxProcStatementCallback cb, void *user_data);
74 void setPositionCallback(LibofxProcPositionCallback cb, void *user_data);
75
76
77};//End class LibofxContext
78
79
80
81
82#endif
Main header file containing the LibOfx API.
int(* LibofxProcTransactionCallback)(const struct OfxTransactionData data, void *transaction_data)
The callback function for the OfxTransactionData structure.
Definition libofx.h:1046
int(* LibofxProcAccountCallback)(const struct OfxAccountData data, void *account_data)
The callback function for the OfxAccountData structure.
Definition libofx.h:349
int(* LibofxProcPositionCallback)(const struct OfxPositionData data, void *position_data)
The callback function for the OfxPositionData structure.
Definition libofx.h:1270
int(* LibofxProcStatementCallback)(const struct OfxStatementData data, void *statement_data)
The callback function for the OfxStatementData structure.
Definition libofx.h:1142
LibofxFileFormat
Definition libofx.h:127
int(* LibofxProcSecurityCallback)(const struct OfxSecurityData data, void *security_data)
The callback function for the OfxSecurityData structure.
Definition libofx.h:620
int(* LibofxProcStatusCallback)(const struct OfxStatusData data, void *status_data)
The callback function for the OfxStatusData structure.
Definition libofx.h:263
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