~mterry/ubuntu/natty/libofx/libofx.new-upstream-benoit-sru

« back to all changes in this revision

Viewing changes to doc/html/fx-0_89_80_2lib_2ofx__utilities_8hh.html

  • Committer: Bazaar Package Importer
  • Author(s): Saïvann Carignan
  • Date: 2008-02-06 17:25:16 UTC
  • mto: (3.1.2 lenny)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: james.westby@ubuntu.com-20080206172516-bnzxb29igye8um9h
Tags: upstream-0.9.0
Import upstream version 0.9.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
2
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
 
3
<title>LibOFX: ofx_utilities.hh File Reference</title>
 
4
<link href="doxygen.css" rel="stylesheet" type="text/css">
 
5
<link href="tabs.css" rel="stylesheet" type="text/css">
 
6
</head><body>
 
7
<!-- Generated by Doxygen 1.5.3 -->
 
8
<div class="tabs">
 
9
  <ul>
 
10
    <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
 
11
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
 
12
    <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
 
13
    <li class="current"><a href="files.html"><span>Files</span></a></li>
 
14
  </ul>
 
15
</div>
 
16
<h1>ofx_utilities.hh File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
 
17
Various simple functions for type conversion &amp; al. 
 
18
<p>
 
19
 
 
20
<p>Definition in file <a class="el" href="fx-0_89_80_2lib_2ofx__utilities_8hh-source.html">fx-0.9.0/lib/ofx_utilities.hh</a>.</p>
 
21
 
 
22
<p>
 
23
 
 
24
<p>
 
25
<a href="fx-0_89_80_2lib_2ofx__utilities_8hh-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0">
 
26
<tr><td></td></tr>
 
27
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
 
28
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="39ffcaaff3de66030e3e59c2e3e98f8e"></a><!-- doxytag: member="fx-0.9.0/lib/ofx_utilities.hh::operator&lt;&lt;" ref="39ffcaaff3de66030e3e59c2e3e98f8e" args="(ostream &amp;os, SGMLApplication::CharString s)" -->
 
29
ostream &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_89_80_2lib_2ofx__utilities_8hh.html#39ffcaaff3de66030e3e59c2e3e98f8e">operator&lt;&lt;</a> (ostream &amp;os, SGMLApplication::CharString s)</td></tr>
 
30
 
 
31
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convert OpenSP CharString to a C++ stream. <br></td></tr>
 
32
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="2fd46abc036e918fce7b04d9200b3e75"></a><!-- doxytag: member="fx-0.9.0/lib/ofx_utilities.hh::CharStringtowchar_t" ref="2fd46abc036e918fce7b04d9200b3e75" args="(SGMLApplication::CharString source, wchar_t *dest)" -->
 
33
wchar_t *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_89_80_2lib_2ofx__utilities_8hh.html#2fd46abc036e918fce7b04d9200b3e75">CharStringtowchar_t</a> (SGMLApplication::CharString source, wchar_t *dest)</td></tr>
 
34
 
 
35
<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>
 
36
<tr><td class="memItemLeft" nowrap align="right" valign="top">string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_89_80_2lib_2ofx__utilities_8hh.html#e7575392f9f9c464ede10057dec0e8e4">CharStringtostring</a> (const SGMLApplication::CharString source, string &amp;dest)</td></tr>
 
37
 
 
38
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convert OpenSP CharString to a C++ STL string.  <a href="#e7575392f9f9c464ede10057dec0e8e4"></a><br></td></tr>
 
39
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="50b88c84b759d3058397336e7ea42c32"></a><!-- doxytag: member="fx-0.9.0/lib/ofx_utilities.hh::AppendCharStringtostring" ref="50b88c84b759d3058397336e7ea42c32" args="(const SGMLApplication::CharString source, string &amp;dest)" -->
 
40
string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_89_80_2lib_2ofx__utilities_8hh.html#50b88c84b759d3058397336e7ea42c32">AppendCharStringtostring</a> (const SGMLApplication::CharString source, string &amp;dest)</td></tr>
 
