1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3
<title>LibOFX: context.cpp Source File</title>
4
<link href="doxygen.css" rel="stylesheet" type="text/css">
6
<!-- Generated by Doxygen 1.3.7 -->
7
<div class="qindex"><a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
8
<h1>context.cpp</h1><pre class="fragment"><div>00001
9
00005 <span class="comment">/***************************************************************************</span>
10
00006 <span class="comment"> * *</span>
11
00007 <span class="comment"> * This program is free software; you can redistribute it and/or modify *</span>
12
00008 <span class="comment"> * it under the terms of the GNU General Public License as published by *</span>
13
00009 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or *</span>
14
00010 <span class="comment"> * (at your option) any later version. *</span>
15
00011 <span class="comment"> * *</span>
16
00012 <span class="comment"> ***************************************************************************/</span>
17
00013 <span class="preprocessor">#include <config.h></span>
18
00014 <span class="preprocessor">#include "context.hh"</span>
20
00016 <span class="keyword">using</span> <span class="keyword">namespace </span>std;
24
00020 LibofxContext::LibofxContext()
25
00021 :_current_file_type(<a class="code" href="inc_2libofx_8h.html#a90a35">OFX</a>)
26
00022 ,_statusCallback(0)
27
00023 ,_accountCallback(0)
28
00024 ,_securityCallback(0)
29
00025 ,_transactionCallback(0)
30
00026 ,_statementCallback(0)
31
00027 ,_statementData(0)
32
00028 ,_accountData(0)
33
00029 ,_transactionData(0)
34
00030 ,_securityData(0)
42
00038 LibofxContext::~LibofxContext(){
47
00043 <a class="code" href="inc_2libofx_8h.html#a90">LibofxFileFormat</a> LibofxContext::currentFileType()<span class="keyword"> const</span>{
48
00044 <span class="keywordflow">return</span> _current_file_type;
53
00049 <span class="keywordtype">void</span> LibofxContext::setCurrentFileType(LibofxFileFormat t) {
54
00050 _current_file_type=t;
59
00055 <span class="keywordtype">int</span> LibofxContext::statementCallback(<span class="keyword">const</span> <span class="keyword">struct</span> <a class="code" href="structOfxStatementData.html">OfxStatementData</a> data){
60
00056 <span class="keywordflow">if</span> (_statementCallback)
61
00057 <span class="keywordflow">return</span> _statementCallback(data, _statementData);
62
00058 <span class="keywordflow">return</span> 0;
67
00063 <span class="keywordtype">int</span> LibofxContext::accountCallback(<span class="keyword">const</span> <span class="keyword">struct</span> <a class="code" href="structOfxAccountData.html">OfxAccountData</a> data){
68
00064 <span class="keywordflow">if</span> (_accountCallback)
69
00065 <span class="keywordflow">return</span> _accountCallback(data, _accountData);
70
00066 <span class="keywordflow">return</span> 0;
75
00071 <span class="keywordtype">int</span> LibofxContext::transactionCallback(<span class="keyword">const</span> <span class="keyword">struct</span> <a class="code" href="structOfxTransactionData.html">OfxTransactionData</a> data){
76
00072 <span class="keywordflow">if</span> (_transactionCallback)
77
00073 <span class="keywordflow">return</span> _transactionCallback(data, _transactionData);
78
00074 <span class="keywordflow">return</span> 0;
83
00079 <span class="keywordtype">int</span> LibofxContext::securityCallback(<span class="keyword">const</span> <span class="keyword">struct</span> <a class="code" href="structOfxSecurityData.html">OfxSecurityData</a> data) {
84
00080 <span class="keywordflow">if</span> (_securityCallback)
85
00081 <span class="keywordflow">return</span> _securityCallback(data, _securityData);
86
00082 <span class="keywordflow">return</span> 0;
91
00087 <span class="keywordtype">int</span> LibofxContext::statusCallback(<span class="keyword">const</span> <span class="keyword">struct</span> <a class="code" href="structOfxStatusData.html">OfxStatusData</a> data) {
92
00088 <span class="keywordflow">if</span> (_statusCallback)
93
00089 <span class="keywordflow">return</span> _statusCallback(data, _statusData);
94
00090 <span class="keywordflow">return</span> 0;
98
00094 <span class="keywordtype">void</span> LibofxContext::setStatusCallback(LibofxProcStatusCallback cb,
99
00095 <span class="keywordtype">void</span> *user_data){
100
00096 _statusCallback=cb;
101
00097 _statusData=user_data;
106
00102 <span class="keywordtype">void</span> LibofxContext::setAccountCallback(LibofxProcAccountCallback cb,
107
00103 <span class="keywordtype">void</span> *user_data){
108
00104 _accountCallback=cb;
109
00105 _accountData=user_data;
114
00110 <span class="keywordtype">void</span> LibofxContext::setSecurityCallback(LibofxProcSecurityCallback cb,
115
00111 <span class="keywordtype">void</span> *user_data){
116
00112 _securityCallback=cb;
117
00113 _securityData=user_data;
122
00118 <span class="keywordtype">void</span> LibofxContext::setTransactionCallback(LibofxProcTransactionCallback cb,
123
00119 <span class="keywordtype">void</span> *user_data){
124
00120 _transactionCallback=cb;
125
00121 _transactionData=user_data;
130
00126 <span class="keywordtype">void</span> LibofxContext::setStatementCallback(LibofxProcStatementCallback cb,
131
00127 <span class="keywordtype">void</span> *user_data){
132
00128 _statementCallback=cb;
133
00129 _statementData=user_data;
142
00140 CFCT LibofxContextPtr <a class="code" href="inc_2libofx_8h.html#a79">libofx_get_new_context</a>(){
143
00141 <span class="keywordflow">return</span> <span class="keyword">new</span> LibofxContext();
146
00144 CFCT <span class="keywordtype">int</span> <a class="code" href="inc_2libofx_8h.html#a80">libofx_free_context</a>( LibofxContextPtr libofx_context_param){
147
00145 <span class="keyword">delete</span> (LibofxContext *)libofx_context_param;
148
00146 <span class="keywordflow">return</span> 0;
154
00152 <span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
155
00153 <span class="keywordtype">void</span> <a class="code" href="inc_2libofx_8h.html#a84">ofx_set_status_cb</a>(LibofxContextPtr ctx,
156
00154 LibofxProcStatusCallback cb,
157
00155 <span class="keywordtype">void</span> *user_data){
158
00156 ((LibofxContext*)ctx)->setStatusCallback(cb, user_data);
162
00160 <span class="keywordtype">void</span> <a class="code" href="inc_2libofx_8h.html#a85">ofx_set_account_cb</a>(LibofxContextPtr ctx,
163
00161 LibofxProcAccountCallback cb,
164
00162 <span class="keywordtype">void</span> *user_data){
165
00163 ((LibofxContext*)ctx)->setAccountCallback(cb, user_data);
170
00168 <span class="keywordtype">void</span> <a class="code" href="inc_2libofx_8h.html#a86">ofx_set_security_cb</a>(LibofxContextPtr ctx,
171
00169 LibofxProcSecurityCallback cb,
172
00170 <span class="keywordtype">void</span> *user_data){
173
00171 ((LibofxContext*)ctx)->setSecurityCallback(cb, user_data);
178
00176 <span class="keywordtype">void</span> <a class="code" href="inc_2libofx_8h.html#a87">ofx_set_transaction_cb</a>(LibofxContextPtr ctx,
179
00177 LibofxProcTransactionCallback cb,
180
00178 <span class="keywordtype">void</span> *user_data){
181
00179 ((LibofxContext*)ctx)->setTransactionCallback(cb, user_data);
186
00184 <span class="keywordtype">void</span> <a class="code" href="inc_2libofx_8h.html#a88">ofx_set_statement_cb</a>(LibofxContextPtr ctx,
187
00185 LibofxProcStatementCallback cb,
188
00186 <span class="keywordtype">void</span> *user_data){
189
00187 ((LibofxContext*)ctx)->setStatementCallback(cb, user_data);
206
</div></pre><hr size="1"><address style="align: right;"><small>Generated on Fri Oct 8 20:34:47 2004 for LibOFX by
207
<a href="http://www.doxygen.org/index.html">
208
<img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.7 </small></address>