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

« back to all changes in this revision

Viewing changes to doc/html/fx-0_88_82_2lib_2ofx__request_8cpp-source.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
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_request.cpp Source File</title>
4
4
<link href="doxygen.css" rel="stylesheet" type="text/css">
5
5
<link href="tabs.css" rel="stylesheet" type="text/css">
6
6
</head><body>
7
 
<!-- Generated by Doxygen 1.4.6 -->
 
7
<!-- Generated by Doxygen 1.5.3 -->
8
8
<div class="tabs">
9
9
  <ul>
10
10
    <li><a href="main.html"><span>Main&nbsp;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&nbsp;Structures</span></a></li>
13
 
    <li id="current"><a href="files.html"><span>Files</span></a></li>
14
 
  </ul></div>
15
 
<div class="tabs">
16
 
  <ul>
17
 
    <li><a href="files.html"><span>File&nbsp;List</span></a></li>
18
 
    <li><a href="globals.html"><span>Globals</span></a></li>
19
 
  </ul></div>
 
13
    <li class="current"><a href="files.html"><span>Files</span></a></li>
 
14
  </ul>
 
15
</div>
20
16
<h1>ofx_request.cpp</h1><a href="fx-0_88_82_2lib_2ofx__request_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/***************************************************************************</span>
21
17
<a name="l00002"></a>00002 <span class="comment">         ofx_request.cpp </span>
22
18
<a name="l00003"></a>00003 <span class="comment">                             -------------------</span>
37
33
<a name="l00022"></a>00022 <span class="preprocessor">#endif</span>
38
34
<a name="l00023"></a>00023 <span class="preprocessor"></span>
39
35
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;string&gt;</span>
40
 
<a name="l00025"></a>00025 <span class="preprocessor">#include "<a class="code" href="fx-0_88_82_2lib_2messages_8hh.html">messages.hh</a>"</span>
41
 
<a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="libofx-0_88_82_2inc_2libofx_8h.html">libofx.h</a>"</span>
42
 
<a name="l00027"></a>00027 <span class="preprocessor">#include "<a class="code" href="fx-0_88_82_2lib_2ofx__request_8hh.html">ofx_request.hh</a>"</span>
 
36
<a name="l00025"></a>00025 <span class="preprocessor">#include "<a class="code" href="fx-0_88_82_2lib_2messages_8hh.html" title="Message IO functionality.">messages.hh</a>"</span>
 
37
<a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="libofx-0_89_80_2inc_2libofx_8h.html" title="Main header file containing the LibOfx API.">libofx.h</a>"</span>
 
38
<a name="l00027"></a>00027 <span class="preprocessor">#include "<a class="code" href="fx-0_88_82_2lib_2ofx__request_8hh.html" title="Declaration of an OfxRequests to create an OFX file containing a generic request...">ofx_request.hh</a>"</span>
43
39
<a name="l00028"></a>00028 
44
40
<a name="l00029"></a>00029 <span class="keyword">using namespace </span>std;
45
41
<a name="l00030"></a>00030 
46
 
<a name="l00031"></a><a class="code" href="fx-0_88_82_2lib_2ofx__request_8cpp.html#db904c8d68b46495893e0db60a2acbcf">00031</a> string <a class="code" href="ofx__request_8cpp.html#db904c8d68b46495893e0db60a2acbcf">time_t_to_ofxdatetime</a>( time_t time )
 
42
<a name="l00031"></a><a class="code" href="fx-0_88_82_2lib_2ofx__request_8cpp.html#2f86a163dc83453b02683f1d20d6b3d6">00031</a> <span class="keywordtype">string</span> <a class="code" href="ofx__request_8cpp.html#2f86a163dc83453b02683f1d20d6b3d6">time_t_to_ofxdatetime</a>( time_t time )
47
43
<a name="l00032"></a>00032 {
48
44
<a name="l00033"></a>00033   <span class="keyword">static</span> <span class="keywordtype">char</span> buffer[51];
49
45
<a name="l00034"></a>00034 
53
49
<a name="l00038"></a>00038   <span class="keywordflow">return</span> string(buffer);
54
50
<a name="l00039"></a>00039 }
55
51
<a name="l00040"></a>00040 
56
 
<a name="l00041"></a><a class="code" href="fx-0_88_82_2lib_2ofx__request_8cpp.html#81beedfec4dc7c410153f3722fe67a77">00041</a> string <a class="code" href="ofx__request_8cpp.html#81beedfec4dc7c410153f3722fe67a77">time_t_to_ofxdate</a>( time_t time )
 