41
 
 
42
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Append an OpenSP CharString to an existing C++ STL string. <br></td></tr>
 
43
<tr><td class="memItemLeft" nowrap align="right" valign="top">time_t&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_89_80_2lib_2ofx__utilities_8hh.html#5fdbbc08f8d80a534f8db03d25316d7a">ofxdate_to_time_t</a> (const string ofxdate)</td></tr>
 
44
 
 
45
<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="#5fdbbc08f8d80a534f8db03d25316d7a"></a><br></td></tr>
 
46
<tr><td class="memItemLeft" nowrap align="right" valign="top">double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_89_80_2lib_2ofx__utilities_8hh.html#bfca5b423e5d7b194eb53c53f706f6ba">ofxamount_to_double</a> (const string ofxamount)</td></tr>
 
47
 
 
48
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Convert OFX amount of money to double float.  <a href="#bfca5b423e5d7b194eb53c53f706f6ba"></a><br></td></tr>
 
49
<tr><td class="memItemLeft" nowrap align="right" valign="top">string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_89_80_2lib_2ofx__utilities_8hh.html#34933785dd934134973847e58a700733">strip_whitespace</a> (const string para_string)</td></tr>
 
50
 
 
51
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sanitize a string coming from OpenSP.  <a href="#34933785dd934134973847e58a700733"></a><br></td></tr>
 
52
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a0e945c824a3012017b4babd721d9f38"></a><!-- doxytag: member="fx-0.9.0/lib/ofx_utilities.hh::mkTempFileName" ref="a0e945c824a3012017b4babd721d9f38" args="(const char *tmpl, char *buffer, unsigned int size)" -->
 
53
int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="fx-0_89_80_2lib_2ofx__utilities_8hh.html#a0e945c824a3012017b4babd721d9f38">mkTempFileName</a> (const char *tmpl, char *buffer, unsigned int size)</td></tr>
 
54
 
 
55
</table>
 
56
<hr><h2>Function Documentation</h2>
 
57
<a class="anchor" name="e7575392f9f9c464ede10057dec0e8e4"></a><!-- doxytag: member="fx-0.9.0/lib/ofx_utilities.hh::CharStringtostring" ref="e7575392f9f9c464ede10057dec0e8e4" args="(const SGMLApplication::CharString source, string &amp;dest)" -->
 
58
<div class="memitem">
 
59
<div class="memproto">
 
60
      <table class="memname">
 
61
        <tr>
 
62
          <td class="memname">string CharStringtostring           </td>
 
63
          <td>(</td>
 
64
          <td class="paramtype">const SGMLApplication::CharString&nbsp;</td>
 
65
          <td class="paramname"> <em>source</em>, </td>
 
66
        </tr>
 
67
        <tr>
 
68
          <td class="paramkey"></td>
 
69
          <td></td>
 
70
          <td class="paramtype">string &amp;&nbsp;</td>
 
71
          <td class="paramname"> <em>dest</em></td><td>&nbsp;</td>
 
72
        </tr>
 
73
        <tr>
 
74
          <td></td>
 
75
          <td>)</td>
 
76
          <td></td><td></td><td width="100%"></td>
 
77
        </tr>
 
78
      </table>
 
79
</div>
 
80
<div class="memdoc">
 
81
 
 
82
<p>
 
83
Convert OpenSP CharString to a C++ STL string. 
 
84
<p>
 
85
Convert an OpenSP CharString directly to a C++ stream, to enable the use of cout directly for debugging. 
 
86
<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>
 
87
 
 
88
</div>
 
89
</div><p>
 
90
<a class="anchor" name="bfca5b423e5d7b194eb53c53f706f6ba"></a><!-- doxytag: member="fx-0.9.0/lib/ofx_utilities.hh::ofxamount_to_double" ref="bfca5b423e5d7b194eb53c53f706f6ba" args="(const string ofxamount)" -->
 
91
<div class="memitem">
 
92
<div class="memproto">
 
93
      <table class="memname">
 
94
        <tr>
 
