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 
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