File: ofx__containers__misc_8cpp-source.html

package info (click to toggle)
libofx 1%3A0.9.0-3
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 9,864 kB
  • ctags: 31,331
  • sloc: sh: 8,861; cpp: 5,714; ansic: 2,524; makefile: 204; xml: 61
file content (184 lines) | stat: -rw-r--r-- 28,214 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>LibOFX: ofx_containers_misc.cpp Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
    <li class="current"><a href="files.html"><span>Files</span></a></li>
  </ul>
</div>
<h1>ofx_containers_misc.cpp</h1><a href="ofx__containers__misc_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/***************************************************************************</span>
<a name="l00002"></a>00002 <span class="comment">         ofx_proc_rs.cpp </span>
<a name="l00003"></a>00003 <span class="comment">                             -------------------</span>
<a name="l00004"></a>00004 <span class="comment">    copyright            : (C) 2002 by Benoit Grégoire</span>
<a name="l00005"></a>00005 <span class="comment">    email                : bock@step.polymtl.ca</span>
<a name="l00006"></a>00006 <span class="comment">***************************************************************************/</span>
<a name="l00013"></a>00013 <span class="comment">/***************************************************************************</span>
<a name="l00014"></a>00014 <span class="comment"> *                                                                         *</span>
<a name="l00015"></a>00015 <span class="comment"> *   This program is free software; you can redistribute it and/or modify  *</span>
<a name="l00016"></a>00016 <span class="comment"> *   it under the terms of the GNU General Public License as published by  *</span>
<a name="l00017"></a>00017 <span class="comment"> *   the Free Software Foundation; either version 2 of the License, or     *</span>
<a name="l00018"></a>00018 <span class="comment"> *   (at your option) any later version.                                   *</span>
<a name="l00019"></a>00019 <span class="comment"> *                                                                         *</span>
<a name="l00020"></a>00020 <span class="comment"> ***************************************************************************/</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">#include &lt;config.h&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#endif</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include "<a class="code" href="messages_8hh.html" title="Message IO functionality.">messages.hh</a>"</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include "<a class="code" href="libofx-0_89_80_2inc_2libofx_8h.html" title="Main header file containing the LibOfx API.">libofx.h</a>"</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="ofx__error__msg_8hh.html" title="OFX error code management functionnality.">ofx_error_msg.hh</a>"</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include "<a class="code" href="ofx__utilities_8hh.html" title="Various simple functions for type conversion &amp;amp; al.">ofx_utilities.hh</a>"</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include "<a class="code" href="ofx__containers_8hh.html" title="LibOFX internal object code.">ofx_containers.hh</a>"</span>
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="keyword">extern</span> <a class="code" href="classOfxMainContainer.html" title="The root container. Created by the &amp;lt;OFX&amp;gt; OFX element or by the export functions...">OfxMainContainer</a> * <a class="code" href="ofc__sgml_8cpp.html#759a7d80c051f4f1adc2abae56002100">MainContainer</a>;
<a name="l00036"></a>00036 
<a name="l00037"></a>00037 <span class="comment">/***************************************************************************</span>
<a name="l00038"></a>00038 <span class="comment"> *                         OfxDummyContainer                               *</span>
<a name="l00039"></a>00039 <span class="comment"> ***************************************************************************/</span>
<a name="l00040"></a>00040 
<a name="l00041"></a><a class="code" href="classOfxDummyContainer.html#b28080b768be9d5d36d8b7791591bbcd">00041</a> <a class="code" href="classOfxDummyContainer.html#b28080b768be9d5d36d8b7791591bbcd">OfxDummyContainer::OfxDummyContainer</a>(<a class="code" href="classLibofxContext.html">LibofxContext</a> *p_libofx_context, <a class="code" href="classOfxGenericContainer.html" title="A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer...">OfxGenericContainer</a> *para_parentcontainer, <span class="keywordtype">string</span> para_tag_identifier):
<a name="l00042"></a>00042   <a class="code" href="classOfxGenericContainer.html" title="A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer...">OfxGenericContainer</a>(p_libofx_context, para_parentcontainer, para_tag_identifier)
<a name="l00043"></a>00043 {
<a name="l00044"></a>00044   <a class="code" href="classOfxGenericContainer.html#2cad6fe32c79d320b8808d1e88b4e18a">type</a>=<span class="stringliteral">"DUMMY"</span>;
<a name="l00045"></a>00045   <a class="code" href="messages_8cpp.html#6af6947c1ec6fcbefd793f80c26d90fa" title="Message output function.">message_out</a>(<a class="code" href="messages_8hh.html#7cd03dafa59895bc306bf220b7b85f69748005382152808a72b1a9177d9dc806">INFO</a>, <span class="stringliteral">"Created OfxDummyContainer to hold unsupported aggregate "</span>+para_tag_identifier);
<a name="l00046"></a>00046 }
<a name="l00047"></a><a class="code" href="classOfxDummyContainer.html#20a4287788197b0a787d94d450b85db3">00047</a> <span class="keywordtype">void</span> <a class="code" href="classOfxDummyContainer.html#20a4287788197b0a787d94d450b85db3" title="Add data to a container object.">OfxDummyContainer::add_attribute</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> identifier, <span class="keyword">const</span> <span class="keywordtype">string</span> value)
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049   <a class="code" href="messages_8cpp.html#6af6947c1ec6fcbefd793f80c26d90fa" title="Message output function.">message_out</a>(<a class="code" href="messages_8hh.html#7cd03dafa59895bc306bf220b7b85f690593585da9181e972974c1274d8f2b4f">DEBUG</a>, <span class="stringliteral">"OfxDummyContainer for "</span>+<a class="code" href="classOfxGenericContainer.html#2594ccb63eaf769a6b4b5d224411f031">tag_identifier</a>+<span class="stringliteral">" ignored a "</span>+identifier+<span class="stringliteral">" ("</span>+value+<span class="stringliteral">")"</span>);
<a name="l00050"></a>00050 }
<a name="l00051"></a>00051 
<a name="l00052"></a>00052 <span class="comment">/***************************************************************************</span>
<a name="l00053"></a>00053 <span class="comment"> *                         OfxPushUpContainer                              *</span>
<a name="l00054"></a>00054 <span class="comment"> ***************************************************************************/</span>
<a name="l00055"></a>00055 
<a name="l00056"></a><a class="code" href="classOfxPushUpContainer.html#1fa2e01710b00ce7bdb80d5c9fbb3d2c">00056</a> <a class="code" href="classOfxPushUpContainer.html#1fa2e01710b00ce7bdb80d5c9fbb3d2c">OfxPushUpContainer::OfxPushUpContainer</a>(<a class="code" href="classLibofxContext.html">LibofxContext</a> *p_libofx_context, <a class="code" href="classOfxGenericContainer.html" title="A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer...">OfxGenericContainer</a> *para_parentcontainer, <span class="keywordtype">string</span> para_tag_identifier):
<a name="l00057"></a>00057   <a class="code" href="classOfxGenericContainer.html" title="A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer...">OfxGenericContainer</a>(p_libofx_context, para_parentcontainer, para_tag_identifier)
<a name="l00058"></a>00058 {
<a name="l00059"></a>00059   <a class="code" href="classOfxGenericContainer.html#2cad6fe32c79d320b8808d1e88b4e18a">type</a>=<span class="stringliteral">"PUSHUP"</span>;
<a name="l00060"></a>00060   <a class="code" href="messages_8cpp.html#6af6947c1ec6fcbefd793f80c26d90fa" title="Message output function.">message_out</a>(<a class="code" href="messages_8hh.html#7cd03dafa59895bc306bf220b7b85f690593585da9181e972974c1274d8f2b4f">DEBUG</a>, <span class="stringliteral">"Created OfxPushUpContainer to hold aggregate "</span>+<a class="code" href="classOfxGenericContainer.html#2594ccb63eaf769a6b4b5d224411f031">tag_identifier</a>);
<a name="l00061"></a>00061 }
<a name="l00062"></a><a class="code" href="classOfxPushUpContainer.html#192a69d44555a22ad7e8cb16d7db53f8">00062</a> <span class="keywordtype">void</span> <a class="code" href="classOfxPushUpContainer.html#192a69d44555a22ad7e8cb16d7db53f8" title="Add data to a container object.">OfxPushUpContainer::add_attribute</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> identifier, <span class="keyword">const</span> <span class="keywordtype">string</span> value)
<a name="l00063"></a>00063 {
<a name="l00064"></a>00064   <span class="comment">//message_out(DEBUG, "OfxPushUpContainer for "+tag_identifier+" will push up a "+identifier+" ("+value+") to a "+ parentcontainer-&gt;type + " container");</span>
<a name="l00065"></a>00065   <a class="code" href="classOfxGenericContainer.html#ff401a93eb35ca34b1e028dab30887ba">parentcontainer</a>-&gt;<a class="code" href="classOfxGenericContainer.html#6168716a931dc8e74bcb534fdadaf778" title="Add data to a container object.">add_attribute</a>(identifier, value);
<a name="l00066"></a>00066 }
<a name="l00067"></a>00067 
<a name="l00068"></a>00068 <span class="comment">/***************************************************************************</span>
<a name="l00069"></a>00069 <span class="comment"> *                         OfxStatusContainer                              *</span>
<a name="l00070"></a>00070 <span class="comment"> ***************************************************************************/</span>
<a name="l00071"></a>00071 
<a name="l00072"></a><a class="code" href="classOfxStatusContainer.html#5c46c8df8db712f6ad37b49fd6af5dc0">00072</a> <a class="code" href="classOfxStatusContainer.html#5c46c8df8db712f6ad37b49fd6af5dc0">OfxStatusContainer::OfxStatusContainer</a>(<a class="code" href="classLibofxContext.html">LibofxContext</a> *p_libofx_context, <a class="code" href="classOfxGenericContainer.html" title="A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer...">OfxGenericContainer</a> *para_parentcontainer, <span class="keywordtype">string</span> para_tag_identifier):
<a name="l00073"></a>00073   <a class="code" href="classOfxGenericContainer.html" title="A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer...">OfxGenericContainer</a>(p_libofx_context, para_parentcontainer, para_tag_identifier)
<a name="l00074"></a>00074 {
<a name="l00075"></a>00075   memset(&amp;<a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>,0,<span class="keyword">sizeof</span>(<a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>));
<a name="l00076"></a>00076   <a class="code" href="classOfxGenericContainer.html#2cad6fe32c79d320b8808d1e88b4e18a">type</a>=<span class="stringliteral">"STATUS"</span>;
<a name="l00077"></a>00077   <span class="keywordflow">if</span> (<a class="code" href="classOfxGenericContainer.html#ff401a93eb35ca34b1e028dab30887ba">parentcontainer</a>!=NULL){
<a name="l00078"></a>00078     strncpy(<a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>.<a class="code" href="structOfxStatusData.html#d49b449f9d4bf1746d71728cd1f5b925">ofx_element_name</a>, <a class="code" href="classOfxGenericContainer.html#ff401a93eb35ca34b1e028dab30887ba">parentcontainer</a>-&gt;<a class="code" href="classOfxGenericContainer.html#2594ccb63eaf769a6b4b5d224411f031">tag_identifier</a>.c_str(), <a class="code" href="inc_2libofx_8h.html#5ed330c0afc0b111a5da321dc40b226e">OFX_ELEMENT_NAME_LENGTH</a>);
<a name="l00079"></a>00079     <a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>.<a class="code" href="structOfxStatusData.html#011f73b45f88aac63ec44727ed6b306d">ofx_element_name_valid</a>=<span class="keyword">true</span>;
<a name="l00080"></a>00080   }
<a name="l00081"></a>00081   
<a name="l00082"></a>00082 }
<a name="l00083"></a><a class="code" href="classOfxStatusContainer.html#cedeebfa681e9b075c8168196752c2a8">00083</a> <a class="code" href="classOfxStatusContainer.html#cedeebfa681e9b075c8168196752c2a8">OfxStatusContainer::~OfxStatusContainer</a>()
<a name="l00084"></a>00084 {
<a name="l00085"></a>00085   <a class="code" href="messages_8cpp.html#6af6947c1ec6fcbefd793f80c26d90fa" title="Message output function.">message_out</a>(<a class="code" href="messages_8hh.html#7cd03dafa59895bc306bf220b7b85f690593585da9181e972974c1274d8f2b4f">DEBUG</a>,<span class="stringliteral">"Entering the status's container's destructor"</span>);
<a name="l00086"></a>00086         
<a name="l00087"></a>00087   <a class="code" href="classOfxGenericContainer.html#a2d199f4cd2a723ea2c935e83fbc340d">libofx_context</a>-&gt;<a class="code" href="classLibofxContext.html#97356a19c06c5609a9dc228286493db3">statusCallback</a>(<a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>);
<a name="l00088"></a>00088 
<a name="l00089"></a>00089   <span class="keywordflow">if</span> ( <a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>.<a class="code" href="structOfxStatusData.html#b07b45a40bc313455c998b5566e605d3">server_message_valid</a> )
<a name="l00090"></a>00090     <span class="keyword">delete</span> [] <a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>.<a class="code" href="structOfxStatusData.html#87b34b7c11d62409761aa24a5f43e393">server_message</a>;
<a name="l00091"></a>00091 }
<a name="l00092"></a>00092 
<a name="l00093"></a><a class="code" href="classOfxStatusContainer.html#eb1155c63fdbe5a6c5d46b891e3bb483">00093</a> <span class="keywordtype">void</span> <a class="code" href="classOfxStatusContainer.html#eb1155c63fdbe5a6c5d46b891e3bb483" title="Add data to a container object.">OfxStatusContainer::add_attribute</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> identifier, <span class="keyword">const</span> <span class="keywordtype">string</span> value)
<a name="l00094"></a>00094 {
<a name="l00095"></a>00095   <a class="code" href="structErrorMsg.html" title="An abstraction of an OFX error code sent by an OFX server.">ErrorMsg</a> error_msg;
<a name="l00096"></a>00096 
<a name="l00097"></a>00097   <span class="keywordflow">if</span>( identifier==<span class="stringliteral">"CODE"</span>){
<a name="l00098"></a>00098     <a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>.<a class="code" href="structOfxStatusData.html#7c331e4729b921be2eaf234498ffe19c">code</a>=atoi(value.c_str());
<a name="l00099"></a>00099     error_msg = <a class="code" href="ofx__error__msg_8hh.html#dac162b52803cc0814b829813ad3a5aa" title="Retreive error code descriptions.">find_error_msg</a>(<a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>.<a class="code" href="structOfxStatusData.html#7c331e4729b921be2eaf234498ffe19c">code</a>);
<a name="l00100"></a>00100     <a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>.<a class="code" href="structOfxStatusData.html#e68c2b035377d22d01f89179fc14fdbe">name</a> = error_msg.name;<span class="comment">//memory is already allocated</span>
<a name="l00101"></a>00101     <a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>.<a class="code" href="structOfxStatusData.html#bed5e1b74714010d7d6c313ef04e5961">description</a> = error_msg.description;<span class="comment">//memory is already allocated</span>
<a name="l00102"></a>00102     <a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>.<a class="code" href="structOfxStatusData.html#ea08b7a14fa90d26ef192fab683e09d1">code_valid</a> = <span class="keyword">true</span>;
<a name="l00103"></a>00103   }
<a name="l00104"></a>00104   <span class="keywordflow">else</span> <span class="keywordflow">if</span>(identifier==<span class="stringliteral">"SEVERITY"</span>){
<a name="l00105"></a>00105     <a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>.<a class="code" href="structOfxStatusData.html#de9a52735f94e5c9966492fde9e35d04">severity_valid</a> = <span class="keyword">true</span>;
<a name="l00106"></a>00106     <span class="keywordflow">if</span>(value==<span class="stringliteral">"INFO"</span>) {
<a name="l00107"></a>00107       <a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>.<a class="code" href="structOfxStatusData.html#b6842e66b77fd7ade801b2bae60cba38">severity</a>=<a class="code" href="structOfxStatusData.html#9e9ac7b5db3c10f2f42cc0225a016187607c1edcec0561c65dda6055bdd970c0">OfxStatusData::INFO</a>;
<a name="l00108"></a>00108     }
<a name="l00109"></a>00109     <span class="keywordflow">else</span> <span class="keywordflow">if</span>(value==<span class="stringliteral">"WARN"</span>) {
<a name="l00110"></a>00110       <a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>.<a class="code" href="structOfxStatusData.html#b6842e66b77fd7ade801b2bae60cba38">severity</a>=<a class="code" href="structOfxStatusData.html#9e9ac7b5db3c10f2f42cc0225a016187d567eb2fcd64f55542fa48802b2e43d8">OfxStatusData::WARN</a>;
<a name="l00111"></a>00111     }
<a name="l00112"></a>00112     <span class="keywordflow">else</span> <span class="keywordflow">if</span>(value==<span class="stringliteral">"ERROR"</span>) {
<a name="l00113"></a>00113       <a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>.<a class="code" href="structOfxStatusData.html#b6842e66b77fd7ade801b2bae60cba38">severity</a>=<a class="code" href="structOfxStatusData.html#9e9ac7b5db3c10f2f42cc0225a01618738b731d21638db06ec36499e258c9cbb">OfxStatusData::ERROR</a>;
<a name="l00114"></a>00114     }
<a name="l00115"></a>00115     <span class="keywordflow">else</span>{
<a name="l00116"></a>00116       <a class="code" href="messages_8cpp.html#6af6947c1ec6fcbefd793f80c26d90fa" title="Message output function.">message_out</a>(<a class="code" href="messages_8hh.html#7cd03dafa59895bc306bf220b7b85f692fd6f336d08340583bd620a7f5694c90">ERROR</a>, <span class="stringliteral">"WRITEME: Unknown severity "</span>+value+<span class="stringliteral">" inside a "</span>+<a class="code" href="classOfxGenericContainer.html#2cad6fe32c79d320b8808d1e88b4e18a">type</a>+<span class="stringliteral">" container"</span>);
<a name="l00117"></a>00117       <a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>.<a class="code" href="structOfxStatusData.html#de9a52735f94e5c9966492fde9e35d04">severity_valid</a> = <span class="keyword">false</span>;
<a name="l00118"></a>00118     }
<a name="l00119"></a>00119   }
<a name="l00120"></a>00120   <span class="keywordflow">else</span> <span class="keywordflow">if</span>((identifier==<span class="stringliteral">"MESSAGE"</span>)||(identifier==<span class="stringliteral">"MESSAGE2"</span>)){
<a name="l00121"></a>00121     <a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>.<a class="code" href="structOfxStatusData.html#87b34b7c11d62409761aa24a5f43e393">server_message</a>=<span class="keyword">new</span> <span class="keywordtype">char</span>[value.length()+1];
<a name="l00122"></a>00122     strcpy(<a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>.<a class="code" href="structOfxStatusData.html#87b34b7c11d62409761aa24a5f43e393">server_message</a>,value.c_str());
<a name="l00123"></a>00123     <a class="code" href="classOfxStatusContainer.html#a840ebd1b3ce1aeecdcae7b92a988e38">data</a>.<a class="code" href="structOfxStatusData.html#b07b45a40bc313455c998b5566e605d3">server_message_valid</a>=<span class="keyword">true</span>;
<a name="l00124"></a>00124   }
<a name="l00125"></a>00125   <span class="keywordflow">else</span>{
<a name="l00126"></a>00126     <span class="comment">/* Redirect unknown identifiers to the base class */</span>
<a name="l00127"></a>00127     <a class="code" href="classOfxGenericContainer.html#6168716a931dc8e74bcb534fdadaf778" title="Add data to a container object.">OfxGenericContainer::add_attribute</a>(identifier, value);
<a name="l00128"></a>00128   }
<a name="l00129"></a>00129 }
<a name="l00130"></a>00130 
<a name="l00131"></a>00131 
<a name="l00132"></a>00132 
<a name="l00133"></a>00133 <span class="comment">/***************************************************************************</span>
<a name="l00134"></a>00134 <span class="comment"> * OfxBalanceContainer  (does not directly abstract a object in libofx.h)  *</span>
<a name="l00135"></a>00135 <span class="comment"> ***************************************************************************/</span>
<a name="l00136"></a>00136 
<a name="l00137"></a><a class="code" href="classOfxBalanceContainer.html#96baefa68988c2d9c2f46f553d40599f">00137</a> <a class="code" href="classOfxBalanceContainer.html#96baefa68988c2d9c2f46f553d40599f">OfxBalanceContainer::OfxBalanceContainer</a>(<a class="code" href="classLibofxContext.html">LibofxContext</a> *p_libofx_context, <a class="code" href="classOfxGenericContainer.html" title="A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer...">OfxGenericContainer</a> *para_parentcontainer, <span class="keywordtype">string</span> para_tag_identifier):
<a name="l00138"></a>00138   <a class="code" href="classOfxGenericContainer.html" title="A generic container for an OFX SGML element. Every container inherits from OfxGenericContainer...">OfxGenericContainer</a>(p_libofx_context, para_parentcontainer, para_tag_identifier)
<a name="l00139"></a>00139 {
<a name="l00140"></a>00140   <a class="code" href="classOfxBalanceContainer.html#8ec139f87dfed172199cae86c4441c34">amount_valid</a>=<span class="keyword">false</span>;
<a name="l00141"></a>00141   <a class="code" href="classOfxBalanceContainer.html#63784a0db798c12aede0e3ff54888916">date_valid</a>=<span class="keyword">false</span>;
<a name="l00142"></a>00142   <a class="code" href="classOfxGenericContainer.html#2cad6fe32c79d320b8808d1e88b4e18a">type</a>=<span class="stringliteral">"BALANCE"</span>;
<a name="l00143"></a>00143 }
<a name="l00144"></a>00144 
<a name="l00145"></a><a class="code" href="classOfxBalanceContainer.html#db4feb10b8e5328aab5025ff49fd43f5">00145</a> <a class="code" href="classOfxBalanceContainer.html#db4feb10b8e5328aab5025ff49fd43f5">OfxBalanceContainer::~OfxBalanceContainer</a>()
<a name="l00146"></a>00146 {
<a name="l00147"></a>00147   <span class="keywordflow">if</span> (<a class="code" href="classOfxGenericContainer.html#ff401a93eb35ca34b1e028dab30887ba">parentcontainer</a>-&gt;<a class="code" href="classOfxGenericContainer.html#2cad6fe32c79d320b8808d1e88b4e18a">type</a> == <span class="stringliteral">"STATEMENT"</span>)
<a name="l00148"></a>00148     {
<a name="l00149"></a>00149       ((<a class="code" href="classOfxStatementContainer.html" title="Represents a statement for either a bank account or a credit card account.">OfxStatementContainer</a>*)<a class="code" href="classOfxGenericContainer.html#ff401a93eb35ca34b1e028dab30887ba">parentcontainer</a>)-&gt;add_balance(<span class="keyword">this</span>);
<a name="l00150"></a>00150     }
<a name="l00151"></a>00151   <span class="keywordflow">else</span>
<a name="l00152"></a>00152     {
<a name="l00153"></a>00153       <a class="code" href="messages_8cpp.html#6af6947c1ec6fcbefd793f80c26d90fa" title="Message output function.">message_out</a> (<a class="code" href="messages_8hh.html#7cd03dafa59895bc306bf220b7b85f692fd6f336d08340583bd620a7f5694c90">ERROR</a>,<span class="stringliteral">"I completed a "</span> + <a class="code" href="classOfxGenericContainer.html#2cad6fe32c79d320b8808d1e88b4e18a">type</a> + <span class="stringliteral">" element, but I havent found a suitable parent to save it"</span>);
<a name="l00154"></a>00154     }
<a name="l00155"></a>00155 }
<a name="l00156"></a><a class="code" href="classOfxBalanceContainer.html#85951ca6d29aeace59a9ca86453e8abb">00156</a> <span class="keywordtype">void</span> <a class="code" href="classOfxBalanceContainer.html#85951ca6d29aeace59a9ca86453e8abb" title="Add data to a container object.">OfxBalanceContainer::add_attribute</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> identifier, <span class="keyword">const</span> <span class="keywordtype">string</span> value)
<a name="l00157"></a>00157 {
<a name="l00158"></a>00158   <span class="keywordflow">if</span>(identifier==<span class="stringliteral">"BALAMT"</span>){
<a name="l00159"></a>00159     <a class="code" href="classOfxBalanceContainer.html#fff1080e7dc3a6f6e09f1c0d9c1dc68f">amount</a>=<a class="code" href="ofx__utilities_8cpp.html#bfca5b423e5d7b194eb53c53f706f6ba" title="Convert OFX amount of money to double float.">ofxamount_to_double</a>(value);
<a name="l00160"></a>00160     <a class="code" href="classOfxBalanceContainer.html#8ec139f87dfed172199cae86c4441c34">amount_valid</a>=<span class="keyword">true</span>;
<a name="l00161"></a>00161   }
<a name="l00162"></a>00162   <span class="keywordflow">else</span> <span class="keywordflow">if</span>(identifier==<span class="stringliteral">"DTASOF"</span>){
<a name="l00163"></a>00163     <a class="code" href="classOfxBalanceContainer.html#63069560ec9ee3524688452b00f0a39d">date</a> = <a class="code" href="ofx__utilities_8cpp.html#5fdbbc08f8d80a534f8db03d25316d7a" title="Convert a C++ string containing a time in OFX format to a C time_t.">ofxdate_to_time_t</a>(value);
<a name="l00164"></a>00164     <a class="code" href="classOfxBalanceContainer.html#63784a0db798c12aede0e3ff54888916">date_valid</a> = <span class="keyword">true</span>;
<a name="l00165"></a>00165   }
<a name="l00166"></a>00166   <span class="keywordflow">else</span>{
<a name="l00167"></a>00167     <span class="comment">/* Redirect unknown identifiers to the base class */</span>
<a name="l00168"></a>00168     <a class="code" href="classOfxGenericContainer.html#6168716a931dc8e74bcb534fdadaf778" title="Add data to a container object.">OfxGenericContainer::add_attribute</a>(identifier, value);
<a name="l00169"></a>00169   }  
<a name="l00170"></a>00170 }
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Mon Nov 19 20:27:59 2007 for LibOFX by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
</body>
</html>