95
          <td class="memname">double ofxamount_to_double           </td>
 
96
          <td>(</td>
 
97
          <td class="paramtype">const string&nbsp;</td>
 
98
          <td class="paramname"> <em>ofxamount</em>          </td>
 
99
          <td>&nbsp;)&nbsp;</td>
 
100
          <td width="100%"></td>
 
101
        </tr>
 
102
      </table>
 
103
</div>
 
104
<div class="memdoc">
 
105
 
 
106
<p>
 
107
Convert OFX amount of money to double float. 
 
108
<p>
 
109
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>
 
110
 
 
111
<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>
 
112
 
 
113
</div>
 
114
</div><p>
 
115
<a class="anchor" name="5fdbbc08f8d80a534f8db03d25316d7a"></a><!-- doxytag: member="fx-0.9.0/lib/ofx_utilities.hh::ofxdate_to_time_t" ref="5fdbbc08f8d80a534f8db03d25316d7a" args="(const string ofxdate)" -->
 
116
<div class="memitem">
 
117
<div class="memproto">
 
118
      <table class="memname">
 
119
        <tr>
 
120
          <td class="memname">time_t ofxdate_to_time_t           </td>
 
121
          <td>(</td>
 
122
          <td class="paramtype">const string&nbsp;</td>
 
123
          <td class="paramname"> <em>ofxdate</em>          </td>
 
124
          <td>&nbsp;)&nbsp;</td>
 
125
          <td width="100%"></td>
 
126
        </tr>
 
127
      </table>
 
128
</div>
 
129
<div class="memdoc">
 
130
 
 
131
<p>
 
132
Convert a C++ string containing a time in OFX format to a C time_t. 
 
133
<p>
 
134
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>
 
135
  <table border="0" cellspacing="2" cellpadding="0">
 
136
    <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>
 
137
  </table>
 
138
</dl>
 
139
<dl class="return" compact><dt><b>Returns:</b></dt><dd>C time_t in the local time zone </dd></dl>
 
140
<dl class="note" compact><dt><b>Note:</b></dt><dd><ul>
 
141
<li>The library always returns the time in the systems local time </li>
 
142
<li>OFX defines the date up to the millisecond. The library ignores those milliseconds, since ANSI C does not handle such precision cleanly. The date provided by LibOFX is precise to the second, assuming that information this precise was provided in the ofx file. So you wont know the millisecond you were ruined...</li>
 
143
</ul>
 
144
<p>
 
145
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>
 
146
<br>
 
147
 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>
 
148
<br>
 
149
 -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>
 
150
<br>
 
151
 -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>
 
152
<br>
 
153
 -When a timezone is specified, it is always used to properly convert in local time, following the spec. </dd></dl>
 
154
 
 
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>
 
156
 
 
157
</div>
 
158
</div><p>
 
159
<a class="anchor" name="34933785dd934134973847e58a700733"></a><!-- doxytag: member="fx-0.9.0/lib/ofx_utilities.hh::strip_whitespace" ref="34933785dd934134973847e58a700733" args="(const string para_string)" -->
 
160
<div class="memitem">
 
161
<div class="memproto">
 
162
      <table class="memname">
 
163
        <tr>
 
164
          <td class="memname">string strip_whitespace           </td>
 
165
          <td>(</td>
 
166
          <td class="paramtype">const string&nbsp;</td>
 
167
          <td class="paramname"> <em>para_string</em>          </td>
 
168
          <td>&nbsp;)&nbsp;</td>
 
169
          <td width="100%"></td>
 
170
        </tr>
 
171
      </table>
 
172
</div>
 
173
<div class="memdoc">
 
174
 
 
175
<p>
 
176
Sanitize a string coming from OpenSP. 
 
177
<p>
 
178
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. 
 
179
<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>
 
180
 
 
181
</div>
 
182
</div><p>
 
183
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Nov 19 20:28:00 2007 for LibOFX by&nbsp;
 
184
<a href="http://www.doxygen.org/index.html">
 
185
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
 
186
</body>
 
187
</html>