OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.6/] [tools/] [src/] [librtcltools/] [RtclArgs.ipp] - Blame information for rev 24

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 19 wfjm
// $Id: RtclArgs.ipp 495 2013-03-06 17:13:48Z mueller $
2 10 wfjm
//
3 19 wfjm
// Copyright 2011-2013 by Walter F.J. Mueller 
4 10 wfjm
//
5
// This program is free software; you may redistribute and/or modify it under
6
// the terms of the GNU General Public License as published by the Free
7
// Software Foundation, either version 2, or at your option any later version.
8
//
9
// This program is distributed in the hope that it will be useful, but
10
// WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
// or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
// for complete details.
13
//
14
// Revision History:
15
// Date         Rev Version  Comment
16 19 wfjm
// 2013-03-05   495   1.0.8  add SetResult(bool)
17
// 2013-03-02   494   1.0.7  add Quit() method
18
// 2013-02-01   479   1.0.5  add Objv() method
19 10 wfjm
// 2011-03-26   373   1.0.2  add SetResult(string)
20
// 2011-03-05   366   1.0.1  add NDone(), NOptMiss(), SetResult();
21
// 2011-02-26   364   1.0    Initial version
22
// 2011-02-18   362   0.1    First draft
23
// ---------------------------------------------------------------------------
24
 
25
/*!
26
  \file
27 19 wfjm
  \version $Id: RtclArgs.ipp 495 2013-03-06 17:13:48Z mueller $
28 10 wfjm
  \brief   Implemenation (inline) of RtclArgs.
29
*/
30
 
31
#include "Rtcl.hpp"
32
 
33 19 wfjm
// all method definitions in namespace Retro
34 10 wfjm
namespace Retro {
35
 
36
//------------------------------------------+-----------------------------------
37
//! FIXME_docs
38
 
39
inline Tcl_Interp* RtclArgs::Interp() const
40
{
41
  return fpInterp;
42
}
43
 
44
//------------------------------------------+-----------------------------------
45
//! FIXME_docs
46
 
47
inline int RtclArgs::Objc() const
48
{
49
  return fObjc;
50
}
51
 
52
//------------------------------------------+-----------------------------------
53
//! FIXME_docs
54
 
55 19 wfjm
inline Tcl_Obj* const * RtclArgs::Objv() const
56
{
57
  return fObjv;
58
}
59
 
60
//------------------------------------------+-----------------------------------
61
//! FIXME_docs
62
 
63 10 wfjm
inline bool RtclArgs::OptValid() const
64
{
65
  return !fOptErr;
66
}
67
 
68
//------------------------------------------+-----------------------------------
69
//! FIXME_docs
70
 
71
inline size_t RtclArgs::NDone() const
72
{
73
  return fNDone;
74
}
75
 
76
//------------------------------------------+-----------------------------------
77
//! FIXME_docs
78
 
79
inline size_t RtclArgs::NOptMiss() const
80
{
81
  return fNOptMiss;
82
}
83
 
84
//------------------------------------------+-----------------------------------
85
//! FIXME_docs
86
 
87
inline void RtclArgs::SetResult(const std::string& str)
88
{
89
  Rtcl::SetResult(fpInterp, str);
90
  return;
91
}
92
 
93
//------------------------------------------+-----------------------------------
94
//! FIXME_docs
95
 
96
inline void RtclArgs::SetResult(std::ostringstream& sos)
97
{
98
  Rtcl::SetResult(fpInterp, sos);
99
  return;
100
}
101
 
102
//------------------------------------------+-----------------------------------
103
//! FIXME_docs
104
 
105 19 wfjm
inline void RtclArgs::SetResult(bool val)
106
{
107
  Tcl_SetObjResult(fpInterp, Tcl_NewBooleanObj(val));
108
  return;
109
}
110
 
111
//------------------------------------------+-----------------------------------
112
//! FIXME_docs
113
 
114 10 wfjm
inline void RtclArgs::SetResult(int val)
115
{
116
  Tcl_SetObjResult(fpInterp, Tcl_NewIntObj(val));
117
  return;
118
}
119
 
120
//------------------------------------------+-----------------------------------
121
//! FIXME_docs
122
 
123
inline void RtclArgs::SetResult(double val)
124
{
125
  Tcl_SetObjResult(fpInterp, Tcl_NewDoubleObj(val));
126
  return;
127
}
128
 
129
//------------------------------------------+-----------------------------------
130
//! FIXME_docs
131
 
132
inline void RtclArgs::SetResult(Tcl_Obj* pobj)
133
{
134
  Tcl_SetObjResult(fpInterp, pobj);
135
  return;
136
}
137
 
138
//------------------------------------------+-----------------------------------
139
//! FIXME_docs
140
 
141
inline void RtclArgs::AppendResult(const std::string& str)
142
{
143
  Tcl_AppendResult(fpInterp, str.c_str(), NULL);
144
  return;
145
}
146
 
147
//------------------------------------------+-----------------------------------
148
//! FIXME_docs
149
 
150
inline void RtclArgs::AppendResult(std::ostringstream& sos)
151
{
152
  AppendResult(sos.str());
153
  return;
154
}
155
 
156
//------------------------------------------+-----------------------------------
157
//! FIXME_docs
158
 
159
inline void RtclArgs::AppendResultLines(std::ostringstream& sos)
160
{
161
  AppendResultLines(sos.str());
162
  return;
163
}
164
 
165
//------------------------------------------+-----------------------------------
166
//! FIXME_docs
167
 
168 19 wfjm
inline int RtclArgs::Quit(const std::string& str)
169
{
170
  Tcl_AppendResult(fpInterp, str.c_str(), NULL);
171
  return TCL_ERROR;
172
}
173
 
174
//------------------------------------------+-----------------------------------
175
//! FIXME_docs
176
 
177 10 wfjm
inline Tcl_Obj* RtclArgs::operator[](size_t ind) const
178
{
179
  return fObjv[ind];
180
}
181
 
182
} // end namespace Retro

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.