w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
RtclArgs.ipp
Go to the documentation of this file.
1// $Id: RtclArgs.ipp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2011-2013 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2013-03-05 495 1.0.8 add SetResult(bool)
8// 2013-03-02 494 1.0.7 add Quit() method
9// 2013-02-01 479 1.0.5 add Objv() method
10// 2011-03-26 373 1.0.2 add SetResult(string)
11// 2011-03-05 366 1.0.1 add NDone(), NOptMiss(), SetResult();
12// 2011-02-26 364 1.0 Initial version
13// 2011-02-18 362 0.1 First draft
14// ---------------------------------------------------------------------------
15
20#include "Rtcl.hpp"
21
22// all method definitions in namespace Retro
23namespace Retro {
24
25//------------------------------------------+-----------------------------------
27
28inline Tcl_Interp* RtclArgs::Interp() const
29{
30 return fpInterp;
31}
32
33//------------------------------------------+-----------------------------------
35
36inline int RtclArgs::Objc() const
37{
38 return fObjc;
39}
40
41//------------------------------------------+-----------------------------------
43
44inline Tcl_Obj* const * RtclArgs::Objv() const
45{
46 return fObjv;
47}
48
49//------------------------------------------+-----------------------------------
51
52inline bool RtclArgs::OptValid() const
53{
54 return !fOptErr;
55}
56
57//------------------------------------------+-----------------------------------
59
60inline size_t RtclArgs::NDone() const
61{
62 return fNDone;
63}
64
65//------------------------------------------+-----------------------------------
67
68inline size_t RtclArgs::NOptMiss() const
69{
70 return fNOptMiss;
71}
72
73//------------------------------------------+-----------------------------------
75
76inline void RtclArgs::SetResult(const std::string& str)
77{
79 return;
80}
81
82//------------------------------------------+-----------------------------------
84
85inline void RtclArgs::SetResult(std::ostringstream& sos)
86{
88 return;
89}
90
91//------------------------------------------+-----------------------------------
93
94inline void RtclArgs::SetResult(bool val)
95{
96 Tcl_SetObjResult(fpInterp, Tcl_NewBooleanObj(val));
97 return;
98}
99
100//------------------------------------------+-----------------------------------
102
103inline void RtclArgs::SetResult(int val)
104{
105 Tcl_SetObjResult(fpInterp, Tcl_NewIntObj(val));
106 return;
107}
108
109//------------------------------------------+-----------------------------------
111
112inline void RtclArgs::SetResult(double val)
113{
114 Tcl_SetObjResult(fpInterp, Tcl_NewDoubleObj(val));
115 return;
116}
117
118//------------------------------------------+-----------------------------------
120
121inline void RtclArgs::SetResult(Tcl_Obj* pobj)
122{
123 Tcl_SetObjResult(fpInterp, pobj);
124 return;
125}
126
127//------------------------------------------+-----------------------------------
129
130inline void RtclArgs::AppendResult(const std::string& str)
131{
132 Tcl_AppendResult(fpInterp, str.c_str(), NULL);
133 return;
134}
135
136//------------------------------------------+-----------------------------------
138
139inline void RtclArgs::AppendResult(std::ostringstream& sos)
140{
141 AppendResult(sos.str());
142 return;
143}
144
145//------------------------------------------+-----------------------------------
147
148inline void RtclArgs::AppendResultLines(std::ostringstream& sos)
149{
150 AppendResultLines(sos.str());
151 return;
152}
153
154//------------------------------------------+-----------------------------------
156
157inline int RtclArgs::Quit(const std::string& str)
158{
159 Tcl_AppendResult(fpInterp, str.c_str(), NULL);
160 return TCL_ERROR;
161}
162
163//------------------------------------------+-----------------------------------
165
166inline Tcl_Obj* RtclArgs::operator[](size_t ind) const
167{
168 return fObjv[ind];
169}
170
171} // end namespace Retro
void AppendResultLines(const std::string &str)
FIXME_docs.
Definition: RtclArgs.cpp:484
Tcl_Obj *const * Objv() const
FIXME_docs.
Definition: RtclArgs.ipp:44
Tcl_Obj * operator[](size_t ind) const
FIXME_docs.
Definition: RtclArgs.ipp:166
size_t fNOptMiss
number of missed optional args
Definition: RtclArgs.hpp:140
Tcl_Obj *const * fObjv
original args vector
Definition: RtclArgs.hpp:138
void AppendResult(const char *str,...)
FIXME_docs.
Definition: RtclArgs.cpp:471
bool OptValid() const
FIXME_docs.
Definition: RtclArgs.ipp:52
bool fOptErr
option processing error flag
Definition: RtclArgs.hpp:142
int Quit(const std::string &str)
FIXME_docs.
Definition: RtclArgs.ipp:157
void SetResult(const std::string &str)
FIXME_docs.
Definition: RtclArgs.ipp:76
int Objc() const
FIXME_docs.
Definition: RtclArgs.ipp:36
size_t fNDone
number of processed args
Definition: RtclArgs.hpp:139
size_t NOptMiss() const
FIXME_docs.
Definition: RtclArgs.ipp:68
Tcl_Interp * fpInterp
pointer to tcl interpreter
Definition: RtclArgs.hpp:136
size_t NDone() const
FIXME_docs.
Definition: RtclArgs.ipp:60
Tcl_Interp * Interp() const
FIXME_docs.
Definition: RtclArgs.ipp:28
size_t fObjc
original args count
Definition: RtclArgs.hpp:137
void SetResult(Tcl_Interp *interp, const std::string &str)
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47