52
<a name="l00041"></a><a class="code" href="fx-0_88_82_2lib_2ofx__request_8cpp.html#34e84f6346e9d35feba51592e3db190c">00041</a> <span class="keywordtype">string</span> <a class="code" href="ofx__request_8cpp.html#34e84f6346e9d35feba51592e3db190c">time_t_to_ofxdate</a>( time_t time )
57
53
<a name="l00042"></a>00042 {
58
54
<a name="l00043"></a>00043   <span class="keyword">static</span> <span class="keywordtype">char</span> buffer[51];
59
55
<a name="l00044"></a>00044 
63
59
<a name="l00048"></a>00048   <span class="keywordflow">return</span> string(buffer);
64
60
<a name="l00049"></a>00049 }
65
61
<a name="l00050"></a>00050 
66
 
<a name="l00051"></a><a class="code" href="fx-0_88_82_2lib_2ofx__request_8cpp.html#e0c9348ddcb7da503b17069e9ea77f75">00051</a> string <a class="code" href="ofx__request_8cpp.html#e0c9348ddcb7da503b17069e9ea77f75">OfxHeader</a>(<span class="keywordtype">void</span>)
 
62
<a name="l00051"></a><a class="code" href="fx-0_88_82_2lib_2ofx__request_8hh.html#399259df57ba3945719d5282b3601af3">00051</a> <span class="keywordtype">string</span> <a class="code" href="ofx__request_8cpp.html#38a94b99f351615ee7a342f409db8499">OfxHeader</a>(<span class="keywordtype">void</span>)
67
63
<a name="l00052"></a>00052 {
68
64
<a name="l00053"></a>00053   <span class="keywordflow">return</span> string(<span class="stringliteral">"OFXHEADER:100\r\n"</span>
69
65
<a name="l00054"></a>00054                  <span class="stringliteral">"DATA:OFXSGML\r\n"</span>
70
 
<a name="l00055"></a>00055                  <span class="stringliteral">"VERSION:102\r\n"</span>
 
66
<a name="l00055"></a>00055                  <span class="stringliteral">"VERSION:103\r\n"</span>
71
67
<a name="l00056"></a>00056                  <span class="stringliteral">"SECURITY:NONE\r\n"</span>
72
68
<a name="l00057"></a>00057                  <span class="stringliteral">"ENCODING:USASCII\r\n"</span>
73
69
<a name="l00058"></a>00058                  <span class="stringliteral">"CHARSET:1252\r\n"</span>
74
70
<a name="l00059"></a>00059                  <span class="stringliteral">"COMPRESSION:NONE\r\n"</span>
75
71
<a name="l00060"></a>00060                  <span class="stringliteral">"OLDFILEUID:NONE\r\n"</span>
76
72
<a name="l00061"></a>00061                  <span class="stringliteral">"NEWFILEUID:"</span>)
77
 
<a name="l00062"></a>00062                  + <a class="code" href="ofx__request_8cpp.html#db904c8d68b46495893e0db60a2acbcf">time_t_to_ofxdatetime</a>( time(NULL) )
 
73
<a name="l00062"></a>00062                  + <a class="code" href="ofx__request_8cpp.html#2f86a163dc83453b02683f1d20d6b3d6">time_t_to_ofxdatetime</a>( time(NULL) )
78
74
<a name="l00063"></a>00063                  + string(<span class="stringliteral">"\r\n\r\n"</span>);
79
75
<a name="l00064"></a>00064 }
80
76
<a name="l00065"></a>00065 
81
 
<a name="l00066"></a>00066 <a class="code" href="classOfxAggregate.html">OfxAggregate</a> <a class="code" href="classOfxRequest.html#af46e4046c4baddbb096b1eb1b4c46a8">OfxRequest::SignOnRequest</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span>
 
