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

« back to all changes in this revision

Viewing changes to doc/html/ofx__request_8cpp-source.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:
 
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">
 
3
<title>LibOFX: ofx_request.cpp Source File</title>
 
4
<link href="doxygen.css" rel="stylesheet" type="text/css">
 
5
</head><body>
 
6
<!-- Generated by Doxygen 1.3.9.1 -->
 
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>
 
10
<h1>ofx_request.cpp</h1><a href="ofx__request_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/***************************************************************************</span>
 
11
00002 <span class="comment">         ofx_request.cpp </span>
 
12
00003 <span class="comment">                             -------------------</span>
 
13
00004 <span class="comment">    copyright            : (C) 2005 by Ace Jones</span>
 
14
00005 <span class="comment">    email                : acejones@users.sourceforge.net</span>
 
15
00006 <span class="comment">***************************************************************************/</span>
 
16
00011 <span class="comment">/***************************************************************************</span>
 
17
00012 <span class="comment"> *                                                                         *</span>
 
18
00013 <span class="comment"> *   This program is free software; you can redistribute it and/or modify  *</span>
 
19
00014 <span class="comment"> *   it under the terms of the GNU General Public License as published by  *</span>
 
20
00015 <span class="comment"> *   the Free Software Foundation; either version 2 of the License, or     *</span>
 
21
00016 <span class="comment"> *   (at your option) any later version.                                   *</span>
 
22
00017 <span class="comment"> *                                                                         *</span>
 
23
00018 <span class="comment"> ***************************************************************************/</span>
 
24
00019 
 
25
00020 <span class="preprocessor">#ifdef HAVE_CONFIG_H</span>
 
26
00021 <span class="preprocessor"></span><span class="preprocessor">#include &lt;config.h&gt;</span>
 
27
00022 <span class="preprocessor">#endif</span>
 
28
00023 <span class="preprocessor"></span>
 
29
00024 <span class="preprocessor">#include &lt;string&gt;</span>
 
30
00025 <span class="preprocessor">#include "<a class="code" href="messages_8hh.html">messages.hh</a>"</span>
 
31
00026 <span class="preprocessor">#include "<a class="code" href="libofx-0_88_80_2inc_2libofx_8h.html">libofx.h</a>"</span>
 
32
00027 <span class="preprocessor">#include "<a class="code" href="ofx__request_8hh.html">ofx_request.hh</a>"</span>
 
33
00028 
 
34
00029 <span class="keyword">using</span> <span class="keyword">namespace </span>std;
 
35
00030 
 
36
00031 string time_t_to_ofxdatetime( time_t time )
 
37
00032 {
 
38
00033   <span class="keyword">static</span> <span class="keywordtype">char</span> buffer[51];
 
39
00034 
 
40
00035   strftime( buffer, 50, <span class="stringliteral">"%Y%m%d%H%M%S.000"</span>, localtime(&amp;time) );
 
41
00036   buffer[50] = 0;
 
42
00037   
 
43
00038   <span class="keywordflow">return</span> string(buffer);
 
44
00039 }
 
45
00040 
 
46
00041 string time_t_to_ofxdate( time_t time )
 
47
00042 {
 
48
00043   <span class="keyword">static</span> <span class="keywordtype">char</span> buffer[51];
 
49
00044 
 
50
00045   strftime( buffer, 50, <span class="stringliteral">"%Y%m%d"</span>, localtime(&amp;time) );
 
51
00046   buffer[50] = 0;
 
52
00047   
 
53
00048   <span class="keywordflow">return</span> string(buffer);
 
54
00049 }
 
55
00050 
 
56
00051 string OfxHeader(<span class="keywordtype">void</span>)
 
57
00052 {
 
58
00053   <span class="keywordflow">return</span> string(<span class="stringliteral">"OFXHEADER:100\r\n"</span>
 
59
00054                  <span class="stringliteral">"DATA:OFXSGML\r\n"</span>
 
60
00055                  <span class="stringliteral">"VERSION:102\r\n"</span>
 
61
00056                  <span class="stringliteral">"SECURITY:NONE\r\n"</span>
 
62
00057                  <span class="stringliteral">"ENCODING:USASCII\r\n"</span>
 
63
00058                  <span class="stringliteral">"CHARSET:1252\r\n"</span>
 
64
00059                  <span class="stringliteral">"COMPRESSION:NONE\r\n"</span>
 
65
00060                  <span class="stringliteral">"OLDFILEUID:NONE\r\n"</span>
 
66
00061                  <span class="stringliteral">"NEWFILEUID:"</span>)
 
67
00062                  + time_t_to_ofxdatetime( time(NULL) )
 
68
00063                  + string(<span class="stringliteral">"\r\n\r\n"</span>);
 
69
00064 }
 
70
00065 
 
