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 
24 using namespace std;
26 {
27 private:
28  LibofxFileFormat _current_file_type;
29 
30  LibofxProcStatusCallback _statusCallback;
31  LibofxProcAccountCallback _accountCallback;
32  LibofxProcSecurityCallback _securityCallback;
33  LibofxProcTransactionCallback _transactionCallback;
34  LibofxProcStatementCallback _statementCallback;
35 
36  void * _statementData;
37  void * _accountData;
38  void * _transactionData;
39  void * _securityData;
40  void * _statusData;
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 
66  void setStatusCallback(LibofxProcStatusCallback cb, void *user_data);
67  void setAccountCallback(LibofxProcAccountCallback cb, void *user_data);
68  void setSecurityCallback(LibofxProcSecurityCallback cb, void *user_data);
69  void setTransactionCallback(LibofxProcTransactionCallback cb, void *user_data);
70  void setStatementCallback(LibofxProcStatementCallback cb, void *user_data);
71 
72 
73 };//End class LibofxContext
74 
75 
76 
77 
78 #endif
An abstraction of an account.
Definition: inc/libofx.h:271
int(* LibofxProcAccountCallback)(const struct OfxAccountData data, void *account_data)
The callback function for the OfxAccountData stucture.
Definition: inc/libofx.h:343
int(* LibofxProcTransactionCallback)(const struct OfxTransactionData data, void *transaction_data)
The callback function for the OfxTransactionData stucture.
Definition: inc/libofx.h:626
int(* LibofxProcSecurityCallback)(const struct OfxSecurityData data, void *security_data)
The callback function for the OfxSecurityData stucture.
Definition: inc/libofx.h:414
int(* LibofxProcStatusCallback)(const struct OfxStatusData data, void *status_data)
The callback function for the OfxStatusData stucture.
Definition: inc/libofx.h:258
An abstraction of an OFX STATUS element.
Definition: inc/libofx.h:209
An abstraction of a security, such as a stock, mutual fund, etc.
Definition: inc/libofx.h:352
int(* LibofxProcStatementCallback)(const struct OfxStatementData data, void *statement_data)
The callback function for the OfxStatementData stucture.
Definition: inc/libofx.h:704
An abstraction of a transaction in an account.
Definition: inc/libofx.h:475
LibofxFileFormat
Definition: inc/libofx.h:123
An abstraction of an account statement.
Definition: inc/libofx.h:637