~ubuntu-branches/ubuntu/natty/libofx/natty

« back to all changes in this revision

Viewing changes to doc/html/ofx__sgml_8cpp-source.html

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Bushnell, BSG
  • Date: 2005-11-29 00:12:00 UTC
  • mfrom: (1.2.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051129001200-aplj8zbj80f68xby
Tags: 1:0.8.0-9
Generate autotools using Debian libtool (rerun libtoolize --copy
--force, aclocal-1.9, autoconf). (Closes: #341190)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
<title>LibOFX: ofx_sgml.cpp Source File</title>
4
4
<link href="doxygen.css" rel="stylesheet" type="text/css">
5
5
</head><body>
6
 
<!-- Generated by Doxygen 1.3.7 -->
 
6
<!-- Generated by Doxygen 1.3.9.1 -->
7
7
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
8
 
<h1>ofx_sgml.cpp</h1><a href="ofx__sgml_8cpp.html">Go to the documentation of this file.</a><pre class="fragment"><div>00001 <span class="comment">/***************************************************************************</span>
 
8
<div class="nav">
 
9
<a class="el" href="dir_000002.html">lib</a></div>
 
10
<h1>ofx_sgml.cpp</h1><a href="ofx__sgml_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/***************************************************************************</span>
9
11
00002 <span class="comment">                          ofx_sgml.cpp</span>
10
12
00003 <span class="comment">                          -------------------</span>
11
13
00004 <span class="comment">    copyright            : (C) 2002 by Benoit Gr�goire</span>
28
30
00026 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
29
31
00027 <span class="preprocessor">#include &lt;string&gt;</span>
30
32
00028 <span class="preprocessor">#include "ParserEventGeneratorKit.h"</span>
31
 
00029 <span class="preprocessor">#include "<a class="code" href="libofx-0_87_80_2inc_2libofx_8h.html">libofx.h</a>"</span>
 
33
00029 <span class="preprocessor">#include "<a class="code" href="libofx-0_88_80_2inc_2libofx_8h.html">libofx.h</a>"</span>
32
34
00030 <span class="preprocessor">#include "<a class="code" href="ofx__utilities_8hh.html">ofx_utilities.hh</a>"</span>
33
35
00031 <span class="preprocessor">#include "<a class="code" href="messages_8hh.html">messages.hh</a>"</span>
34
36
00032 <span class="preprocessor">#include "<a class="code" href="ofx__containers_8hh.html">ofx_containers.hh</a>"</span>
37
39
00035 <span class="keyword">using</span> <span class="keyword">namespace </span>std;
38
40
00036 
39
41
00037 <a class="code" href="classOfxMainContainer.html">OfxMainContainer</a> * MainContainer = NULL;
40
 
<a name="l00038"></a><a class="code" href="ofx__sgml_8cpp.html#a1">00038</a> <span class="keyword">extern</span> SGMLApplication::OpenEntityPtr <a class="code" href="messages_8cpp.html#a0">entity_ptr</a>;
41
 
<a name="l00039"></a><a class="code" href="ofx__sgml_8cpp.html#a2">00039</a> <span class="keyword">extern</span> SGMLApplication::Position <a class="code" href="messages_8cpp.html#a1">position</a>;
 
42
00038 <span class="keyword">extern</span> SGMLApplication::OpenEntityPtr entity_ptr;
 
43
00039 <span class="keyword">extern</span> SGMLApplication::Position position;
42
44
00040 
43
45
00041 
44
46
<a name="l00044"></a><a class="code" href="classOFXApplication.html">00044</a> <span class="keyword">class </span><a class="code" href="classOFXApplication.html">OFXApplication</a> : <span class="keyword">public</span> SGMLApplication
63
65
<a name="l00067"></a><a class="code" href="classOFXApplication.html#a1">00067</a>   <span class="keywordtype">void</span> <a class="code" href="classOFXApplication.html#a1">startElement</a> (<span class="keyword">const</span> StartElementEvent &amp; event)
64
66
00068   {
65
67
00069     string identifier;
66
 
00070     <a class="code" href="fx-0_87_80_2lib_2ofx__utilities_8hh.html#a2">CharStringtostring</a> (event.gi, identifier);
67
 
00071     <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a10">PARSER</a>,<span class="stringliteral">"startElement event received from OpenSP for element "</span> + identifier);
 
68
00070     <a class="code" href="fx-0_88_80_2lib_2ofx__utilities_8hh.html#a2">CharStringtostring</a> (event.gi, identifier);
 
69
00071     <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a10">PARSER</a>,<span class="stringliteral">"startElement event received from OpenSP for element "</span> + identifier);
68
70
00072     
69
71
00073     <a class="code" href="messages_8cpp.html#a1">position</a> = event.pos;
70
72
00074 
71
73
00075     <span class="keywordflow">switch</span> (event.contentType)
72
74
00076       {
73
 
00077       <span class="keywordflow">case</span> StartElementEvent::empty:    <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a9">ERROR</a>,<span class="stringliteral">"StartElementEvent::empty\n"</span>);
 
75
00077       <span class="keywordflow">case</span> StartElementEvent::empty:    <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a9">ERROR</a>,<span class="stringliteral">"StartElementEvent::empty\n"</span>);
74
76
00078         <span class="keywordflow">break</span>;
75
 
00079       <span class="keywordflow">case</span> StartElementEvent::cdata:    <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a9">ERROR</a>,<span class="stringliteral">"StartElementEvent::cdata\n"</span>);
 
77
00079       <span class="keywordflow">case</span> StartElementEvent::cdata:    <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a9">ERROR</a>,<span class="stringliteral">"StartElementEvent::cdata\n"</span>);
76
78
00080         <span class="keywordflow">break</span>;
77
 
00081       <span class="keywordflow">case</span> StartElementEvent::rcdata:   <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a9">ERROR</a>,<span class="stringliteral">"StartElementEvent::rcdata\n"</span>);
 
79
00081       <span class="keywordflow">case</span> StartElementEvent::rcdata:   <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a9">ERROR</a>,<span class="stringliteral">"StartElementEvent::rcdata\n"</span>);
78
80
00082         <span class="keywordflow">break</span>;
79
 
00083       <span class="keywordflow">case</span> StartElementEvent::mixed:    <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a10">PARSER</a>,<span class="stringliteral">"StartElementEvent::mixed"</span>);
 
81
00083       <span class="keywordflow">case</span> StartElementEvent::mixed:    <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a10">PARSER</a>,<span class="stringliteral">"StartElementEvent::mixed"</span>);
80
82
00084         is_data_element = <span class="keyword">true</span>;
81
83
00085         <span class="keywordflow">break</span>;
82
 
00086       <span class="keywordflow">case</span> StartElementEvent::element:  <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a10">PARSER</a>,<span class="stringliteral">"StartElementEvent::element"</span>);
 
84
00086       <span class="keywordflow">case</span> StartElementEvent::element:  <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a10">PARSER</a>,<span class="stringliteral">"StartElementEvent::element"</span>);
83
85
00087         is_data_element = <span class="keyword">false</span>;
84
86
00088         <span class="keywordflow">break</span>;
85
87
00089       <span class="keywordflow">default</span>:
86
 
00090         <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a9">ERROR</a>,<span class="stringliteral">"Unknow SGML content type?!?!?!? OpenSP interface changed?"</span>);
 
88
00090         <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a9">ERROR</a>,<span class="stringliteral">"Unknow SGML content type?!?!?!? OpenSP interface changed?"</span>);
87
89
00091       }
88
90
00092     
89
91
00093     <span class="keywordflow">if</span> (is_data_element == <span class="keyword">false</span>)
92
94
00096 
93
95
00097         <span class="keywordflow">if</span> (identifier == <span class="stringliteral">"OFX"</span>)
94
96
00098           {
95
 
00099             <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
 
97
00099             <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
96
98
00100             MainContainer = <span class="keyword">new</span> <a class="code" href="classOfxMainContainer.html">OfxMainContainer</a> (libofx_context, curr_container_element, identifier);
97
99
00101             curr_container_element = MainContainer;
98
100
00102           }
99
101
00103         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (identifier == <span class="stringliteral">"STATUS"</span>)
100
102
00104           {
101
 
00105             <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
 
103
00105             <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
102
104
00106             curr_container_element = <span class="keyword">new</span> <a class="code" href="classOfxStatusContainer.html">OfxStatusContainer</a> (libofx_context, curr_container_element, identifier);
103
105
00107           }
104
106
00108         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (identifier == <span class="stringliteral">"STMTRS"</span> ||
105
107
00109                  identifier == <span class="stringliteral">"CCSTMTRS"</span> ||
106
108
00110                  identifier == <span class="stringliteral">"INVSTMTRS"</span>)
107
109
00111           {
108
 
00112             <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
 
110
00112             <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
109
111
00113             curr_container_element = <span class="keyword">new</span> <a class="code" href="classOfxStatementContainer.html">OfxStatementContainer</a> (libofx_context, curr_container_element, identifier);
110
112
00114           }
111
113
00115         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (identifier == <span class="stringliteral">"BANKTRANLIST"</span>)
112
114
00116           {
113
 
00117             <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
 
115
00117             <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
114
116
00118             <span class="comment">//BANKTRANLIST ignored, we will process it's attributes directly inside the STATEMENT,</span>
115
117
00119             <span class="keywordflow">if</span>(curr_container_element-&gt;<a class="code" href="classOfxGenericContainer.html#o0">type</a>!=<span class="stringliteral">"STATEMENT"</span>)
116
118
00120               {
117
 
00121                 <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a9">ERROR</a>,<span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found while not inside a STATEMENT container"</span>);
 
119
00121                 <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a9">ERROR</a>,<span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found while not inside a STATEMENT container"</span>);
118
120
00122               }
119
121
00123             <span class="keywordflow">else</span>
120
122
00124               {
123
125
00127           }
124
126
00128         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (identifier == <span class="stringliteral">"STMTTRN"</span>)
125
127
00129           {
126
 
00130             <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
 
128
00130             <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
127
129
00131             curr_container_element = <span class="keyword">new</span> <a class="code" href="classOfxBankTransactionContainer.html">OfxBankTransactionContainer</a> (libofx_context, curr_container_element, identifier);
128
130
00132           }
129
131
00133         <span class="keywordflow">else</span> <span class="keywordflow">if</span>(identifier == <span class="stringliteral">"BUYDEBT"</span> ||
147
149
00151                 identifier == <span class="stringliteral">"SPLIT"</span> ||
148
150
00152                 identifier == <span class="stringliteral">"TRANSFER"</span> )
149
151
00153           {
150
 
00154             <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
 
152
00154             <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
151
153
00155             curr_container_element = <span class="keyword">new</span> <a class="code" href="classOfxInvestmentTransactionContainer.html">OfxInvestmentTransactionContainer</a> (libofx_context, curr_container_element, identifier);
152
154
00156           }
153
155
00157         <span class="comment">/*The following is a list of OFX elements whose attributes will be processed by the parent container*/</span>
156
158
00160                  identifier == <span class="stringliteral">"INVTRAN"</span> ||
157
159
00161                  identifier == <span class="stringliteral">"SECID"</span>)
158
160
00162           {
159
 
00163             <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
 
161
00163             <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
160
162
00164             curr_container_element = <span class="keyword">new</span> <a class="code" href="classOfxPushUpContainer.html">OfxPushUpContainer</a> (libofx_context, curr_container_element, identifier);
161
163
00165           }
162
164
00166 
163
165
00167         <span class="comment">/* The different types of accounts */</span>
164
166
00168         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (identifier == <span class="stringliteral">"BANKACCTFROM"</span> || identifier == <span class="stringliteral">"CCACCTFROM"</span> || identifier == <span class="stringliteral">"INVACCTFROM"</span>)
165
167
00169           {
166
 
00170             <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
 
168
00170             <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
167
169
00171             curr_container_element = <span class="keyword">new</span> <a class="code" href="classOfxAccountContainer.html">OfxAccountContainer</a> (libofx_context, curr_container_element, identifier);
168
170
00172           }
169
171
00173         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (identifier == <span class="stringliteral">"SECINFO"</span>)
170
172
00174           {
171
 
00175             <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
 
173
00175             <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
172
174
00176             curr_container_element = <span class="keyword">new</span> <a class="code" href="classOfxSecurityContainer.html">OfxSecurityContainer</a> (libofx_context, curr_container_element, identifier);
173
175
00177           }
174
176
00178         <span class="comment">/* The different types of balances */</span>
175
177
00179         <span class="keywordflow">else</span> <span class="keywordflow">if</span> (identifier == <span class="stringliteral">"LEDGERBAL"</span> || identifier == <span class="stringliteral">"AVAILBAL"</span>)
176
178
00180           {
177
 
00181             <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
 
179
00181             <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" found"</span>);
178
180
00182             curr_container_element = <span class="keyword">new</span> <a class="code" href="classOfxBalanceContainer.html">OfxBalanceContainer</a> (libofx_context, curr_container_element, identifier);
179
181
00183           }
180
182
00184         <span class="keywordflow">else</span>
186
188
00190     <span class="keywordflow">else</span>
187
189
00191       {
188
190
00192         <span class="comment">/* The element was a data element.  OpenSP will call one or several data() callback with the data */</span>
189
 
00193         <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Data element "</span> + identifier + <span class="stringliteral">" found"</span>);
 
191
00193         <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Data element "</span> + identifier + <span class="stringliteral">" found"</span>);
190
192
00194         <span class="comment">/* There is a bug in OpenSP 1.3.4, which won't send endElement Event for some elements, and will instead send an error like "document type does not allow element "MESSAGE" here".  Incoming_data should be empty in such a case, but it will not be if the endElement event was skiped. So we empty it, so at least the last element has a chance of having valid data */</span> 
191
193
00195         <span class="keywordflow">if</span> (incoming_data != <span class="stringliteral">""</span>)
192
194
00196           {
193
 
00197             <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a9">ERROR</a>, <span class="stringliteral">"startElement: incoming_data should be empty! You are probably using OpenSP &lt;= 1.3.4.  The folowing data was lost: "</span> + incoming_data );
 
195
00197             <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a9">ERROR</a>, <span class="stringliteral">"startElement: incoming_data should be empty! You are probably using OpenSP &lt;= 1.3.4.  The folowing data was lost: "</span> + incoming_data );
194
196
00198             incoming_data.assign (<span class="stringliteral">""</span>);
195
197
00199           }
196
198
00200       }
201
203
00209     string identifier;
202
204
00210     <span class="keywordtype">bool</span> end_element_for_data_element;
203
205
00211 
204
 