77
<a name="l00066"></a>00066 <a class="code" href="classOfxAggregate.html" title="A single aggregate as described in the OFX 1.02 specification.">OfxAggregate</a> <a class="code" href="classOfxRequest.html#b653f985a56f4cff3e87a82c700f4450">OfxRequest::SignOnRequest</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span>
82
78
<a name="l00067"></a>00067 <span class="keyword"></span>{
83
 
<a name="l00068"></a>00068   <a class="code" href="classOfxAggregate.html">OfxAggregate</a> fiTag(<span class="stringliteral">"FI"</span>);
84
 
<a name="l00069"></a>00069   fiTag.Add( <span class="stringliteral">"ORG"</span>, <a class="code" href="classOfxRequest.html#656e286ea5ffc6918a71cd521c5b95d3">m_login</a>.<a class="code" href="structOfxFiLogin.html#4b44e09e0f415913fea555001554cd3d">org</a> );
85
 
<a name="l00070"></a>00070   <span class="keywordflow">if</span> ( strlen(<a class="code" href="classOfxRequest.html#656e286ea5ffc6918a71cd521c5b95d3">m_login</a>.<a class="code" href="structOfxFiLogin.html#a4758864493d6b42fa5168af2e245409">fid</a>) &gt; 0 )
86
 
<a name="l00071"></a>00071     fiTag.Add( <span class="stringliteral">"FID"</span>, <a class="code" href="classOfxRequest.html#656e286ea5ffc6918a71cd521c5b95d3">m_login</a>.<a class="code" href="structOfxFiLogin.html#a4758864493d6b42fa5168af2e245409">fid</a> );
 
79
<a name="l00068"></a>00068   <a class="code" href="classOfxAggregate.html" title="A single aggregate as described in the OFX 1.02 specification.">OfxAggregate</a> fiTag(<span class="stringliteral">"FI"</span>);
 
80
<a name="l00069"></a>00069   fiTag.Add( <span class="stringliteral">"ORG"</span>, <a class="code" href="classOfxRequest.html#9c831dd85c20955e6d062e8b5f660e00">m_login</a>.<a class="code" href="structOfxFiLogin.html#8fac30b84cbaab576b14c1c9c9f583b2">org</a> );
 
81
<a name="l00070"></a>00070   <span class="keywordflow">if</span> ( strlen(<a class="code" href="classOfxRequest.html#9c831dd85c20955e6d062e8b5f660e00">m_login</a>.<a class="code" href="structOfxFiLogin.html#ae44e5ea969520f461489956fce0ed58">fid</a>) &gt; 0 )
 
82
<a name="l00071"></a>00071     fiTag.Add( <span class="stringliteral">"FID"</span>, <a class="code" href="classOfxRequest.html#9c831dd85c20955e6d062e8b5f660e00">m_login</a>.<a class="code" href="structOfxFiLogin.html#ae44e5ea969520f461489956fce0ed58">fid</a> );
87
83
<a name="l00072"></a>00072 
88
 
<a name="l00073"></a>00073   <a class="code" href="classOfxAggregate.html">OfxAggregate</a> sonrqTag(<span class="stringliteral">"SONRQ"</span>);
89
 
<a name="l00074"></a>00074   sonrqTag.Add( <span class="stringliteral">"DTCLIENT"</span>, <a class="code" href="ofx__request_8cpp.html#db904c8d68b46495893e0db60a2acbcf">time_t_to_ofxdatetime</a>( time(NULL) ) );
90
 
<a name="l00075"></a>00075   sonrqTag.Add( <span class="stringliteral">"USERID"</span>, <a class="code" href="classOfxRequest.html#656e286ea5ffc6918a71cd521c5b95d3">m_login</a>.<a class="code" href="structOfxFiLogin.html#7513251178c3f4d9b665132436428cdf">userid</a>);
91
 
<a name="l00076"></a>00076   sonrqTag.Add( <span class="stringliteral">"USERPASS"</span>, <a class="code" href="classOfxRequest.html#656e286ea5ffc6918a71cd521c5b95d3">m_login</a>.<a class="code" href="structOfxFiLogin.html#2995949d8c307d2434ad82a61dbb6f1e">userpass</a>);
 
84
<a name="l00073"></a>00073   <a class="code" href="classOfxAggregate.html" title="A single aggregate as described in the OFX 1.02 specification.">OfxAggregate</a> sonrqTag(<span class="stringliteral">"SONRQ"</span>);
 
85
<a name="l00074"></a>00074   sonrqTag.Add( <span class="stringliteral">"DTCLIENT"</span>, <a class="code" href="ofx__request_8cpp.html#2f86a163dc83453b02683f1d20d6b3d6">time_t_to_ofxdatetime</a>( time(NULL) ) );
 
86
<a name="l00075"></a>00075   sonrqTag.Add( <span class="stringliteral">"USERID"</span>, <a class="code" href="classOfxRequest.html#9c831dd85c20955e6d062e8b5f660e00">m_login</a>.<a class="code" href="structOfxFiLogin.html#655c23be41b28f250175501414523825">userid</a>);
 
87
<a name="l00076"></a>00076   sonrqTag.Add( <span class="stringliteral">"USERPASS"</span>, <a class="code" href="classOfxRequest.html#9c831dd85c20955e6d062e8b5f660e00">m_login</a>.<a class="code" href="structOfxFiLogin.html#8507687737334b8e5559d8aafe190878">userpass</a>);
92
88
<a name="l00077"></a>00077   sonrqTag.Add( <span class="stringliteral">"LANGUAGE"</span>,<span class="stringliteral">"ENG"</span>);
93
89
<a name="l00078"></a>00078   sonrqTag.Add( fiTag );
94
90
<a name="l00079"></a>00079   sonrqTag.Add( <span class="stringliteral">"APPID"</span>,<span class="stringliteral">"QWIN"</span>);
95
 
<a name="l00080"></a>00080   sonrqTag.Add( <span class="stringliteral">"APPVER"</span>,<span class="stringliteral">"1200"</span>);
 
91
<a name="l00080"></a>00080   sonrqTag.Add( <span class="stringliteral">"APPVER"</span>,<span class="stringliteral">"1600"</span>);
96
92
<a name="l00081"></a>00081   
97
 
<a name="l00082"></a>00082   <a class="code" href="classOfxAggregate.html">OfxAggregate</a> signonmsgTag(<span class="stringliteral">"SIGNONMSGSRQV1"</span>);
 
93
<a name="l00082"></a>00082   <a class="code" href="classOfxAggregate.html" title="A single aggregate as described in the OFX 1.02 specification.">OfxAggregate</a> signonmsgTag(<span class="stringliteral">"SIGNONMSGSRQV1"</span>);
98
94
<a name="l00083"></a>00083   signonmsgTag.Add( sonrqTag );
99
95
<a name="l00084"></a>00084 
100
96
<a name="l00085"></a>00085   <span class="keywordflow">return</span> signonmsgTag;
101
97
<a name="l00086"></a>00086 }
102
98
<a name="l00087"></a>00087 
103
 
