1
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">
2
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3
3
<title>LibOFX: ofx_preproc.cpp File Reference</title>
4
4
<link href="doxygen.css" rel="stylesheet" type="text/css">
5
5
<link href="tabs.css" rel="stylesheet" type="text/css">
7
<!-- Generated by Doxygen 1.4.6 -->
7
<!-- Generated by Doxygen 1.5.3 -->
10
10
<li><a href="main.html"><span>Main Page</span></a></li>
11
11
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
12
12
<li><a href="annotated.html"><span>Data Structures</span></a></li>
13
<li id="current"><a href="files.html"><span>Files</span></a></li>
17
<li><a href="files.html"><span>File List</span></a></li>
18
<li><a href="globals.html"><span>Globals</span></a></li>
13
<li class="current"><a href="files.html"><span>Files</span></a></li>
20
16
<h1>ofx_preproc.cpp File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
21
17
Preprocessing of the OFX files before parsing.
23
19
Implements the pre-treatement of the OFX file prior to parsing: OFX header striping, OFX proprietary tags and SGML comment striping, locating the appropriate DTD.
25
Definition in file <a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp-source.html">fx-0.8.2/lib/ofx_preproc.cpp</a>.
20
<p>Definition in file <a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp-source.html">fx-0.8.2/lib/ofx_preproc.cpp</a>.</p>
29
25
<a href="fx-0_88_82_2lib_2ofx__preproc_8cpp-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
27
<tr><td colspan="2"><br><h2>Defines</h2></td></tr>
28
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="09a61c3060675652c8264d4a2ed4fce9"></a><!-- doxytag: member="fx-0.8.2/lib/ofx_preproc.cpp::LIBOFX_DEFAULT_INPUT_ENCODING" ref="09a61c3060675652c8264d4a2ed4fce9" args="" -->
29
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp.html#09a61c3060675652c8264d4a2ed4fce9">LIBOFX_DEFAULT_INPUT_ENCODING</a> "CP1252"</td></tr>
31
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c27a6a130c3778f9fafbc6cc6b85481a"></a><!-- doxytag: member="fx-0.8.2/lib/ofx_preproc.cpp::LIBOFX_DEFAULT_OUTPUT_ENCODING" ref="c27a6a130c3778f9fafbc6cc6b85481a" args="" -->
32
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp.html#c27a6a130c3778f9fafbc6cc6b85481a">LIBOFX_DEFAULT_OUTPUT_ENCODING</a> "UTF-8"</td></tr>
31
34
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
32
<tr><td class="memItemLeft" nowrap align="right" valign="top">CFCT int </td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp.html#7b1cf1b458173b5f65bc8d2663121202">ofx_proc_file</a> (<a class="el" href="libofx-0_88_82_2inc_2libofx_8h.html#15e5ea23015b0e379679d9e8db1057c0">LibofxContextPtr</a> ctx, const char *p_filename)</td></tr>
34
<tr><td class="mdescLeft"> </td><td class="mdescRight">ofx_proc_file process an ofx or ofc file. <a href="#7b1cf1b458173b5f65bc8d2663121202"></a><br></td></tr>
35
<tr><td class="memItemLeft" nowrap align="right" valign="top">CFCT int </td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp.html#b9071aa8248754f9886f5d3a4a904e00">libofx_proc_buffer</a> (<a class="el" href="libofx-0_88_82_2inc_2libofx_8h.html#15e5ea23015b0e379679d9e8db1057c0">LibofxContextPtr</a> ctx, const char *s, unsigned int size)</td></tr>
37
<tr><td class="memItemLeft" nowrap align="right" valign="top">string </td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp.html#1081ea6fa992f51998090e4c24d6cc64">sanitize_proprietary_tags</a> (string input_string)</td></tr>
39
<tr><td class="mdescLeft"> </td><td class="mdescRight">Removes proprietary tags and comments. <a href="#1081ea6fa992f51998090e4c24d6cc64"></a><br></td></tr>
40
<tr><td class="memItemLeft" nowrap align="right" valign="top">string </td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp.html#5efb55f65bf1d51e4863c6cc1c10439c">find_dtd</a> (string dtd_filename)</td></tr>
42
<tr><td class="mdescLeft"> </td><td class="mdescRight">Find the appropriate DTD for the file version. <a href="#5efb55f65bf1d51e4863c6cc1c10439c"></a><br></td></tr>
35
<tr><td class="memItemLeft" nowrap align="right" valign="top">CFCT int </td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp.html#f2eca18ef5a500e7f76ed180d0af8a0a">ofx_proc_file</a> (<a class="el" href="libofx-0_89_80_2inc_2libofx_8h.html#cb05196108aab07092d1b4931577b87c">LibofxContextPtr</a> ctx, const char *p_filename)</td></tr>
37
<tr><td class="mdescLeft"> </td><td class="mdescRight">File pre-processing of OFX AND for OFC files. <a href="#f2eca18ef5a500e7f76ed180d0af8a0a"></a><br></td></tr>
38
<tr><td class="memItemLeft" nowrap align="right" valign="top">CFCT int </td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp.html#02ee3c0b61d866f98fd0f15775d06895">libofx_proc_buffer</a> (<a class="el" href="libofx-0_89_80_2inc_2libofx_8h.html#cb05196108aab07092d1b4931577b87c">LibofxContextPtr</a> ctx, const char *s, unsigned int size)</td></tr>
40
<tr><td class="memItemLeft" nowrap align="right" valign="top">string </td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp.html#cdbd49c3c11946411dd76016609bd333">sanitize_proprietary_tags</a> (string input_string)</td></tr>
42
<tr><td class="mdescLeft"> </td><td class="mdescRight">Removes proprietary tags and comments. <a href="#cdbd49c3c11946411dd76016609bd333"></a><br></td></tr>
43
<tr><td class="memItemLeft" nowrap align="right" valign="top">string </td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp.html#668d0fdb6a2859c117273c02eb478e53">find_dtd</a> (string dtd_filename)</td></tr>
45
<tr><td class="mdescLeft"> </td><td class="mdescRight">Find the appropriate DTD for the file version. <a href="#668d0fdb6a2859c117273c02eb478e53"></a><br></td></tr>
43
46
<tr><td colspan="2"><br><h2>Variables</h2></td></tr>
44
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="28ceb7515369bc9485582d52bafaa4ca"></a><!-- doxytag: member="fx-0.8.2/lib/ofx_preproc.cpp::DTD_SEARCH_PATH_NUM" ref="28ceb7515369bc9485582d52bafaa4ca" args="" -->
45
const int </td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp.html#28ceb7515369bc9485582d52bafaa4ca">DTD_SEARCH_PATH_NUM</a> = 3</td></tr>
47
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="877a644df33a5047e92386446c5cce88"></a><!-- doxytag: member="fx-0.8.2/lib/ofx_preproc.cpp::DTD_SEARCH_PATH_NUM" ref="877a644df33a5047e92386446c5cce88" args="" -->
48
const int </td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp.html#877a644df33a5047e92386446c5cce88">DTD_SEARCH_PATH_NUM</a> = 3</td></tr>
47
50
<tr><td class="mdescLeft"> </td><td class="mdescRight">The number of different paths to search for DTDs. <br></td></tr>
48
<tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp.html#0f48385ce1749e68a87b61c8f5755742">DTD_SEARCH_PATH</a> [<a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp.html#28ceb7515369bc9485582d52bafaa4ca">DTD_SEARCH_PATH_NUM</a>]</td></tr>
51
<tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp.html#760a72b5e13c14b54c8eb0af7a4000d3">DTD_SEARCH_PATH</a> [<a class="el" href="fx-0_89_80_2lib_2ofx__preproc_8cpp.html#877a644df33a5047e92386446c5cce88">DTD_SEARCH_PATH_NUM</a>]</td></tr>
50
<tr><td class="mdescLeft"> </td><td class="mdescRight">The list of paths to search for the DTDs. <a href="#0f48385ce1749e68a87b61c8f5755742"></a><br></td></tr>
51
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9eee3543dcaefab6e13ffd2868c07aaa"></a><!-- doxytag: member="fx-0.8.2/lib/ofx_preproc.cpp::READ_BUFFER_SIZE" ref="9eee3543dcaefab6e13ffd2868c07aaa" args="" -->
52
const unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp.html#9eee3543dcaefab6e13ffd2868c07aaa">READ_BUFFER_SIZE</a> = 1024</td></tr>
53
<tr><td class="mdescLeft"> </td><td class="mdescRight">The list of paths to search for the DTDs. <a href="#760a72b5e13c14b54c8eb0af7a4000d3"></a><br></td></tr>
54
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="3a4f15870bd5573d14fceb17c65162ee"></a><!-- doxytag: member="fx-0.8.2/lib/ofx_preproc.cpp::READ_BUFFER_SIZE" ref="3a4f15870bd5573d14fceb17c65162ee" args="" -->
55
const unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp.html#3a4f15870bd5573d14fceb17c65162ee">READ_BUFFER_SIZE</a> = 1024</td></tr>
55
58
<hr><h2>Function Documentation</h2>
56
<a class="anchor" name="5efb55f65bf1d51e4863c6cc1c10439c"></a><!-- doxytag: member="fx-0.8.2/lib/ofx_preproc.cpp::find_dtd" ref="5efb55f65bf1d51e4863c6cc1c10439c" args="(string dtd_filename)" --><p>
57
<table class="mdTable" cellpadding="2" cellspacing="0">
60
<table cellpadding="0" cellspacing="0" border="0">
59
<a class="anchor" name="668d0fdb6a2859c117273c02eb478e53"></a><!-- doxytag: member="fx-0.8.2/lib/ofx_preproc.cpp::find_dtd" ref="668d0fdb6a2859c117273c02eb478e53" args="(string dtd_filename)" -->
61
<div class="memproto">
62
<table class="memname">
62
<td class="md" nowrap valign="top">string find_dtd </td>
63
<td class="md" valign="top">( </td>
64
<td class="md" nowrap valign="top">string </td>
65
<td class="mdname1" valign="top" nowrap> <em>dtd_filename</em> </td>
66
<td class="md" valign="top"> ) </td>
67
<td class="md" nowrap></td>
64
<td class="memname">string find_dtd </td>
66
<td class="paramtype">string </td>
67
<td class="paramname"> <em>dtd_filename</em> </td>
68
<td> ) </td>
69
<td width="100%"></td>
73
<table cellspacing="5" cellpadding="0" border="0">
81
76
Find the appropriate DTD for the file version.
83
78
This function will try to find a DTD matching the requested_version and return the full path of the DTD found (or an empty string if unsuccessfull)<p>
84
79
Please note that currently the function will ALWAYS look for version 160, since OpenSP can't parse the 201 DTD correctly
86
Definition at line <a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp-source.html#l00434">434</a> of file <a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp-source.html">fx-0.8.2/lib/ofx_preproc.cpp</a>. </td>
89
<a class="anchor" name="b9071aa8248754f9886f5d3a4a904e00"></a><!-- doxytag: member="fx-0.8.2/lib/ofx_preproc.cpp::libofx_proc_buffer" ref="b9071aa8248754f9886f5d3a4a904e00" args="(LibofxContextPtr ctx, const char *s, unsigned int size)" --><p>
90
<table class="mdTable" cellpadding="2" cellspacing="0">
93
<table cellpadding="0" cellspacing="0" border="0">
95
<td class="md" nowrap valign="top">CFCT int libofx_proc_buffer </td>
96
<td class="md" valign="top">( </td>
97
<td class="md" nowrap valign="top"><a class="el" href="libofx-0_88_82_2inc_2libofx_8h.html#15e5ea23015b0e379679d9e8db1057c0">LibofxContextPtr</a> </td>
98
<td class="mdname" nowrap> <em>ctx</em>, </td>
101
<td class="md" nowrap align="right"></td>
103
<td class="md" nowrap>const char * </td>
104
<td class="mdname" nowrap> <em>s</em>, </td>
107
<td class="md" nowrap align="right"></td>
109
<td class="md" nowrap>unsigned int </td>
110
<td class="mdname" nowrap> <em>size</em></td>
114
<td class="md">) </td>
115
<td class="md" colspan="2"></td>
80
<p>Definition at line <a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp-source.html#l00505">505</a> of file <a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp-source.html">fx-0.8.2/lib/ofx_preproc.cpp</a>.</p>
84
<a class="anchor" name="02ee3c0b61d866f98fd0f15775d06895"></a><!-- doxytag: member="fx-0.8.2/lib/ofx_preproc.cpp::libofx_proc_buffer" ref="02ee3c0b61d866f98fd0f15775d06895" args="(LibofxContextPtr ctx, const char *s, unsigned int size)" -->
86
<div class="memproto">
87
<table class="memname">
89
<td class="memname">CFCT int libofx_proc_buffer </td>
91
<td class="paramtype"><a class="el" href="libofx-0_89_80_2inc_2libofx_8h.html#cb05196108aab07092d1b4931577b87c">LibofxContextPtr</a> </td>
92
<td class="paramname"> <em>ctx</em>, </td>
95
<td class="paramkey"></td>
97
<td class="paramtype">const char * </td>
98
<td class="paramname"> <em>s</em>, </td>
101
<td class="paramkey"></td>
103
<td class="paramtype">unsigned int </td>
104
<td class="paramname"> <em>size</em></td><td> </td>
109
<td></td><td></td><td width="100%"></td>
121
<table cellspacing="5" cellpadding="0" border="0">
129
116
Parses the content of the given buffer.
131
Definition at line <a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp-source.html#l00201">201</a> of file <a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp-source.html">fx-0.8.2/lib/ofx_preproc.cpp</a>. </td>
134
<a class="anchor" name="7b1cf1b458173b5f65bc8d2663121202"></a><!-- doxytag: member="fx-0.8.2/lib/ofx_preproc.cpp::ofx_proc_file" ref="7b1cf1b458173b5f65bc8d2663121202" args="(LibofxContextPtr ctx, const char *p_filename)" --><p>
135
<table class="mdTable" cellpadding="2" cellspacing="0">
138
<table cellpadding="0" cellspacing="0" border="0">
140
<td class="md" nowrap valign="top">CFCT int ofx_proc_file </td>
141
<td class="md" valign="top">( </td>
142
<td class="md" nowrap valign="top"><a class="el" href="libofx-0_88_82_2inc_2libofx_8h.html#15e5ea23015b0e379679d9e8db1057c0">LibofxContextPtr</a> </td>
143
<td class="mdname" nowrap> <em>ctx</em>, </td>
146
<td class="md" nowrap align="right"></td>
148
<td class="md" nowrap>const char * </td>
149
<td class="mdname" nowrap> <em>p_filename</em></td>
153
<td class="md">) </td>
154
<td class="md" colspan="2"></td>
117
<p>Definition at line <a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp-source.html#l00271">271</a> of file <a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp-source.html">fx-0.8.2/lib/ofx_preproc.cpp</a>.</p>
121
<a class="anchor" name="f2eca18ef5a500e7f76ed180d0af8a0a"></a><!-- doxytag: member="fx-0.8.2/lib/ofx_preproc.cpp::ofx_proc_file" ref="f2eca18ef5a500e7f76ed180d0af8a0a" args="(LibofxContextPtr ctx, const char *p_filename)" -->
122
<div class="memitem">
123
<div class="memproto">
124
<table class="memname">
126
<td class="memname">CFCT int ofx_proc_file </td>
128
<td class="paramtype"><a class="el" href="libofx-0_89_80_2inc_2libofx_8h.html#cb05196108aab07092d1b4931577b87c">LibofxContextPtr</a> </td>
129
<td class="paramname"> <em>ctx</em>, </td>
132
<td class="paramkey"></td>
134
<td class="paramtype">const char * </td>
135
<td class="paramname"> <em>p_filename</em></td><td> </td>
140
<td></td><td></td><td width="100%"></td>
160
<table cellspacing="5" cellpadding="0" border="0">
168
ofx_proc_file process an ofx or ofc file.
147
File pre-processing of OFX AND for OFC files.
149
ofx_proc_file process an ofx or ofc file.<p>
170
150
Takes care of comment striping, dtd locating, etc.
172
Definition at line <a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp-source.html#l00058">58</a> of file <a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp-source.html">fx-0.8.2/lib/ofx_preproc.cpp</a>. </td>
175
<a class="anchor" name="1081ea6fa992f51998090e4c24d6cc64"></a><!-- doxytag: member="fx-0.8.2/lib/ofx_preproc.cpp::sanitize_proprietary_tags" ref="1081ea6fa992f51998090e4c24d6cc64" args="(string input_string)" --><p>
176
<table class="mdTable" cellpadding="2" cellspacing="0">
179
<table cellpadding="0" cellspacing="0" border="0">
151
<p>Definition at line <a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp-source.html#l00065">65</a> of file <a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp-source.html">fx-0.8.2/lib/ofx_preproc.cpp</a>.</p>
155
<a class="anchor" name="cdbd49c3c11946411dd76016609bd333"></a><!-- doxytag: member="fx-0.8.2/lib/ofx_preproc.cpp::sanitize_proprietary_tags" ref="cdbd49c3c11946411dd76016609bd333" args="(string input_string)" -->
156
<div class="memitem">
157
<div class="memproto">
158
<table class="memname">
181
<td class="md" nowrap valign="top">string sanitize_proprietary_tags </td>
182
<td class="md" valign="top">( </td>
183
<td class="md" nowrap valign="top">string </td>
184
<td class="mdname1" valign="top" nowrap> <em>input_string</em> </td>
185
<td class="md" valign="top"> ) </td>
186
<td class="md" nowrap></td>
160
<td class="memname">string sanitize_proprietary_tags </td>
162
<td class="paramtype">string </td>
163
<td class="paramname"> <em>input_string</em> </td>
164
<td> ) </td>
165
<td width="100%"></td>
192
<table cellspacing="5" cellpadding="0" border="0">
200
172
Removes proprietary tags and comments.
202
174
This function will strip all the OFX proprietary tags and SGML comments from the SGML string passed to it
204
Definition at line <a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp-source.html#l00331">331</a> of file <a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp-source.html">fx-0.8.2/lib/ofx_preproc.cpp</a>. </td>
175
<p>Definition at line <a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp-source.html#l00402">402</a> of file <a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp-source.html">fx-0.8.2/lib/ofx_preproc.cpp</a>.</p>
207
179
<hr><h2>Variable Documentation</h2>
208
<a class="anchor" name="0f48385ce1749e68a87b61c8f5755742"></a><!-- doxytag: member="fx-0.8.2/lib/ofx_preproc.cpp::DTD_SEARCH_PATH" ref="0f48385ce1749e68a87b61c8f5755742" args="[DTD_SEARCH_PATH_NUM]" --><p>
209
<table class="mdTable" cellpadding="2" cellspacing="0">
212
<table cellpadding="0" cellspacing="0" border="0">
180
<a class="anchor" name="760a72b5e13c14b54c8eb0af7a4000d3"></a><!-- doxytag: member="fx-0.8.2/lib/ofx_preproc.cpp::DTD_SEARCH_PATH" ref="760a72b5e13c14b54c8eb0af7a4000d3" args="[DTD_SEARCH_PATH_NUM]" -->
181
<div class="memitem">
182
<div class="memproto">
183
<table class="memname">
214
<td class="md" nowrap valign="top">const char* <a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp.html#0f48385ce1749e68a87b61c8f5755742">DTD_SEARCH_PATH</a>[<a class="el" href="fx-0_88_82_2lib_2ofx__preproc_8cpp.html#28ceb7515369bc9485582d52bafaa4ca">DTD_SEARCH_PATH_NUM</a>] </td>
185
<td class="memname">const char* <a class="el" href="fx-0_89_80_2lib_2ofx__preproc_8cpp.html#760a72b5e13c14b54c8eb0af7a4000d3">DTD_SEARCH_PATH</a>[<a class="el" href="fx-0_89_80_2lib_2ofx__preproc_8cpp.html#877a644df33a5047e92386446c5cce88">DTD_SEARCH_PATH_NUM</a>] </td>
220
<table cellspacing="5" cellpadding="0" border="0">
228
192
<b>Initial value:</b><div class="fragment"><pre class="fragment"> {