00212     <a class="code" href="fx-0_87_80_2lib_2ofx__utilities_8hh.html#a2">CharStringtostring</a> (event.gi, identifier);
 
206
00212     <a class="code" href="fx-0_88_80_2lib_2ofx__utilities_8hh.html#a2">CharStringtostring</a> (event.gi, identifier);
205
207
00213     end_element_for_data_element=is_data_element;
206
 
00214     <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a10">PARSER</a>,<span class="stringliteral">"endElement event received from OpenSP for element "</span> + identifier);
 
208
00214     <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a10">PARSER</a>,<span class="stringliteral">"endElement event received from OpenSP for element "</span> + identifier);
207
209
00215 
208
210
00216     <a class="code" href="messages_8cpp.html#a1">position</a> = event.pos;
209
211
00217     <span class="keywordflow">if</span> (curr_container_element == NULL)
210
212
00218       {
211
 
00219         <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a9">ERROR</a>,<span class="stringliteral">"Tried to close a "</span>+identifier+<span class="stringliteral">" without a open element (NULL pointer)"</span>);
 
213
00219         <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a9">ERROR</a>,<span class="stringliteral">"Tried to close a "</span>+identifier+<span class="stringliteral">" without a open element (NULL pointer)"</span>);
212
214
00220         incoming_data.assign (<span class="stringliteral">""</span>);
213
215
00221       }
214
216
00222     <span class="keywordflow">else</span> <span class="comment">//curr_container_element != NULL</span>
215
217
00223       {
216
218
00224         <span class="keywordflow">if</span> (end_element_for_data_element == <span class="keyword">true</span>)
217
219
00225           {
218
 
00226             incoming_data = <a class="code" href="fx-0_87_80_2lib_2ofx__utilities_8hh.html#a6">strip_whitespace</a>(incoming_data);
 
220
00226             incoming_data = <a class="code" href="fx-0_88_80_2lib_2ofx__utilities_8hh.html#a6">strip_whitespace</a>(incoming_data);
219
221
00227             
220
222
00228             curr_container_element-&gt;<a class="code" href="classOfxGenericContainer.html#a4">add_attribute</a> (identifier, incoming_data);
221
 
00229             <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>,<span class="stringliteral">"endElement: Added data '"</span> + incoming_data + <span class="stringliteral">"' from "</span> + identifier + <span class="stringliteral">" to "</span> + curr_container_element-&gt;<a class="code" href="classOfxGenericContainer.html#o0">type</a> + <span class="stringliteral">" container_element"</span>);
 
223
00229             <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>,<span class="stringliteral">"endElement: Added data '"</span> + incoming_data + <span class="stringliteral">"' from "</span> + identifier + <span class="stringliteral">" to "</span> + curr_container_element-&gt;<a class="code" href="classOfxGenericContainer.html#o0">type</a> + <span class="stringliteral">" container_element"</span>);
222
224
00230             incoming_data.assign (<span class="stringliteral">""</span>);
223
225
00231             is_data_element=<span class="keyword">false</span>;
224
226
00232           }
228
230
00236               {
229
231
00237                 <span class="keywordflow">if</span>(incoming_data!=<span class="stringliteral">""</span>)
230
232
00238                   {
231
 
00239                     <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a9">ERROR</a>,<span class="stringliteral">"End tag for non data element "</span>+identifier+<span class="stringliteral">", incoming data should be empty but contains: "</span>+incoming_data+<span class="stringliteral">" DATA HAS BEEN LOST SOMEWHERE!"</span>);
 
233
00239                     <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a9">ERROR</a>,<span class="stringliteral">"End tag for non data element "</span>+identifier+<span class="stringliteral">", incoming data should be empty but contains: "</span>+incoming_data+<span class="stringliteral">" DATA HAS BEEN LOST SOMEWHERE!"</span>);
232
234
00240                   }
233
235
00241 
234
236
00242                 <span class="keywordflow">if</span>(identifier == <span class="stringliteral">"OFX"</span>)
239
241
00247                     MainContainer-&gt;<a class="code" href="classOfxMainContainer.html#a7">gen_event</a>();
240
242
00248                     <span class="keyword">delete</span> MainContainer;
241
243
00249                     MainContainer = NULL;
242
 
00250                     <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a0">DEBUG</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" closed, MainContainer destroyed"</span>);
 
244
00250                     <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a0">DEBUG</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" closed, MainContainer destroyed"</span>);
243
245
00251                   }
244
246
00252                 <span class="keywordflow">else</span> 
245
247
00253                   {
248
250
00256                     <span class="keywordflow">if</span>(MainContainer != NULL)
249
251
00257                       {
250
252
00258                         tmp_container_element-&gt;<a class="code" href="classOfxGenericContainer.html#a6">add_to_main_tree</a>();
251
 
00259                         <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" closed, object added to MainContainer"</span>);
 
253
00259                         <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"Element "</span> + identifier + <span class="stringliteral">" closed, object added to MainContainer"</span>);
252
254
00260                       }
253
255
00261                     <span class="keywordflow">else</span>
254
256
00262                       {
255
 
00263                         <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a9">ERROR</a>, <span class="stringliteral">"MainContainer is NULL trying to add element "</span> + identifier);
 
257
00263                         <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a9">ERROR</a>, <span class="stringliteral">"MainContainer is NULL trying to add element "</span> + identifier);
256
258
00264                       }
257
259
00265                   }
258
260
00266               }
259
261
00267             <span class="keywordflow">else</span>
260
262
00268               {
261
 
00269                 <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a9">ERROR</a>, <span class="stringliteral">"Tried to close a "</span>+identifier+<span class="stringliteral">" but a "</span>+curr_container_element-&gt;<a class="code" href="classOfxGenericContainer.html#o0">type</a>+<span class="stringliteral">" is currently open."</span>);
 
263
00269                 <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a> (<a class="code" href="messages_8hh.html#a12a9">ERROR</a>, <span class="stringliteral">"Tried to close a "</span>+identifier+<span class="stringliteral">" but a "</span>+curr_container_element-&gt;<a class="code" href="classOfxGenericContainer.html#o0">type</a>+<span class="stringliteral">" is currently open."</span>);
262
264
00270               }
263
265
00271           }
264
266
00272       }
268
270
00280   {
269
271
00281     string tmp;
270
272
00282     <a class="code" href="messages_8cpp.html#a1">position</a> = event.pos;
271
 
00283     <a class="code" href="fx-0_87_80_2lib_2ofx__utilities_8hh.html#a3">AppendCharStringtostring</a> (event.data, incoming_data);
272
 
00284     <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"data event received from OpenSP, incoming_data is now: "</span> + incoming_data);
 
