17
<a href="ofx__utilities_8hh-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0>
19
<a href="ofx__utilities_8hh-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
19
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
20
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a0" doxytag="ofx_utilities.hh::operator<<" ></a>
21
ostream & </td><td class="memItemRight" valign=bottom><a class="el" href="ofx__utilities_8hh.html#a0">operator<<</a> (ostream &os, SGMLApplication::CharString s)</td></tr>
23
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert OpenSP CharString to a C++ stream. <br><br></td></tr>
24
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a1" doxytag="ofx_utilities.hh::CharStringtowchar_t" ></a>
25
wchar_t * </td><td class="memItemRight" valign=bottom><a class="el" href="ofx__utilities_8hh.html#a1">CharStringtowchar_t</a> (SGMLApplication::CharString source, wchar_t *dest)</td></tr>
27
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert OpenSP CharString and put it in the C wchar_t string provided. <br><br></td></tr>
28
<tr><td class="memItemLeft" nowrap align=right valign=top>string </td><td class="memItemRight" valign=bottom><a class="el" href="ofx__utilities_8hh.html#a2">CharStringtostring</a> (const SGMLApplication::CharString source, string &dest)</td></tr>
30
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert OpenSP CharString to a C++ STL string. <a href="#a2"></a><br><br></td></tr>
31
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a3" doxytag="ofx_utilities.hh::AppendCharStringtostring" ></a>
32
string </td><td class="memItemRight" valign=bottom><a class="el" href="ofx__utilities_8hh.html#a3">AppendCharStringtostring</a> (const SGMLApplication::CharString source, string &dest)</td></tr>
34
<tr><td class="mdescLeft"> </td><td class="mdescRight">Append an OpenSP CharString to an existing C++ STL string. <br><br></td></tr>
35
<tr><td class="memItemLeft" nowrap align=right valign=top>time_t </td><td class="memItemRight" valign=bottom><a class="el" href="ofx__utilities_8hh.html#a4">ofxdate_to_time_t</a> (const string ofxdate)</td></tr>
37
<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="#a4"></a><br><br></td></tr>
38
<tr><td class="memItemLeft" nowrap align=right valign=top>double </td><td class="memItemRight" valign=bottom><a class="el" href="ofx__utilities_8hh.html#a5">ofxamount_to_double</a> (const string ofxamount)</td></tr>
40
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert OFX amount of money to double float. <a href="#a5"></a><br><br></td></tr>
41
<tr><td class="memItemLeft" nowrap align=right valign=top>string </td><td class="memItemRight" valign=bottom><a class="el" href="ofx__utilities_8hh.html#a6">strip_whitespace</a> (const string para_string)</td></tr>
43
<tr><td class="mdescLeft"> </td><td class="mdescRight">Sanitize a string coming from OpenSP. <a href="#a6"></a><br><br></td></tr>
21
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
22
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a0" doxytag="ofx_utilities.hh::operator<<"></a>
23
ostream & </td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8hh.html#a0">operator<<</a> (ostream &os, SGMLApplication::CharString s)</td></tr>
25
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert OpenSP CharString to a C++ stream. <br></td></tr>
26
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a1" doxytag="ofx_utilities.hh::CharStringtowchar_t"></a>
27
wchar_t * </td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8hh.html#a1">CharStringtowchar_t</a> (SGMLApplication::CharString source, wchar_t *dest)</td></tr>
29
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert OpenSP CharString and put it in the C wchar_t string provided. <br></td></tr>
30
<tr><td class="memItemLeft" nowrap align="right" valign="top">string </td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8hh.html#a2">CharStringtostring</a> (const SGMLApplication::CharString source, string &dest)</td></tr>
32
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert OpenSP CharString to a C++ STL string. <a href="#a2"></a><br></td></tr>
33
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a3" doxytag="ofx_utilities.hh::AppendCharStringtostring"></a>
34
string </td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8hh.html#a3">AppendCharStringtostring</a> (const SGMLApplication::CharString source, string &dest)</td></tr>
36
<tr><td class="mdescLeft"> </td><td class="mdescRight">Append an OpenSP CharString to an existing C++ STL string. <br></td></tr>
37
<tr><td class="memItemLeft" nowrap align="right" valign="top">time_t </td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8hh.html#a4">ofxdate_to_time_t</a> (const string ofxdate)</td></tr>
39
<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="#a4"></a><br></td></tr>
40
<tr><td class="memItemLeft" nowrap align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8hh.html#a5">ofxamount_to_double</a> (const string ofxamount)</td></tr>
42
<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert OFX amount of money to double float. <a href="#a5"></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="ofx__utilities_8hh.html#a6">strip_whitespace</a> (const string para_string)</td></tr>
45
<tr><td class="mdescLeft"> </td><td class="mdescRight">Sanitize a string coming from OpenSP. <a href="#a6"></a><br></td></tr>
45
47
<hr><h2>Function Documentation</h2>
46
<a class="anchor" name="a2" doxytag="ofx_utilities.hh::CharStringtostring" ></a><p>
48
<a class="anchor" name="a2" doxytag="ofx_utilities.hh::CharStringtostring"></a><p>
47
49
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
50
52
<table cellpadding="0" cellspacing="0" border="0">
52
<td class="md" nowrap valign="top"> string CharStringtostring </td>
54
<td class="md" nowrap valign="top">string CharStringtostring </td>
53
55
<td class="md" valign="top">( </td>
54
56
<td class="md" nowrap valign="top">const SGMLApplication::CharString </td>
55
57
<td class="mdname" nowrap> <em>source</em>, </td>
58
60
<td class="md" nowrap align="right"></td>
60
62
<td class="md" nowrap>string & </td>
61
63
<td class="mdname" nowrap> <em>dest</em></td>
65
67
<td class="md">) </td>
66
68
<td class="md" colspan="2"></td>
158
160
DEVIATION FROM THE SPECS : The OFX specifications (both version 1.6 and 2.02) state that a client should assume that if the server returns a date without � specific time, we assume it means 0h00 GMT. As such, when we apply the local timezone and for example you are in the EST timezone, we will remove 5h, and the transaction will have occurred on the prior day! This is probably not what the bank intended (and will lead to systematic errors), but the spec is quite explicit in this respect (Ref: OFX 2.01 spec pp. 66-68)<br>
160
To solve this problem (since usually a time error is relatively unimportant, but date error is), and to avoid problems in Australia caused by the behaviour in libofx up to 0.6.4, it was decided starting with 0.6.5 to use the following behavior:<BR><br>
162
To solve this problem (since usually a time error is relatively unimportant, but date error is), and to avoid problems in Australia caused by the behaviour in libofx up to 0.6.4, it was decided starting with 0.6.5 to use the following behavior:<br>
161
164
-No specific time is given in the file (date only): Considering that most banks seem to be sending dates in this format represented as local time (not compliant with the specs), the transaction is assumed to have occurred 11h59 (just before noon) LOCAL TIME. This way, we should never change the date, since you'd have to travel in a timezone at least 11 hours backwards or 13 hours forward from your own to introduce mistakes. However, if you are in timezone +13 or +14, and your bank meant the data to be interpreted by the spec, you will get the wrong date. We hope that banks in those timezone will either represent in local time like most, or specify the timezone properly.<br>
163
166
-No timezone is specified, but exact time is, the same behavior is mostly used, as many banks just append zeros instead of using the short notation. However, the time specified is used, even if 0 (midnight).<br>