71
<a name="l00066"></a><a class="code" href="classOfxRequest.html#b0">00066</a> <a class="code" href="classOfxAggregate.html">OfxAggregate</a> <a class="code" href="classOfxRequest.html#b0">OfxRequest::SignOnRequest</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span>
 
72
00067 <span class="keyword"></span>{
 
73
00068   <a class="code" href="classOfxAggregate.html">OfxAggregate</a> fiTag(<span class="stringliteral">"FI"</span>);
 
74
00069   fiTag.<a class="code" href="classOfxAggregate.html#a1">Add</a>( <span class="stringliteral">"ORG"</span>, m_login.<a class="code" href="structOfxFiLogin.html#o1">org</a> );
 
75
00070   <span class="keywordflow">if</span> ( strlen(m_login.<a class="code" href="structOfxFiLogin.html#o0">fid</a>) &gt; 0 )
 
76
00071     fiTag.<a class="code" href="classOfxAggregate.html#a1">Add</a>( <span class="stringliteral">"FID"</span>, m_login.<a class="code" href="structOfxFiLogin.html#o0">fid</a> );
 
77
00072 
 
78
00073   <a class="code" href="classOfxAggregate.html">OfxAggregate</a> sonrqTag(<span class="stringliteral">"SONRQ"</span>);
 
79
00074   sonrqTag.<a class="code" href="classOfxAggregate.html#a1">Add</a>( <span class="stringliteral">"DTCLIENT"</span>, time_t_to_ofxdatetime( time(NULL) ) );
 
80
00075   sonrqTag.<a class="code" href="classOfxAggregate.html#a1">Add</a>( <span class="stringliteral">"USERID"</span>, m_login.<a class="code" href="structOfxFiLogin.html#o2">userid</a>);
 
81
00076   sonrqTag.<a class="code" href="classOfxAggregate.html#a1">Add</a>( <span class="stringliteral">"USERPASS"</span>, m_login.<a class="code" href="structOfxFiLogin.html#o3">userpass</a>);
 
82
00077   sonrqTag.<a class="code" href="classOfxAggregate.html#a1">Add</a>( <span class="stringliteral">"LANGUAGE"</span>,<span class="stringliteral">"ENG"</span>);
 
83
00078   sonrqTag.<a class="code" href="classOfxAggregate.html#a1">Add</a>( fiTag );
 
84
00079   sonrqTag.<a class="code" href="classOfxAggregate.html#a1">Add</a>( <span class="stringliteral">"APPID"</span>,<span class="stringliteral">"QWIN"</span>);
 
85
00080   sonrqTag.<a class="code" href="classOfxAggregate.html#a1">Add</a>( <span class="stringliteral">"APPVER"</span>,<span class="stringliteral">"1200"</span>);
 
86
00081   
 
87
00082   <a class="code" href="classOfxAggregate.html">OfxAggregate</a> signonmsgTag(<span class="stringliteral">"SIGNONMSGSRQV1"</span>);
 
88
00083   signonmsgTag.<a class="code" href="classOfxAggregate.html#a1">Add</a>( sonrqTag );
 
89
00084 
 
90
00085   <span class="keywordflow">return</span> signonmsgTag;
 
91
00086 }
 
92
00087 
 
93
<a name="l00088"></a><a class="code" href="classOfxRequest.html#b1">00088</a> <a class="code" href="classOfxAggregate.html">OfxAggregate</a> <a class="code" href="classOfxRequest.html#b1">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>
 
94
00089 <span class="keyword"></span>{
 
95
00090   <a class="code" href="classOfxAggregate.html">OfxAggregate</a> trnrqTag( _trnType+<span class="stringliteral">"TRNRQ"</span> );
 
96
00091   trnrqTag.<a class="code" href="classOfxAggregate.html#a1">Add</a>( <span class="stringliteral">"TRNUID"</span>, time_t_to_ofxdatetime( time(NULL) ) );
 
97
00092   trnrqTag.<a class="code" href="classOfxAggregate.html#a1">Add</a>( <span class="stringliteral">"CLTCOOKIE"</span>,<span class="stringliteral">"1"</span> ); 
 
98
00093   trnrqTag.<a class="code" href="classOfxAggregate.html#a1">Add</a>( _request );
 
99
00094     
 
100
00095   <a class="code" href="classOfxAggregate.html">OfxAggregate</a> result( _msgType+<span class="stringliteral">"MSGSRQV1"</span> );
 
101
00096   result.<a class="code" href="classOfxAggregate.html#a1">Add</a>( trnrqTag );
 
102
00097 
 
103
00098   <span class="keywordflow">return</span> result;
 
104
00099 }
 
105
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Sun Jul 31 15:38:35 2005 for LibOFX by&nbsp;
 
106
<a href="http://www.doxygen.org/index.html">
 
107
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.3.9.1 </small></address>
 
108
</body>
 
109
</html>