273
00283     <a class="code" href="fx-0_88_80_2lib_2ofx__utilities_8hh.html#a3">AppendCharStringtostring</a> (event.data, incoming_data);
 
274
00284     <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a10">PARSER</a>, <span class="stringliteral">"data event received from OpenSP, incoming_data is now: "</span> + incoming_data);
273
275
00285   }
274
276
00286 
275
277
<a name="l00291"></a><a class="code" href="classOFXApplication.html#a4">00291</a>   <span class="keywordtype">void</span> <a class="code" href="classOFXApplication.html#a4">error</a> (<span class="keyword">const</span> ErrorEvent &amp; event)
276
278
00292   {
277
279
00293     string message;
278
280
00294     string string_buf;
279
 
00295     <a class="code" href="messages_8hh.html#a12">OfxMsgType</a> error_type = <a class="code" href="messages_8hh.html#a12a9">ERROR</a>;
 
281
00295     <a class="code" href="messages_8hh.html#a12">OfxMsgType</a> error_type = ERROR;
280
282
00296 
281
283
00297     <a class="code" href="messages_8cpp.html#a1">position</a> = event.pos;
282
284
00298     message = message + <span class="stringliteral">"OpenSP parser: "</span>;
283
285
00299     <span class="keywordflow">switch</span> (event.type){
284
286
00300     <span class="keywordflow">case</span> SGMLApplication::ErrorEvent::quantity:
285
287
00301       message = message + <span class="stringliteral">"quantity (Exceeding a quantity limit):"</span>;
286
 
00302       error_type = <a class="code" href="messages_8hh.html#a12a9">ERROR</a>;
 
288
00302       error_type = ERROR;
287
289
00303       <span class="keywordflow">break</span>;
288
290
00304     <span class="keywordflow">case</span> SGMLApplication::ErrorEvent::idref:
289
291
00305       message = message + <span class="stringliteral">"idref (An IDREF to a non-existent ID):"</span>;
290
 
00306       error_type = <a class="code" href="messages_8hh.html#a12a9">ERROR</a>;
 
292
00306       error_type = ERROR;
291
293
00307       <span class="keywordflow">break</span>;
292
294
00308     <span class="keywordflow">case</span> SGMLApplication::ErrorEvent::capacity:
293
295
00309       message = message + <span class="stringliteral">"capacity (Exceeding a capacity limit):"</span>;
294
 
00310       error_type = <a class="code" href="messages_8hh.html#a12a9">ERROR</a>;
 
296
00310       error_type = ERROR;
295
297
00311       <span class="keywordflow">break</span>;
296
298
00312     <span class="keywordflow">case</span> SGMLApplication::ErrorEvent::otherError:
297
299
00313       message = message + <span class="stringliteral">"otherError (misc parse error):"</span>;
298
 
00314       error_type = <a class="code" href="messages_8hh.html#a12a9">ERROR</a>;
 
300
00314       error_type = ERROR;
299
301
00315       <span class="keywordflow">break</span>;
300
302
00316     <span class="keywordflow">case</span> SGMLApplication::ErrorEvent::warning:
301
303
00317       message = message + <span class="stringliteral">"warning (Not actually an error.):"</span>;
302
 
00318       error_type = <a class="code" href="messages_8hh.html#a12a8">WARNING</a>;
 
304
00318       error_type = WARNING;
303
305
00319       <span class="keywordflow">break</span>;
304
306
00320     <span class="keywordflow">case</span> SGMLApplication::ErrorEvent::info:
305
307
00321       message =  message + <span class="stringliteral">"info (An informationnal message.  Not actually an error):"</span>;
306
 
00322       error_type = <a class="code" href="messages_8hh.html#a12a7">INFO</a>;
 
308
00322       error_type = INFO;
307
309
00323       <span class="keywordflow">break</span>;
308
310
00324     <span class="keywordflow">default</span>:
309
311
00325       message = message + <span class="stringliteral">"OpenSP sent an unknown error to LibOFX (You probably have a newer version of OpenSP):"</span>;
310
312
00326     }
311
 
00327     message =   message + <span class="stringliteral">"\n"</span> + <a class="code" href="fx-0_87_80_2lib_2ofx__utilities_8hh.html#a2">CharStringtostring</a> (event.message, string_buf);
312
 
00328     <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a> (error_type, message);
 
313
00327     message =   message + <span class="stringliteral">"\n"</span> + <a class="code" href="fx-0_88_80_2lib_2ofx__utilities_8hh.html#a2">CharStringtostring</a> (event.message, string_buf);
 
314
00328     <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a> (error_type, message);
313
315
00329   }
314
316
00330 
315
317
<a name="l00335"></a><a class="code" href="classOFXApplication.html#a5">00335</a>   <span class="keywordtype">void</span> <a class="code" href="classOFXApplication.html#a5">openEntityChange</a> (<span class="keyword">const</span> OpenEntityPtr &amp; para_entity_ptr)
316
318
00336   {
317
 
00337     <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a0">DEBUG</a>,<span class="stringliteral">"openEntityChange()\n"</span>);
 
319
00337     <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a0">DEBUG</a>,<span class="stringliteral">"openEntityChange()\n"</span>);
318
320
00338     <a class="code" href="messages_8cpp.html#a0">entity_ptr</a> = para_entity_ptr;
319
321
00339 
320
322
00340   };
322
324
00342 <span class="keyword">private</span>:
323
325
00343 };
324
326
00344 
325
 
