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_utilities.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_utilities.cpp File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
21
17
Various simple functions for type conversion & al.
25
Definition in file <a class="el" href="ofx__utilities_8cpp-source.html">ofx_utilities.cpp</a>.
20
<p>Definition in file <a class="el" href="ofx__utilities_8cpp-source.html">ofx_utilities.cpp</a>.</p>
29
25
<a href="ofx__utilities_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="2c89f3449c0cc91f289ecbef54188d8d"></a><!-- doxytag: member="ofx_utilities.cpp::DIRSEP" ref="2c89f3449c0cc91f289ecbef54188d8d" args="" -->
29
#define </td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8cpp.html#2c89f3449c0cc91f289ecbef54188d8d">DIRSEP</a> "/"</td></tr>
31
31
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
32
<tr><td class="memItemLeft" nowrap align="right" valign="top">string </td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8cpp.html#0d78db2f18e9d8b4a9916b90819d073e">CharStringtostring</a> (const SGMLApplication::CharString source, string &dest)</td></tr>
32
<tr><td class="memItemLeft" nowrap align="right" valign="top">string </td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8cpp.html#e7575392f9f9c464ede10057dec0e8e4">CharStringtostring</a> (const SGMLApplication::CharString source, string &dest)</td></tr>
34
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert OpenSP CharString to a C++ STL string. <a href="#0d78db2f18e9d8b4a9916b90819d073e"></a><br></td></tr>
35
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f54953e915499daefb8959d8b15fa6f0"></a><!-- doxytag: member="ofx_utilities.cpp::AppendCharStringtostring" ref="f54953e915499daefb8959d8b15fa6f0" args="(const SGMLApplication::CharString source, string &dest)" -->
36
string </td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8cpp.html#f54953e915499daefb8959d8b15fa6f0">AppendCharStringtostring</a> (const SGMLApplication::CharString source, string &dest)</td></tr>
34
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert OpenSP CharString to a C++ STL string. <a href="#e7575392f9f9c464ede10057dec0e8e4"></a><br></td></tr>
35
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="50b88c84b759d3058397336e7ea42c32"></a><!-- doxytag: member="ofx_utilities.cpp::AppendCharStringtostring" ref="50b88c84b759d3058397336e7ea42c32" args="(const SGMLApplication::CharString source, string &dest)" -->
36
string </td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8cpp.html#50b88c84b759d3058397336e7ea42c32">AppendCharStringtostring</a> (const SGMLApplication::CharString source, string &dest)</td></tr>
38
38
<tr><td class="mdescLeft"> </td><td class="mdescRight">Append an OpenSP CharString to an existing C++ STL string. <br></td></tr>
39
<tr><td class="memItemLeft" nowrap align="right" valign="top">time_t </td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8cpp.html#a82c89f166fafe7ac376f2ecc7f1059a">ofxdate_to_time_t</a> (const string ofxdate)</td></tr>
41
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert a C++ string containing a time in OFX format to a C time_t. <a href="#a82c89f166fafe7ac376f2ecc7f1059a"></a><br></td></tr>
42
<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8cpp.html#ca59f589043d9d418168b8092809d0a1">ofxamount_to_double</a> (const string ofxamount)</td></tr>
44
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert OFX amount of money to double float. <a href="#ca59f589043d9d418168b8092809d0a1"></a><br></td></tr>
45
<tr><td class="memItemLeft" nowrap align="right" valign="top">string </td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8cpp.html#eb4379d3bf0c6900bda8b5f2feb9db92">strip_whitespace</a> (const string para_string)</td></tr>
47
<tr><td class="mdescLeft"> </td><td class="mdescRight">Sanitize a string coming from OpenSP. <a href="#eb4379d3bf0c6900bda8b5f2feb9db92"></a><br></td></tr>
39
<tr><td class="memItemLeft" nowrap align="right" valign="top">time_t </td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8cpp.html#5fdbbc08f8d80a534f8db03d25316d7a">ofxdate_to_time_t</a> (const string ofxdate)</td></tr>
41
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert a C++ string containing a time in OFX format to a C time_t. <a href="#5fdbbc08f8d80a534f8db03d25316d7a"></a><br></td></tr>
42
<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8cpp.html#bfca5b423e5d7b194eb53c53f706f6ba">ofxamount_to_double</a> (const string ofxamount)</td></tr>
44
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert OFX amount of money to double float. <a href="#bfca5b423e5d7b194eb53c53f706f6ba"></a><br></td></tr>
45
<tr><td class="memItemLeft" nowrap align="right" valign="top">string </td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8cpp.html#34933785dd934134973847e58a700733">strip_whitespace</a> (const string para_string)</td></tr>
47
<tr><td class="mdescLeft"> </td><td class="mdescRight">Sanitize a string coming from OpenSP. <a href="#34933785dd934134973847e58a700733"></a><br></td></tr>
48
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a0e945c824a3012017b4babd721d9f38"></a><!-- doxytag: member="ofx_utilities.cpp::mkTempFileName" ref="a0e945c824a3012017b4babd721d9f38" args="(const char *tmpl, char *buffer, unsigned int size)" -->
49
int </td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8cpp.html#a0e945c824a3012017b4babd721d9f38">mkTempFileName</a> (const char *tmpl, char *buffer, unsigned int size)</td></tr>
49
52
<hr><h2>Function Documentation</h2>
50
<a class="anchor" name="0d78db2f18e9d8b4a9916b90819d073e"></a><!-- doxytag: member="ofx_utilities.cpp::CharStringtostring" ref="0d78db2f18e9d8b4a9916b90819d073e" args="(const SGMLApplication::CharString source, string &dest)" --><p>
51
<table class="mdTable" cellpadding="2" cellspacing="0">
54
<table cellpadding="0" cellspacing="0" border="0">
56
<td class="md" nowrap valign="top">string CharStringtostring </td>
57
<td class="md" valign="top">( </td>
58
<td class="md" nowrap valign="top">const SGMLApplication::CharString </td>
59
<td class="mdname" nowrap> <em>source</em>, </td>
62
<td class="md" nowrap align="right"></td>
64
<td class="md" nowrap>string & </td>
65
<td class="mdname" nowrap> <em>dest</em></td>
69
<td class="md">) </td>
70
<td class="md" colspan="2"></td>
53
<a class="anchor" name="e7575392f9f9c464ede10057dec0e8e4"></a><!-- doxytag: member="ofx_utilities.cpp::CharStringtostring" ref="e7575392f9f9c464ede10057dec0e8e4" args="(const SGMLApplication::CharString source, string &dest)" -->
55
<div class="memproto">
56
<table class="memname">
58
<td class="memname">string CharStringtostring </td>
60
<td class="paramtype">const SGMLApplication::CharString </td>
61
<td class="paramname"> <em>source</em>, </td>
64
<td class="paramkey"></td>
66
<td class="paramtype">string & </td>
67
<td class="paramname"> <em>dest</em></td><td> </td>
72
<td></td><td></td><td width="100%"></td>
76
<table cellspacing="5" cellpadding="0" border="0">
84
79
Convert OpenSP CharString to a C++ STL string.
86
81
Convert an OpenSP CharString directly to a C++ stream, to enable the use of cout directly for debugging.
88
Definition at line <a class="el" href="ofx__utilities_8cpp-source.html#l00060">60</a> of file <a class="el" href="ofx__utilities_8cpp-source.html">ofx_utilities.cpp</a>.
90
Referenced by <a class="el" href="ofx__sgml_8cpp-source.html#l00211">OFXApplication::endElement()</a>, <a class="el" href="ofc__sgml_8cpp-source.html#l00204">OFCApplication::endElement()</a>, <a class="el" href="ofx__sgml_8cpp-source.html#l00295">OFXApplication::error()</a>, <a class="el" href="ofc__sgml_8cpp-source.html#l00288">OFCApplication::error()</a>, <a class="el" href="ofx__sgml_8cpp-source.html#l00071">OFXApplication::startElement()</a>, and <a class="el" href="ofc__sgml_8cpp-source.html#l00064">OFCApplication::startElement()</a>. </td>
93
<a class="anchor" name="ca59f589043d9d418168b8092809d0a1"></a><!-- doxytag: member="ofx_utilities.cpp::ofxamount_to_double" ref="ca59f589043d9d418168b8092809d0a1" args="(const string ofxamount)" --><p>
94
<table class="mdTable" cellpadding="2" cellspacing="0">
97
<table cellpadding="0" cellspacing="0" border="0">
82
<p>Definition at line <a class="el" href="ofx__utilities_8cpp-source.html#l00069">69</a> of file <a class="el" href="ofx__utilities_8cpp-source.html">ofx_utilities.cpp</a>.</p>
84
<p>Referenced by <a class="el" href="ofx__sgml_8cpp-source.html#l00211">OFXApplication::endElement()</a>, <a class="el" href="ofc__sgml_8cpp-source.html#l00204">OFCApplication::endElement()</a>, <a class="el" href="ofx__sgml_8cpp-source.html#l00295">OFXApplication::error()</a>, <a class="el" href="ofc__sgml_8cpp-source.html#l00288">OFCApplication::error()</a>, <a class="el" href="ofx__sgml_8cpp-source.html#l00071">OFXApplication::startElement()</a>, and <a class="el" href="ofc__sgml_8cpp-source.html#l00064">OFCApplication::startElement()</a>.</p>
88
<a class="anchor" name="bfca5b423e5d7b194eb53c53f706f6ba"></a><!-- doxytag: member="ofx_utilities.cpp::ofxamount_to_double" ref="bfca5b423e5d7b194eb53c53f706f6ba" args="(const string ofxamount)" -->
90
<div class="memproto">
91
<table class="memname">
99
<td class="md" nowrap valign="top">double ofxamount_to_double </td>
100
<td class="md" valign="top">( </td>
101
<td class="md" nowrap valign="top">const string </td>
102
<td class="mdname1" valign="top" nowrap> <em>ofxamount</em> </td>
103
<td class="md" valign="top"> ) </td>
104
<td class="md" nowrap></td>
93
<td class="memname">double ofxamount_to_double </td>
95
<td class="paramtype">const string </td>
96
<td class="paramname"> <em>ofxamount</em> </td>
97
<td> ) </td>
98
<td width="100%"></td>
110
<table cellspacing="5" cellpadding="0" border="0">
118
105
Convert OFX amount of money to double float.
120
Convert a C++ string containing an amount of money as specified by the OFX standard and convert it to a double float. <dl compact><dt><b>Note:</b></dt><dd>The ofx number format is the following: "." or "," as decimal separator, NO thousands separator. </dd></dl>
123
Definition at line <a class="el" href="ofx__utilities_8cpp-source.html#l00165">165</a> of file <a class="el" href="ofx__utilities_8cpp-source.html">ofx_utilities.cpp</a>.
125
Referenced by <a class="el" href="ofx__containers__misc_8cpp-source.html#l00156">OfxBalanceContainer::add_attribute()</a>, <a class="el" href="ofx__container__transaction_8cpp-source.html#l00333">OfxInvestmentTransactionContainer::add_attribute()</a>, <a class="el" href="ofx__container__transaction_8cpp-source.html#l00161">OfxBankTransactionContainer::add_attribute()</a>, and <a class="el" href="ofx__container__security_8cpp-source.html#l00045">OfxSecurityContainer::add_attribute()</a>. </td>
128
<a class="anchor" name="a82c89f166fafe7ac376f2ecc7f1059a"></a><!-- doxytag: member="ofx_utilities.cpp::ofxdate_to_time_t" ref="a82c89f166fafe7ac376f2ecc7f1059a" args="(const string ofxdate)" --><p>
129
<table class="mdTable" cellpadding="2" cellspacing="0">
132
<table cellpadding="0" cellspacing="0" border="0">
107
Convert a C++ string containing an amount of money as specified by the OFX standard and convert it to a double float. <dl class="note" compact><dt><b>Note:</b></dt><dd>The ofx number format is the following: "." or "," as decimal separator, NO thousands separator. </dd></dl>
109
<p>Definition at line <a class="el" href="ofx__utilities_8cpp-source.html#l00174">174</a> of file <a class="el" href="ofx__utilities_8cpp-source.html">ofx_utilities.cpp</a>.</p>
111
<p>Referenced by <a class="el" href="ofx__containers__misc_8cpp-source.html#l00156">OfxBalanceContainer::add_attribute()</a>, <a class="el" href="ofx__container__transaction_8cpp-source.html#l00333">OfxInvestmentTransactionContainer::add_attribute()</a>, <a class="el" href="ofx__container__transaction_8cpp-source.html#l00161">OfxBankTransactionContainer::add_attribute()</a>, and <a class="el" href="ofx__container__security_8cpp-source.html#l00045">OfxSecurityContainer::add_attribute()</a>.</p>
115
<a class="anchor" name="5fdbbc08f8d80a534f8db03d25316d7a"></a><!-- doxytag: member="ofx_utilities.cpp::ofxdate_to_time_t" ref="5fdbbc08f8d80a534f8db03d25316d7a" args="(const string ofxdate)" -->
116
<div class="memitem">
117
<div class="memproto">
118
<table class="memname">
134
<td class="md" nowrap valign="top">time_t ofxdate_to_time_t </td>
135
<td class="md" valign="top">( </td>
136
<td class="md" nowrap valign="top">const string </td>
137
<td class="mdname1" valign="top" nowrap> <em>ofxdate</em> </td>
138
<td class="md" valign="top"> ) </td>
139
<td class="md" nowrap></td>
120
<td class="memname">time_t ofxdate_to_time_t </td>
122
<td class="paramtype">const string </td>
123
<td class="paramname"> <em>ofxdate</em> </td>
124
<td> ) </td>
125
<td width="100%"></td>
145
<table cellspacing="5" cellpadding="0" border="0">
153
132
Convert a C++ string containing a time in OFX format to a C time_t.
174
153
-When a timezone is specified, it is always used to properly convert in local time, following the spec. </dd></dl>
177
Definition at line <a class="el" href="ofx__utilities_8cpp-source.html#l00097">97</a> of file <a class="el" href="ofx__utilities_8cpp-source.html">ofx_utilities.cpp</a>.
179
Referenced by <a class="el" href="ofx__containers__misc_8cpp-source.html#l00156">OfxBalanceContainer::add_attribute()</a>, <a class="el" href="ofx__container__transaction_8cpp-source.html#l00333">OfxInvestmentTransactionContainer::add_attribute()</a>, <a class="el" href="ofx__container__transaction_8cpp-source.html#l00093">OfxTransactionContainer::add_attribute()</a>, <a class="el" href="ofx__container__statement_8cpp-source.html#l00050">OfxStatementContainer::add_attribute()</a>, and <a class="el" href="ofx__container__security_8cpp-source.html#l00045">OfxSecurityContainer::add_attribute()</a>. </td>
182
<a class="anchor" name="eb4379d3bf0c6900bda8b5f2feb9db92"></a><!-- doxytag: member="ofx_utilities.cpp::strip_whitespace" ref="eb4379d3bf0c6900bda8b5f2feb9db92" args="(const string para_string)" --><p>
183
<table class="mdTable" cellpadding="2" cellspacing="0">
186
<table cellpadding="0" cellspacing="0" border="0">
155
<p>Definition at line <a class="el" href="ofx__utilities_8cpp-source.html#l00106">106</a> of file <a class="el" href="ofx__utilities_8cpp-source.html">ofx_utilities.cpp</a>.</p>
157
<p>Referenced by <a class="el" href="ofx__containers__misc_8cpp-source.html#l00156">OfxBalanceContainer::add_attribute()</a>, <a class="el" href="ofx__container__transaction_8cpp-source.html#l00333">OfxInvestmentTransactionContainer::add_attribute()</a>, <a class="el" href="ofx__container__transaction_8cpp-source.html#l00093">OfxTransactionContainer::add_attribute()</a>, <a class="el" href="ofx__container__statement_8cpp-source.html#l00050">OfxStatementContainer::add_attribute()</a>, and <a class="el" href="ofx__container__security_8cpp-source.html#l00045">OfxSecurityContainer::add_attribute()</a>.</p>
161
<a class="anchor" name="34933785dd934134973847e58a700733"></a><!-- doxytag: member="ofx_utilities.cpp::strip_whitespace" ref="34933785dd934134973847e58a700733" args="(const string para_string)" -->
162
<div class="memitem">
163
<div class="memproto">
164
<table class="memname">
188
<td class="md" nowrap valign="top">string strip_whitespace </td>
189
<td class="md" valign="top">( </td>
190
<td class="md" nowrap valign="top">const string </td>
191
<td class="mdname1" valign="top" nowrap> <em>para_string</em> </td>
192
<td class="md" valign="top"> ) </td>
193
<td class="md" nowrap></td>
166
<td class="memname">string strip_whitespace </td>
168
<td class="paramtype">const string </td>
169
<td class="paramname"> <em>para_string</em> </td>
170
<td> ) </td>
171
<td width="100%"></td>
199
<table cellspacing="5" cellpadding="0" border="0">
207
178
Sanitize a string coming from OpenSP.
209
180
Many weird caracters can be present inside a SGML element, as a result on the transfer protocol, or for any reason. This function greatly enhances the reliability of the library by zapping those gremlins (backspace,formfeed,newline,carriage return, horizontal and vertical tabs) as well as removing whitespace at the begining and end of the string. Otherwise, many problems will occur during stringmatching.
211
Definition at line <a class="el" href="ofx__utilities_8cpp-source.html#l00186">186</a> of file <a class="el" href="ofx__utilities_8cpp-source.html">ofx_utilities.cpp</a>.
213
Referenced by <a class="el" href="ofx__sgml_8cpp-source.html#l00211">OFXApplication::endElement()</a>, and <a class="el" href="ofc__sgml_8cpp-source.html#l00204">OFCApplication::endElement()</a>. </td>
216
<hr size="1"><address style="align: right;"><small>Generated on Fri Aug 25 13:25:22 2006 for LibOFX by
181
<p>Definition at line <a class="el" href="ofx__utilities_8cpp-source.html#l00195">195</a> of file <a class="el" href="ofx__utilities_8cpp-source.html">ofx_utilities.cpp</a>.</p>
183
<p>Referenced by <a class="el" href="ofx__sgml_8cpp-source.html#l00211">OFXApplication::endElement()</a>, and <a class="el" href="ofc__sgml_8cpp-source.html#l00204">OFCApplication::endElement()</a>.</p>
187
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Nov 19 20:28:00 2007 for LibOFX by
217
188
<a href="http://www.doxygen.org/index.html">
218
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6 </small></address>
189
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>