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 10

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 10 wfjm
// $Id: RtclArgs.ipp 373 2011-03-26 08:54:27Z mueller $
2
//
3
// Copyright 2011- by Walter F.J. Mueller 
4
//
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
// 2011-03-26   373   1.0.2  add SetResult(string)
17
// 2011-03-05   366   1.0.1  add NDone(), NOptMiss(), SetResult();
18
// 2011-02-26   364   1.0    Initial version
19
// 2011-02-18   362   0.1    First draft
20
// ---------------------------------------------------------------------------
21
 
22
/*!
23
  \file
24
  \version $Id: RtclArgs.ipp 373 2011-03-26 08:54:27Z mueller $
25
  \brief   Implemenation (inline) of RtclArgs.
26
*/
27
 
28
#include "Rtcl.hpp"
29
 
30
// all method definitions in namespace Retro (avoid using in includes...)
31
namespace Retro {
32
 
33
//------------------------------------------+-----------------------------------
34
//! FIXME_docs
35
 
36
inline Tcl_Interp* RtclArgs::Interp() const
37
{
38
  return fpInterp;
39
}
40
 
41
//------------------------------------------+-----------------------------------
42
//! FIXME_docs
43
 
44
inline int RtclArgs::Objc() const
45
{
46
  return fObjc;
47
}
48
 
49
//------------------------------------------+-----------------------------------
50
//! FIXME_docs
51
 
52
inline bool RtclArgs::OptValid() const
53
{
54
  return !fOptErr;
55
}
56
 
57
//------------------------------------------+-----------------------------------
58
//! FIXME_docs
59
 
60
inline size_t RtclArgs::NDone() const
61
{
62
  return fNDone;
63
}
64
 
65
//------------------------------------------+-----------------------------------
66
//! FIXME_docs
67
 
68
inline size_t RtclArgs::NOptMiss() const
69
{
70
  return fNOptMiss;
71
}
72
 
73
//------------------------------------------+-----------------------------------
74
//! FIXME_docs
75
 
76
inline void RtclArgs::SetResult(const std::string& str)
77
{
78
  Rtcl::SetResult(fpInterp, str);
79
  return;
80
}
81
 
82
//------------------------------------------+-----------------------------------
83
//! FIXME_docs
84
 
85
inline void RtclArgs::SetResult(std::ostringstream& sos)
86
{
87
  Rtcl::SetResult(fpInterp, sos);
88
  return;
89
}
90
 
91
//------------------------------------------+-----------------------------------
92
//! FIXME_docs
93
 
94
inline void RtclArgs::SetResult(int val)
95
{
96
  Tcl_SetObjResult(fpInterp, Tcl_NewIntObj(val));
97
  return;
98
}
99
 
100
//------------------------------------------+-----------------------------------
101
//! FIXME_docs
102
 
103
inline void RtclArgs::SetResult(double val)
104
{
105
  Tcl_SetObjResult(fpInterp, Tcl_NewDoubleObj(val));
106
  return;
107
}
108
 
109
//------------------------------------------+-----------------------------------
110
//! FIXME_docs
111
 
112
inline void RtclArgs::SetResult(Tcl_Obj* pobj)
113
{
114
  Tcl_SetObjResult(fpInterp, pobj);
115
  return;
116
}
117
 
118
//------------------------------------------+-----------------------------------
119
//! FIXME_docs
120
 
121
inline void RtclArgs::AppendResult(const std::string& str)
122
{
123
  Tcl_AppendResult(fpInterp, str.c_str(), NULL);
124
  return;
125
}
126
 
127
//------------------------------------------+-----------------------------------
128
//! FIXME_docs
129
 
130
inline void RtclArgs::AppendResult(std::ostringstream& sos)
131
{
132
  AppendResult(sos.str());
133
  return;
134
}
135
 
136
//------------------------------------------+-----------------------------------
137
//! FIXME_docs
138
 
139
inline void RtclArgs::AppendResultLines(std::ostringstream& sos)
140
{
141
  AppendResultLines(sos.str());
142
  return;
143
}
144
 
145
//------------------------------------------+-----------------------------------
146
//! FIXME_docs
147
 
148
inline Tcl_Obj* RtclArgs::operator[](size_t ind) const
149
{
150
  return fObjv[ind];
151
}
152
 
153
} // end namespace Retro

powered by: WebSVN 2.1.0

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