<a name="l00088"></a>00088 <a class="code" href="classOfxAggregate.html">OfxAggregate</a> <a class="code" href="classOfxRequest.html#a544b825f95778918ab737d985466eb2">OfxRequest::RequestMessage</a>(<span class="keyword">const</span> string&amp; _msgType, <span class="keyword">const</span> string&amp; _trnType, <span class="keyword">const</span> <a class="code" href="classOfxAggregate.html">OfxAggregate</a>&amp; _request)<span class="keyword"> const</span>
 
99
<a name="l00088"></a>00088 <a class="code" href="classOfxAggregate.html" title="A single aggregate as described in the OFX 1.02 specification.">OfxAggregate</a> <a class="code" href="classOfxRequest.html#e56ceb8ef12b9431dcd4d63eec60a377">OfxRequest::RequestMessage</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; _msgType, <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; _trnType, <span class="keyword">const</span> <a class="code" href="classOfxAggregate.html" title="A single aggregate as described in the OFX 1.02 specification.">OfxAggregate</a>&amp; _request)<span class="keyword"> const</span>
104
100
<a name="l00089"></a>00089 <span class="keyword"></span>{
105
 
<a name="l00090"></a>00090   <a class="code" href="classOfxAggregate.html">OfxAggregate</a> trnrqTag( _trnType+<span class="stringliteral">"TRNRQ"</span> );
106
 
<a name="l00091"></a>00091   trnrqTag.Add( <span class="stringliteral">"TRNUID"</span>, <a class="code" href="ofx__request_8cpp.html#db904c8d68b46495893e0db60a2acbcf">time_t_to_ofxdatetime</a>( time(NULL) ) );
 
101
<a name="l00090"></a>00090   <a class="code" href="classOfxAggregate.html" title="A single aggregate as described in the OFX 1.02 specification.">OfxAggregate</a> trnrqTag( _trnType+<span class="stringliteral">"TRNRQ"</span> );
 
102
<a name="l00091"></a>00091   trnrqTag.Add( <span class="stringliteral">"TRNUID"</span>, <a class="code" href="ofx__request_8cpp.html#2f86a163dc83453b02683f1d20d6b3d6">time_t_to_ofxdatetime</a>( time(NULL) ) );
107
103
<a name="l00092"></a>00092   trnrqTag.Add( <span class="stringliteral">"CLTCOOKIE"</span>,<span class="stringliteral">"1"</span> ); 
108
104
<a name="l00093"></a>00093   trnrqTag.Add( _request );
109
105
<a name="l00094"></a>00094     
110
 
<a name="l00095"></a>00095   <a class="code" href="classOfxAggregate.html">OfxAggregate</a> result( _msgType+<span class="stringliteral">"MSGSRQV1"</span> );
 
106
<a name="l00095"></a>00095   <a class="code" href="classOfxAggregate.html" title="A single aggregate as described in the OFX 1.02 specification.">OfxAggregate</a> result( _msgType+<span class="stringliteral">"MSGSRQV1"</span> );
111
107
<a name="l00096"></a>00096   result.Add( trnrqTag );
112
108
<a name="l00097"></a>00097 
113
109
<a name="l00098"></a>00098   <span class="keywordflow">return</span> result;
114
110
<a name="l00099"></a>00099 }
115
 
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri Aug 25 13:25:22 2006 for LibOFX by&nbsp;
 
111
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Mon Nov 19 20:27:59 2007 for LibOFX by&nbsp;
116
112
<a href="http://www.doxygen.org/index.html">
117
 
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6 </small></address>
 
113
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
118
114
</body>
119
115
</html>