<a name="l00348"></a><a class="code" href="fx-0_87_80_2lib_2ofx__sgml_8hh.html#a0">00348</a> <span class="keywordtype">int</span> <a class="code" href="fx-0_87_80_2lib_2ofx__sgml_8hh.html#a0">ofx_proc_sgml</a>(LibofxContext * libofx_context, <span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[])
 
327
<a name="l00348"></a><a class="code" href="fx-0_88_80_2lib_2ofx__sgml_8hh.html#a0">00348</a> <span class="keywordtype">int</span> <a class="code" href="fx-0_88_80_2lib_2ofx__sgml_8hh.html#a0">ofx_proc_sgml</a>(LibofxContext * libofx_context, <span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> *argv[])
326
328
00349 {
327
 
00350   <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a0">DEBUG</a>,<span class="stringliteral">"Begin ofx_proc_sgml()"</span>);
328
 
00351   <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a0">DEBUG</a>,argv[0]);
329
 
00352   <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a0">DEBUG</a>,argv[1]);
330
 
00353   <a class="code" href="fx-0_87_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a0">DEBUG</a>,argv[2]);
 
329
00350   <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a0">DEBUG</a>,<span class="stringliteral">"Begin ofx_proc_sgml()"</span>);
 
330
00351   <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a0">DEBUG</a>,argv[0]);
 
331
00352   <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a0">DEBUG</a>,argv[1]);
 
332
00353   <a class="code" href="fx-0_88_80_2lib_2messages_8hh.html#a11">message_out</a>(<a class="code" href="messages_8hh.html#a12a0">DEBUG</a>,argv[2]);
331
333
00354   
332
334
00355   ParserEventGeneratorKit parserKit;
333
335
00356   parserKit.setOption (ParserEventGeneratorKit::showOpenEntities);
338
340
00361   <span class="keyword">delete</span> egp;
339
341
00362   <span class="keywordflow">return</span> nErrors &gt; 0;
340
342
00363 }
341
 
</div></pre><hr size="1"><address style="align: right;"><small>Generated on Fri Oct 8 20:34:48 2004 for LibOFX by
 
343
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Sun Jul 31 15:38:35 2005 for LibOFX by&nbsp;
342
344
<a href="http://www.doxygen.org/index.html">
343
 
<img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.7 </small></address>
 
345
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address>
344
346
</body>
345
347
</html>