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

« back to all changes in this revision

Viewing changes to doc/html/ofx__utilities_8hh.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_utilities.hh File Reference</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
<div class="nav">
 
9
<a class="el" href="dir_000002.html">lib</a></div>
8
10
<h1>ofx_utilities.hh File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
9
11
Various simple functions for type conversion &amp; al. 
10
12
<p>
14
16
<p>
15
17
 
16
18
<p>
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">
18
20
<tr><td></td></tr>
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 &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="ofx__utilities_8hh.html#a0">operator&lt;&lt;</a> (ostream &amp;os, SGMLApplication::CharString s)</td></tr>
22
 
 
23
 
<tr><td class="mdescLeft">&nbsp;</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 *&nbsp;</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>
26
 
 
27
 
<tr><td class="mdescLeft">&nbsp;</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&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="ofx__utilities_8hh.html#a2">CharStringtostring</a> (const SGMLApplication::CharString source, string &amp;dest)</td></tr>
29
 
 
30
 
<tr><td class="mdescLeft">&nbsp;</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&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="ofx__utilities_8hh.html#a3">AppendCharStringtostring</a> (const SGMLApplication::CharString source, string &amp;dest)</td></tr>
33
 
 
34
 
<tr><td class="mdescLeft">&nbsp;</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&nbsp;</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>
36
 
 
37
 
<tr><td class="mdescLeft">&nbsp;</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&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="ofx__utilities_8hh.html#a5">ofxamount_to_double</a> (const string ofxamount)</td></tr>
39
 
 
40
 
<tr><td class="mdescLeft">&nbsp;</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&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="ofx__utilities_8hh.html#a6">strip_whitespace</a> (const string para_string)</td></tr>
42
 
 
43
 
<tr><td class="mdescLeft">&nbsp;</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 &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8hh.html#a0">operator&lt;&lt;</a> (ostream &amp;os, SGMLApplication::CharString s)</td></tr>
 
24
 
 
25
<tr><td class="mdescLeft">&nbsp;</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 *&nbsp;</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>
 
28
 
 
29
<tr><td class="mdescLeft">&nbsp;</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&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8hh.html#a2">CharStringtostring</a> (const SGMLApplication::CharString source, string &amp;dest)</td></tr>
 
31
 
 
32
<tr><td class="mdescLeft">&nbsp;</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&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8hh.html#a3">AppendCharStringtostring</a> (const SGMLApplication::CharString source, string &amp;dest)</td></tr>
 
35
 
 
36
<tr><td class="mdescLeft">&nbsp;</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&nbsp;</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>
 
38
 
 
39
<tr><td class="mdescLeft">&nbsp;</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&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8hh.html#a5">ofxamount_to_double</a> (const string ofxamount)</td></tr>
 
41
 
 
42
<tr><td class="mdescLeft">&nbsp;</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&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="ofx__utilities_8hh.html#a6">strip_whitespace</a> (const string para_string)</td></tr>
 
44
 
 
45
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sanitize a string coming from OpenSP.  <a href="#a6"></a><br></td></tr>
44
46
</table>
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">
48
50
  <tr>
49
51
    <td class="mdRow">
50
52
      <table cellpadding="0" cellspacing="0" border="0">
51
53
        <tr>
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">(&nbsp;</td>
54
56
          <td class="md" nowrap valign="top">const SGMLApplication::CharString&nbsp;</td>
55
57
          <td class="mdname" nowrap> <em>source</em>, </td>
56
58
        </tr>
57
59
        <tr>
58
60
          <td class="md" nowrap align="right"></td>
59
 
          <td></td>
 
61
          <td class="md"></td>
60
62
          <td class="md" nowrap>string &amp;&nbsp;</td>
61
63
          <td class="mdname" nowrap> <em>dest</em></td>
62
64
        </tr>
63
65
        <tr>
64
 
          <td></td>
 
66
          <td class="md"></td>
65
67
          <td class="md">)&nbsp;</td>
66
68
          <td class="md" colspan="2"></td>
67
69
        </tr>
69
71
    </td>
70
72
  </tr>
71
73
</table>
72
 
<table cellspacing=5 cellpadding=0 border=0>
 
74
<table cellspacing="5" cellpadding="0" border="0">
73
75
  <tr>
74
76
    <td>
75
77
      &nbsp;
84
86
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>.    </td>
85
87
  </tr>
86
88
</table>
87
 
<a class="anchor" name="a5" doxytag="ofx_utilities.hh::ofxamount_to_double" ></a><p>
 
89
<a class="anchor" name="a5" doxytag="ofx_utilities.hh::ofxamount_to_double"></a><p>
88
90
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
89
91
  <tr>
90
92
    <td class="mdRow">
91
93
      <table cellpadding="0" cellspacing="0" border="0">
92
94
        <tr>
93
 
          <td class="md" nowrap valign="top"> double ofxamount_to_double           </td>
 
95
          <td class="md" nowrap valign="top">double ofxamount_to_double           </td>
94
96
          <td class="md" valign="top">(&nbsp;</td>
95
97
          <td class="md" nowrap valign="top">const string&nbsp;</td>
96
98
          <td class="mdname1" valign="top" nowrap> <em>ofxamount</em>          </td>
101
103
    </td>
102
104
  </tr>
103
105
</table>
104
 
<table cellspacing=5 cellpadding=0 border=0>
 
106
<table cellspacing="5" cellpadding="0" border="0">
105
107
  <tr>
106
108
    <td>
107
109
      &nbsp;
117
119
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>.    </td>
118
120
  </tr>
119
121
</table>
120
 
<a class="anchor" name="a4" doxytag="ofx_utilities.hh::ofxdate_to_time_t" ></a><p>
 
122
<a class="anchor" name="a4" doxytag="ofx_utilities.hh::ofxdate_to_time_t"></a><p>
121
123
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
122
124
  <tr>
123
125
    <td class="mdRow">
124
126
      <table cellpadding="0" cellspacing="0" border="0">
125
127
        <tr>
126
 
          <td class="md" nowrap valign="top"> time_t ofxdate_to_time_t           </td>
 
128
          <td class="md" nowrap valign="top">time_t ofxdate_to_time_t           </td>
127
129
          <td class="md" valign="top">(&nbsp;</td>
128
130
          <td class="md" nowrap valign="top">const string&nbsp;</td>
129
131
          <td class="mdname1" valign="top" nowrap> <em>ofxdate</em>          </td>
134
136
    </td>
135
137
  </tr>
136
138
</table>
137
 
<table cellspacing=5 cellpadding=0 border=0>
 
139
<table cellspacing="5" cellpadding="0" border="0">
138
140
  <tr>
139
141
    <td>
140
142
      &nbsp;
146
148
<p>
147
149
Converts a date from the YYYYMMDDHHMMSS.XXX[gmt offset:tz name] OFX format (see OFX 2.01 spec p.66) to a C time_t. <dl compact><dt><b>Parameters:</b></dt><dd>
148
150
  <table border="0" cellspacing="2" cellpadding="0">
149
 
    <tr><td></td><td valign=top><em>ofxdate</em>&nbsp;</td><td>date from the YYYYMMDDHHMMSS.XXX[gmt offset:tz name] OFX format </td></tr>
 
151
    <tr><td valign="top"></td><td valign="top"><em>ofxdate</em>&nbsp;</td><td>date from the YYYYMMDDHHMMSS.XXX[gmt offset:tz name] OFX format </td></tr>
150
152
  </table>
151
153
</dl>
152
154
<dl compact><dt><b>Returns:</b></dt><dd>C time_t in the local time zone </dd></dl>
157
159
<p>
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>
159
161
<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:&lt;BR&gt;<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>
 
163
<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>
162
165
<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>
168
171
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>.    </td>
169
172
  </tr>
170
173
</table>
171
 
<a class="anchor" name="a6" doxytag="ofx_utilities.hh::strip_whitespace" ></a><p>
 
174
<a class="anchor" name="a6" doxytag="ofx_utilities.hh::strip_whitespace"></a><p>
172
175
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
173
176
  <tr>
174
177
    <td class="mdRow">
175
178
      <table cellpadding="0" cellspacing="0" border="0">
176
179
        <tr>
177
 
          <td class="md" nowrap valign="top"> string strip_whitespace           </td>
 
180
          <td class="md" nowrap valign="top">string strip_whitespace           </td>
178
181
          <td class="md" valign="top">(&nbsp;</td>
179
182
          <td class="md" nowrap valign="top">const string&nbsp;</td>
180
183
          <td class="mdname1" valign="top" nowrap> <em>para_string</em>          </td>
185
188
    </td>
186
189
  </tr>
187
190
</table>
188
 
<table cellspacing=5 cellpadding=0 border=0>
 
191
<table cellspacing="5" cellpadding="0" border="0">
189
192
  <tr>
190
193
    <td>
191
194
      &nbsp;
200
203
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>.    </td>
201
204
  </tr>
202
205
</table>
203
 
<hr size="1"><address style="align: right;"><small>Generated on Fri Oct 8 20:34:48 2004 for LibOFX by
 
206
<hr size="1"><address style="align: right;"><small>Generated on Sun Jul 31 15:38:36 2005 for LibOFX by&nbsp;
204
207
<a href="http://www.doxygen.org/index.html">
205
 
<img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.7 </small></address>
 
208
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address>
206
209
</body>
207
210
</html>