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>G4VBasicShell class Reference</title> |
---|
4 | <link href="doxygen.css" rel="stylesheet" type="text/css"> |
---|
5 | </head><body> |
---|
6 | <!-- Generated by Doxygen 1.3.4 --> |
---|
7 | <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div> |
---|
8 | <h1>G4VBasicShell Class Reference</h1><code>#include <<a class="el" href="G4VBasicShell_8hh-source.html">G4VBasicShell.hh</a>></code> |
---|
9 | <p> |
---|
10 | Inheritance diagram for G4VBasicShell:<p><center><img src="classG4VBasicShell__inherit__graph.png" border="0" usemap="#G4VBasicShell__inherit__map" alt="Inheritance graph"></center> |
---|
11 | <map name="G4VBasicShell__inherit__map"> |
---|
12 | <area href="classG4UIGainServer.html" shape="rect" coords="7,440,199,1448" alt=""> |
---|
13 | <area href="classG4UIQt.html" shape="rect" coords="223,664,410,1224" alt=""> |
---|
14 | <area href="classG4UIterminal.html" shape="rect" coords="434,800,589,1088" alt=""> |
---|
15 | <area href="classG4UIWin32.html" shape="rect" coords="613,664,767,1224" alt=""> |
---|
16 | <area href="classG4UIXaw.html" shape="rect" coords="791,800,946,1088" alt=""> |
---|
17 | <area href="classG4UIXm.html" shape="rect" coords="970,720,1165,1168" alt=""> |
---|
18 | </map> |
---|
19 | <center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classG4VBasicShell-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> |
---|
20 | <tr><td></td></tr> |
---|
21 | <tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr> |
---|
22 | <tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#a0">G4VBasicShell</a> ()</td></tr> |
---|
23 | |
---|
24 | <tr><td class="memItemLeft" nowrap align=right valign=top>virtual </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#a1">~G4VBasicShell</a> ()</td></tr> |
---|
25 | |
---|
26 | <tr><td class="memItemLeft" nowrap align=right valign=top>virtual G4UIsession * </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#a2">SessionStart</a> ()=0</td></tr> |
---|
27 | |
---|
28 | <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#a3">PauseSessionStart</a> (G4String Prompt)=0</td></tr> |
---|
29 | |
---|
30 | <tr><td colspan=2><br><h2>Protected Member Functions</h2></td></tr> |
---|
31 | <tr><td class="memItemLeft" nowrap align=right valign=top>G4String </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#b0">ModifyToFullPathCommand</a> (const char *aCommandLine)</td></tr> |
---|
32 | |
---|
33 | <tr><td class="memItemLeft" nowrap align=right valign=top>G4String </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#b1">GetCurrentWorkingDirectory</a> ()</td></tr> |
---|
34 | |
---|
35 | <tr><td class="memItemLeft" nowrap align=right valign=top>G4bool </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#b2">ChangeDirectory</a> (const char *newDir)</td></tr> |
---|
36 | |
---|
37 | <tr><td class="memItemLeft" nowrap align=right valign=top>G4UIcommandTree * </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#b3">FindDirectory</a> (const char *dirName)</td></tr> |
---|
38 | |
---|
39 | <tr><td class="memItemLeft" nowrap align=right valign=top>G4UIcommand * </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#b4">FindCommand</a> (const char *commandName)</td></tr> |
---|
40 | |
---|
41 | <tr><td class="memItemLeft" nowrap align=right valign=top>G4String </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#b5">Complete</a> (G4String)</td></tr> |
---|
42 | |
---|
43 | <tr><td class="memItemLeft" nowrap align=right valign=top>G4String </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#b6">FindMatchingPath</a> (G4UIcommandTree *, G4String)</td></tr> |
---|
44 | |
---|
45 | <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#b7">ExecuteCommand</a> (G4String)</td></tr> |
---|
46 | |
---|
47 | <tr><td class="memItemLeft" nowrap align=right valign=top>virtual G4bool </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#b8">GetHelpChoice</a> (G4int &)=0</td></tr> |
---|
48 | |
---|
49 | <tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#b9">ExitHelp</a> ()=0</td></tr> |
---|
50 | |
---|
51 | <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#b10">ApplyShellCommand</a> (G4String, G4bool &, G4bool &)</td></tr> |
---|
52 | |
---|
53 | <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#b11">ShowCurrent</a> (G4String)</td></tr> |
---|
54 | |
---|
55 | <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#b12">ChangeDirectoryCommand</a> (G4String)</td></tr> |
---|
56 | |
---|
57 | <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#b13">ListDirectory</a> (G4String)</td></tr> |
---|
58 | |
---|
59 | <tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#b14">TerminalHelp</a> (G4String)</td></tr> |
---|
60 | |
---|
61 | <tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr> |
---|
62 | <tr><td class="memItemLeft" nowrap align=right valign=top>G4String </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#d0">ModifyPath</a> (G4String tempPath)</td></tr> |
---|
63 | |
---|
64 | <tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> |
---|
65 | <tr><td class="memItemLeft" nowrap align=right valign=top>G4String </td><td class="memItemRight" valign=bottom><a class="el" href="classG4VBasicShell.html#r0">currentDirectory</a></td></tr> |
---|
66 | |
---|
67 | </table> |
---|
68 | <hr><h2>Constructor & Destructor Documentation</h2> |
---|
69 | <a class="anchor" name="a0" doxytag="G4VBasicShell::G4VBasicShell" ></a><p> |
---|
70 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
71 | <tr> |
---|
72 | <td class="mdRow"> |
---|
73 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
74 | <tr> |
---|
75 | <td class="md" nowrap valign="top"> G4VBasicShell::G4VBasicShell </td> |
---|
76 | <td class="md" valign="top">( </td> |
---|
77 | <td class="mdname1" valign="top" nowrap> </td> |
---|
78 | <td class="md" valign="top"> ) </td> |
---|
79 | <td class="md" nowrap></td> |
---|
80 | </tr> |
---|
81 | |
---|
82 | </table> |
---|
83 | </td> |
---|
84 | </tr> |
---|
85 | </table> |
---|
86 | <table cellspacing=5 cellpadding=0 border=0> |
---|
87 | <tr> |
---|
88 | <td> |
---|
89 | |
---|
90 | </td> |
---|
91 | <td> |
---|
92 | |
---|
93 | <p> |
---|
94 | |
---|
95 | <p> |
---|
96 | Definition at line <a class="el" href="G4VBasicShell_8cc-source.html#l00040">40</a> of file <a class="el" href="G4VBasicShell_8cc-source.html">G4VBasicShell.cc</a>. |
---|
97 | <p> |
---|
98 | <div class="fragment"><pre>00041 :<a class="code" href="classG4VBasicShell.html#r0">currentDirectory</a>(<span class="stringliteral">"/"</span>) |
---|
99 | 00042 { |
---|
100 | 00043 } |
---|
101 | </pre></div> </td> |
---|
102 | </tr> |
---|
103 | </table> |
---|
104 | <a class="anchor" name="a1" doxytag="G4VBasicShell::~G4VBasicShell" ></a><p> |
---|
105 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
106 | <tr> |
---|
107 | <td class="mdRow"> |
---|
108 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
109 | <tr> |
---|
110 | <td class="md" nowrap valign="top"> G4VBasicShell::~<a class="el" href="classG4VBasicShell.html">G4VBasicShell</a> </td> |
---|
111 | <td class="md" valign="top">( </td> |
---|
112 | <td class="mdname1" valign="top" nowrap> </td> |
---|
113 | <td class="md" valign="top"> ) </td> |
---|
114 | <td class="md" nowrap><code> [virtual]</code></td> |
---|
115 | </tr> |
---|
116 | |
---|
117 | </table> |
---|
118 | </td> |
---|
119 | </tr> |
---|
120 | </table> |
---|
121 | <table cellspacing=5 cellpadding=0 border=0> |
---|
122 | <tr> |
---|
123 | <td> |
---|
124 | |
---|
125 | </td> |
---|
126 | <td> |
---|
127 | |
---|
128 | <p> |
---|
129 | |
---|
130 | <p> |
---|
131 | Definition at line <a class="el" href="G4VBasicShell_8cc-source.html#l00045">45</a> of file <a class="el" href="G4VBasicShell_8cc-source.html">G4VBasicShell.cc</a>. |
---|
132 | <p> |
---|
133 | <div class="fragment"><pre>00046 {;} |
---|
134 | </pre></div> </td> |
---|
135 | </tr> |
---|
136 | </table> |
---|
137 | <hr><h2>Member Function Documentation</h2> |
---|
138 | <a class="anchor" name="b10" doxytag="G4VBasicShell::ApplyShellCommand" ></a><p> |
---|
139 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
140 | <tr> |
---|
141 | <td class="mdRow"> |
---|
142 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
143 | <tr> |
---|
144 | <td class="md" nowrap valign="top"> void G4VBasicShell::ApplyShellCommand </td> |
---|
145 | <td class="md" valign="top">( </td> |
---|
146 | <td class="md" nowrap valign="top">G4String </td> |
---|
147 | <td class="mdname" nowrap> <em>a_string</em>, </td> |
---|
148 | </tr> |
---|
149 | <tr> |
---|
150 | <td></td> |
---|
151 | <td></td> |
---|
152 | <td class="md" nowrap>G4bool & </td> |
---|
153 | <td class="mdname" nowrap> <em>exitSession</em>, </td> |
---|
154 | </tr> |
---|
155 | <tr> |
---|
156 | <td></td> |
---|
157 | <td></td> |
---|
158 | <td class="md" nowrap>G4bool & </td> |
---|
159 | <td class="mdname" nowrap> <em>exitPause</em></td> |
---|
160 | </tr> |
---|
161 | <tr> |
---|
162 | <td></td> |
---|
163 | <td class="md">) </td> |
---|
164 | <td class="md" colspan="2"><code> [protected]</code></td> |
---|
165 | </tr> |
---|
166 | |
---|
167 | </table> |
---|
168 | </td> |
---|
169 | </tr> |
---|
170 | </table> |
---|
171 | <table cellspacing=5 cellpadding=0 border=0> |
---|
172 | <tr> |
---|
173 | <td> |
---|
174 | |
---|
175 | </td> |
---|
176 | <td> |
---|
177 | |
---|
178 | <p> |
---|
179 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
180 | <p> |
---|
181 | Definition at line <a class="el" href="G4VBasicShell_8cc-source.html#l00286">286</a> of file <a class="el" href="G4VBasicShell_8cc-source.html">G4VBasicShell.cc</a>. |
---|
182 | <p> |
---|
183 | References <a class="el" href="G4VBasicShell_8cc-source.html#l00378">ChangeDirectoryCommand()</a>, <a class="el" href="G4VBasicShell_8cc-source.html#l00258">ExecuteCommand()</a>, <a class="el" href="G4VBasicShell_8cc-source.html#l00070">GetCurrentWorkingDirectory()</a>, <a class="el" href="G4VBasicShell_8cc-source.html#l00391">ListDirectory()</a>, <a class="el" href="G4VBasicShell_8cc-source.html#l00048">ModifyToFullPathCommand()</a>, <a class="el" href="G4VBasicShell_8cc-source.html#l00367">ShowCurrent()</a>, and <a class="el" href="G4VBasicShell_8cc-source.html#l00407">TerminalHelp()</a>. |
---|
184 | <p> |
---|
185 | Referenced by <a class="el" href="G4UIXm_8cc-source.html#l00416">G4UIXm::ButtonCallback()</a>, <a class="el" href="G4UIQt_8cc-source.html#l00715">G4UIQt::buttonCallback()</a>, <a class="el" href="G4UIXaw_8cc-source.html#l00203">G4UIXaw::Callback()</a>, <a class="el" href="G4UIXm_8cc-source.html#l00359">G4UIXm::commandEnteredCallback()</a>, <a class="el" href="G4UIQt_8cc-source.html#l00688">G4UIQt::commandEnteredCallback()</a>, <a class="el" href="G4UIWin32_8cc-source.html#l00587">G4UIWin32::EditWindowProc()</a>, and <a class="el" href="G4UIWin32_8cc-source.html#l00435">G4UIWin32::MainWindowProc()</a>. |
---|
186 | <p> |
---|
187 | <div class="fragment"><pre>00293 { |
---|
188 | 00294 G4UImanager* UI = G4UImanager::GetUIpointer(); |
---|
189 | 00295 <span class="keywordflow">if</span>(UI==NULL) <span class="keywordflow">return</span>; |
---|
190 | 00296 |
---|
191 | 00297 G4String command = a_string.strip(G4String::leading); |
---|
192 | 00298 <span class="keywordflow">if</span>( command(0) == <span class="charliteral">'#'</span> ) { |
---|
193 | 00299 |
---|
194 | 00300 G4cout << command << G4endl; |
---|
195 | 00301 |
---|
196 | 00302 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( command == <span class="stringliteral">"ls"</span> || command(0,3) == <span class="stringliteral">"ls "</span> ) { |
---|
197 | 00303 |
---|
198 | 00304 <a class="code" href="classG4VBasicShell.html#b13">ListDirectory</a>( command ); |
---|
199 | 00305 |
---|
200 | 00306 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( command == <span class="stringliteral">"pwd"</span> ) { |
---|
201 | 00307 |
---|
202 | 00308 G4cout << <span class="stringliteral">"Current Working Directory : "</span> |
---|
203 | 00309 << <a class="code" href="classG4VBasicShell.html#b1">GetCurrentWorkingDirectory</a>() << G4endl; |
---|
204 | 00310 |
---|
205 | 00311 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( command(0,2) == <span class="stringliteral">"cd"</span> ) { |
---|
206 | 00312 |
---|
207 | 00313 <a class="code" href="classG4VBasicShell.html#b12">ChangeDirectoryCommand</a> ( command ); |
---|
208 | 00314 |
---|
209 | 00315 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( command(0,4) == <span class="stringliteral">"help"</span> ) { |
---|
210 | 00316 |
---|
211 | 00317 <a class="code" href="classG4VBasicShell.html#b14">TerminalHelp</a>( command ); |
---|
212 | 00318 |
---|
213 | 00319 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( command(0) == <span class="charliteral">'?'</span> ) { |
---|
214 | 00320 |
---|
215 | 00321 <a class="code" href="classG4VBasicShell.html#b11">ShowCurrent</a>( command ); |
---|
216 | 00322 |
---|
217 | 00323 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( command(0,4) == <span class="stringliteral">"hist"</span> ) { |
---|
218 | 00324 |
---|
219 | 00325 G4int nh = UI->GetNumberOfHistory(); |
---|
220 | 00326 <span class="keywordflow">for</span>(G4int i=0;i<nh;i++) { |
---|
221 | 00327 G4cout << i << <span class="stringliteral">": "</span> << UI->GetPreviousCommand(i) << G4endl; |
---|
222 | 00328 } |
---|
223 | 00329 |
---|
224 | 00330 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( command(0) == <span class="charliteral">'!'</span> ) { |
---|
225 | 00331 |
---|
226 | 00332 G4String ss = command(1,command.length()-1); |
---|
227 | 00333 G4int vl; |
---|
228 | 00334 <span class="keyword">const</span> <span class="keywordtype">char</span>* tt = ss; |
---|
229 | 00335 std::istringstream is(tt); |
---|
230 | 00336 is >> vl; |
---|
231 | 00337 G4int nh = UI->GetNumberOfHistory(); |
---|
232 | 00338 <span class="keywordflow">if</span>(vl>=0 && vl<nh) { |
---|
233 | 00339 G4String prev = UI->GetPreviousCommand(vl); |
---|
234 | 00340 G4cout << prev << G4endl; |
---|
235 | 00341 <a class="code" href="classG4VBasicShell.html#b7">ExecuteCommand</a> (<a class="code" href="classG4VBasicShell.html#b0">ModifyToFullPathCommand</a>(prev)); |
---|
236 | 00342 } <span class="keywordflow">else</span> { |
---|
237 | 00343 G4cerr << <span class="stringliteral">"history "</span> << vl << <span class="stringliteral">" is not found."</span> << G4endl; |
---|
238 | 00344 } |
---|
239 | 00345 |
---|
240 | 00346 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( command(0,4) == <span class="stringliteral">"exit"</span> ) { |
---|
241 | 00347 |
---|
242 | 00348 <span class="keywordflow">if</span>( exitPause == <span class="keyword">false</span>) { <span class="comment">//In a secondary loop.</span> |
---|
243 | 00349 G4cout << <span class="stringliteral">"You are now processing RUN."</span> << G4endl; |
---|
244 | 00350 G4cout << <span class="stringliteral">"Please abort it using \"/run/abort\" command first"</span> << G4endl; |
---|
245 | 00351 G4cout << <span class="stringliteral">" and use \"continue\" command until the application"</span> << G4endl; |
---|
246 | 00352 G4cout << <span class="stringliteral">" becomes to Idle."</span> << G4endl; |
---|
247 | 00353 } <span class="keywordflow">else</span> { |
---|
248 | 00354 exitSession = <span class="keyword">true</span>; |
---|
249 | 00355 } |
---|
250 | 00356 |
---|
251 | 00357 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( command(0,4) == <span class="stringliteral">"cont"</span> ) { |
---|
252 | 00358 |
---|
253 | 00359 exitPause = <span class="keyword">true</span>; |
---|
254 | 00360 |
---|
255 | 00361 } <span class="keywordflow">else</span> { |
---|
256 | 00362 |
---|
257 | 00363 <a class="code" href="classG4VBasicShell.html#b7">ExecuteCommand</a> (<a class="code" href="classG4VBasicShell.html#b0">ModifyToFullPathCommand</a>(a_string)); |
---|
258 | 00364 |
---|
259 | 00365 } |
---|
260 | 00366 } |
---|
261 | </pre></div> </td> |
---|
262 | </tr> |
---|
263 | </table> |
---|
264 | |
---|
265 | <p> |
---|
266 | Here is the call graph for this function:<p><center><img src="classG4VBasicShell_b10_cgraph.png" border="0" usemap="#classG4VBasicShell_b10_cgraph_map" alt=""></center> |
---|
267 | <map name="classG4VBasicShell_b10_cgraph_map"> |
---|
268 | <area href="classG4VBasicShell.html#b12" shape="rect" coords="298,8,578,34" alt=""> |
---|
269 | <area href="classG4VBasicShell.html#b7" shape="rect" coords="325,58,552,85" alt=""> |
---|
270 | <area href="classG4VBasicShell.html#b1" shape="rect" coords="626,160,914,186" alt=""> |
---|
271 | <area href="classG4VBasicShell.html#b13" shape="rect" coords="342,160,534,186" alt=""> |
---|
272 | <area href="classG4VBasicShell.html#b0" shape="rect" coords="629,261,912,288" alt=""> |
---|
273 | <area href="classG4VBasicShell.html#b11" shape="rect" coords="340,312,537,338" alt=""> |
---|
274 | <area href="classG4VBasicShell.html#b14" shape="rect" coords="341,210,536,237" alt=""> |
---|
275 | </map> |
---|
276 | <a class="anchor" name="b2" doxytag="G4VBasicShell::ChangeDirectory" ></a><p> |
---|
277 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
278 | <tr> |
---|
279 | <td class="mdRow"> |
---|
280 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
281 | <tr> |
---|
282 | <td class="md" nowrap valign="top"> G4bool G4VBasicShell::ChangeDirectory </td> |
---|
283 | <td class="md" valign="top">( </td> |
---|
284 | <td class="md" nowrap valign="top">const char * </td> |
---|
285 | <td class="mdname1" valign="top" nowrap> <em>newDir</em> </td> |
---|
286 | <td class="md" valign="top"> ) </td> |
---|
287 | <td class="md" nowrap><code> [protected]</code></td> |
---|
288 | </tr> |
---|
289 | |
---|
290 | </table> |
---|
291 | </td> |
---|
292 | </tr> |
---|
293 | </table> |
---|
294 | <table cellspacing=5 cellpadding=0 border=0> |
---|
295 | <tr> |
---|
296 | <td> |
---|
297 | |
---|
298 | </td> |
---|
299 | <td> |
---|
300 | |
---|
301 | <p> |
---|
302 | |
---|
303 | <p> |
---|
304 | Definition at line <a class="el" href="G4VBasicShell_8cc-source.html#l00075">75</a> of file <a class="el" href="G4VBasicShell_8cc-source.html">G4VBasicShell.cc</a>. |
---|
305 | <p> |
---|
306 | References <a class="el" href="G4VBasicShell_8hh-source.html#l00102">currentDirectory</a>, <a class="el" href="G4VBasicShell_8cc-source.html#l00088">FindDirectory()</a>, and <a class="el" href="G4VBasicShell_8cc-source.html#l00125">ModifyPath()</a>. |
---|
307 | <p> |
---|
308 | Referenced by <a class="el" href="G4VBasicShell_8cc-source.html#l00378">ChangeDirectoryCommand()</a>. |
---|
309 | <p> |
---|
310 | <div class="fragment"><pre>00076 { |
---|
311 | 00077 G4String aNewPrefix = (G4String)newDir; |
---|
312 | 00078 G4String newPrefix = (G4String)aNewPrefix.strip(G4String::both); |
---|
313 | 00079 G4String newDirectory = <a class="code" href="classG4VBasicShell.html#d0">ModifyPath</a>( newPrefix ); |
---|
314 | 00080 <span class="keywordflow">if</span>( newDirectory( newDirectory.length() - 1 ) != <span class="charliteral">'/'</span> ) |
---|
315 | 00081 { newDirectory += <span class="stringliteral">"/"</span>; } |
---|
316 | 00082 <span class="keywordflow">if</span>( <a class="code" href="classG4VBasicShell.html#b3">FindDirectory</a>( (<span class="keyword">const</span> <span class="keywordtype">char</span>*)newDirectory ) == NULL ) |
---|
317 | 00083 { <span class="keywordflow">return</span> <span class="keyword">false</span>; } |
---|
318 | 00084 <a class="code" href="classG4VBasicShell.html#r0">currentDirectory</a> = newDirectory; |
---|
319 | 00085 <span class="keywordflow">return</span> <span class="keyword">true</span>; |
---|
320 | 00086 } |
---|
321 | </pre></div> </td> |
---|
322 | </tr> |
---|
323 | </table> |
---|
324 | |
---|
325 | <p> |
---|
326 | Here is the call graph for this function:<p><center><img src="classG4VBasicShell_b2_cgraph.png" border="0" usemap="#classG4VBasicShell_b2_cgraph_map" alt=""></center> |
---|
327 | <map name="classG4VBasicShell_b2_cgraph_map"> |
---|
328 | <area href="classG4VBasicShell.html#b3" shape="rect" coords="275,7,473,34" alt=""> |
---|
329 | <area href="classG4VBasicShell.html#d0" shape="rect" coords="523,33,707,59" alt=""> |
---|
330 | </map> |
---|
331 | <a class="anchor" name="b12" doxytag="G4VBasicShell::ChangeDirectoryCommand" ></a><p> |
---|
332 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
333 | <tr> |
---|
334 | <td class="mdRow"> |
---|
335 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
336 | <tr> |
---|
337 | <td class="md" nowrap valign="top"> void G4VBasicShell::ChangeDirectoryCommand </td> |
---|
338 | <td class="md" valign="top">( </td> |
---|
339 | <td class="md" nowrap valign="top">G4String </td> |
---|
340 | <td class="mdname1" valign="top" nowrap> </td> |
---|
341 | <td class="md" valign="top"> ) </td> |
---|
342 | <td class="md" nowrap><code> [protected]</code></td> |
---|
343 | </tr> |
---|
344 | |
---|
345 | </table> |
---|
346 | </td> |
---|
347 | </tr> |
---|
348 | </table> |
---|
349 | <table cellspacing=5 cellpadding=0 border=0> |
---|
350 | <tr> |
---|
351 | <td> |
---|
352 | |
---|
353 | </td> |
---|
354 | <td> |
---|
355 | |
---|
356 | <p> |
---|
357 | |
---|
358 | <p> |
---|
359 | Definition at line <a class="el" href="G4VBasicShell_8cc-source.html#l00378">378</a> of file <a class="el" href="G4VBasicShell_8cc-source.html">G4VBasicShell.cc</a>. |
---|
360 | <p> |
---|
361 | References <a class="el" href="G4VBasicShell_8cc-source.html#l00075">ChangeDirectory()</a>. |
---|
362 | <p> |
---|
363 | Referenced by <a class="el" href="G4VBasicShell_8cc-source.html#l00286">ApplyShellCommand()</a>, and <a class="el" href="G4UIterminal_8cc-source.html#l00155">G4UIterminal::GetCommand()</a>. |
---|
364 | <p> |
---|
365 | <div class="fragment"><pre>00379 { |
---|
366 | 00380 G4String prefix; |
---|
367 | 00381 <span class="keywordflow">if</span>( newCommand.length() <= 3 ) { |
---|
368 | 00382 prefix = <span class="stringliteral">"/"</span>; |
---|
369 | 00383 } <span class="keywordflow">else</span> { |
---|
370 | 00384 G4String aNewPrefix = newCommand(3,newCommand.length()-3); |
---|
371 | 00385 prefix = aNewPrefix.strip(G4String::both); |
---|
372 | 00386 } |
---|
373 | 00387 <span class="keywordflow">if</span>(!<a class="code" href="classG4VBasicShell.html#b2">ChangeDirectory</a>(prefix)) { |
---|
374 | 00388 G4cout << <span class="stringliteral">"directory <"</span> << prefix << <span class="stringliteral">"> not found."</span> << G4endl; |
---|
375 | 00389 } |
---|
376 | 00390 } |
---|
377 | </pre></div> </td> |
---|
378 | </tr> |
---|
379 | </table> |
---|
380 | |
---|
381 | <p> |
---|
382 | Here is the call graph for this function:<p><center><img src="classG4VBasicShell_b12_cgraph.png" border="0" usemap="#classG4VBasicShell_b12_cgraph_map" alt=""></center> |
---|
383 | <map name="classG4VBasicShell_b12_cgraph_map"> |
---|
384 | <area href="classG4VBasicShell.html#b2" shape="rect" coords="336,8,554,34" alt=""> |
---|
385 | </map> |
---|
386 | <a class="anchor" name="b5" doxytag="G4VBasicShell::Complete" ></a><p> |
---|
387 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
388 | <tr> |
---|
389 | <td class="mdRow"> |
---|
390 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
391 | <tr> |
---|
392 | <td class="md" nowrap valign="top"> G4String G4VBasicShell::Complete </td> |
---|
393 | <td class="md" valign="top">( </td> |
---|
394 | <td class="md" nowrap valign="top">G4String </td> |
---|
395 | <td class="mdname1" valign="top" nowrap> </td> |
---|
396 | <td class="md" valign="top"> ) </td> |
---|
397 | <td class="md" nowrap><code> [protected]</code></td> |
---|
398 | </tr> |
---|
399 | |
---|
400 | </table> |
---|
401 | </td> |
---|
402 | </tr> |
---|
403 | </table> |
---|
404 | <table cellspacing=5 cellpadding=0 border=0> |
---|
405 | <tr> |
---|
406 | <td> |
---|
407 | |
---|
408 | </td> |
---|
409 | <td> |
---|
410 | |
---|
411 | <p> |
---|
412 | |
---|
413 | <p> |
---|
414 | Definition at line <a class="el" href="G4VBasicShell_8cc-source.html#l00168">168</a> of file <a class="el" href="G4VBasicShell_8cc-source.html">G4VBasicShell.cc</a>. |
---|
415 | <p> |
---|
416 | References <a class="el" href="G4VBasicShell_8cc-source.html#l00182">FindMatchingPath()</a>, and <a class="el" href="G4VBasicShell_8cc-source.html#l00125">ModifyPath()</a>. |
---|
417 | <p> |
---|
418 | Referenced by <a class="el" href="G4UIWin32_8cc-source.html#l00587">G4UIWin32::EditWindowProc()</a>, and <a class="el" href="G4UIXm_8cc-source.html#l00385">G4UIXm::keyHandler()</a>. |
---|
419 | <p> |
---|
420 | <div class="fragment"><pre>00169 { |
---|
421 | 00170 G4String rawCommandLine = commandName; |
---|
422 | 00171 G4String commandLine = rawCommandLine.strip(G4String::both); |
---|
423 | 00172 size_t i = commandLine.index(<span class="stringliteral">" "</span>); |
---|
424 | 00173 <span class="keywordflow">if</span>( i != std::string::npos ) <span class="keywordflow">return</span> rawCommandLine; <span class="comment">// Already entering parameters, </span> |
---|
425 | 00174 <span class="comment">// assume command path is correct.</span> |
---|
426 | 00175 G4String commandString = commandLine; |
---|
427 | 00176 G4String targetCom = <a class="code" href="classG4VBasicShell.html#d0">ModifyPath</a>(commandString); |
---|
428 | 00177 G4UIcommandTree* tree = G4UImanager::GetUIpointer()->GetTree(); |
---|
429 | 00178 G4String value = <a class="code" href="classG4VBasicShell.html#b6">FindMatchingPath</a>(tree,targetCom); |
---|
430 | 00179 <span class="keywordflow">if</span>(value==<span class="stringliteral">""</span>) <span class="keywordflow">return</span> rawCommandLine; |
---|
431 | 00180 <span class="keywordflow">return</span> value; |
---|
432 | 00181 } |
---|
433 | </pre></div> </td> |
---|
434 | </tr> |
---|
435 | </table> |
---|
436 | |
---|
437 | <p> |
---|
438 | Here is the call graph for this function:<p><center><img src="classG4VBasicShell_b5_cgraph.png" border="0" usemap="#classG4VBasicShell_b5_cgraph_map" alt=""></center> |
---|
439 | <map name="classG4VBasicShell_b5_cgraph_map"> |
---|
440 | <area href="classG4VBasicShell.html#b6" shape="rect" coords="232,7,458,34" alt=""> |
---|
441 | <area href="classG4VBasicShell.html#d0" shape="rect" coords="253,58,437,85" alt=""> |
---|
442 | </map> |
---|
443 | <a class="anchor" name="b7" doxytag="G4VBasicShell::ExecuteCommand" ></a><p> |
---|
444 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
445 | <tr> |
---|
446 | <td class="mdRow"> |
---|
447 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
448 | <tr> |
---|
449 | <td class="md" nowrap valign="top"> void G4VBasicShell::ExecuteCommand </td> |
---|
450 | <td class="md" valign="top">( </td> |
---|
451 | <td class="md" nowrap valign="top">G4String </td> |
---|
452 | <td class="mdname1" valign="top" nowrap> <em>aCommand</em> </td> |
---|
453 | <td class="md" valign="top"> ) </td> |
---|
454 | <td class="md" nowrap><code> [protected, virtual]</code></td> |
---|
455 | </tr> |
---|
456 | |
---|
457 | </table> |
---|
458 | </td> |
---|
459 | </tr> |
---|
460 | </table> |
---|
461 | <table cellspacing=5 cellpadding=0 border=0> |
---|
462 | <tr> |
---|
463 | <td> |
---|
464 | |
---|
465 | </td> |
---|
466 | <td> |
---|
467 | |
---|
468 | <p> |
---|
469 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
470 | <p> |
---|
471 | Reimplemented in <a class="el" href="classG4UIterminal.html#d0">G4UIterminal</a>, and <a class="el" href="classG4UIGainServer.html#d2">G4UIGainServer</a>. |
---|
472 | <p> |
---|
473 | Definition at line <a class="el" href="G4VBasicShell_8cc-source.html#l00258">258</a> of file <a class="el" href="G4VBasicShell_8cc-source.html">G4VBasicShell.cc</a>. |
---|
474 | <p> |
---|
475 | Referenced by <a class="el" href="G4VBasicShell_8cc-source.html#l00286">ApplyShellCommand()</a>. |
---|
476 | <p> |
---|
477 | <div class="fragment"><pre>00264 { |
---|
478 | 00265 <span class="keywordflow">if</span>(aCommand.length()<2) <span class="keywordflow">return</span>; |
---|
479 | 00266 G4UImanager* UI = G4UImanager::GetUIpointer(); |
---|
480 | 00267 <span class="keywordflow">if</span>(UI==NULL) <span class="keywordflow">return</span>; |
---|
481 | 00268 G4int commandStatus = UI->ApplyCommand(aCommand); |
---|
482 | 00269 <span class="keywordflow">switch</span>(commandStatus) { |
---|
483 | 00270 <span class="keywordflow">case</span> fCommandSucceeded: |
---|
484 | 00271 <span class="keywordflow">break</span>; |
---|
485 | 00272 <span class="keywordflow">case</span> fCommandNotFound: |
---|
486 | 00273 G4cerr << <span class="stringliteral">"command not found"</span> << G4endl; |
---|
487 | 00274 <span class="keywordflow">break</span>; |
---|
488 | 00275 <span class="keywordflow">case</span> fIllegalApplicationState: |
---|
489 | 00276 G4cerr << <span class="stringliteral">"illegal application state -- command refused"</span> << G4endl; |
---|
490 | 00277 <span class="keywordflow">break</span>; |
---|
491 | 00278 <span class="keywordflow">case</span> fParameterOutOfRange: |
---|
492 | 00279 <span class="keywordflow">case</span> fParameterUnreadable: |
---|
493 | 00280 <span class="keywordflow">case</span> fParameterOutOfCandidates: |
---|
494 | 00281 <span class="keywordflow">default</span>: |
---|
495 | 00282 G4cerr << <span class="stringliteral">"command refused ("</span> << commandStatus << <span class="stringliteral">")"</span> << G4endl; |
---|
496 | 00283 } |
---|
497 | 00284 } |
---|
498 | </pre></div> </td> |
---|
499 | </tr> |
---|
500 | </table> |
---|
501 | <a class="anchor" name="b9" doxytag="G4VBasicShell::ExitHelp" ></a><p> |
---|
502 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
503 | <tr> |
---|
504 | <td class="mdRow"> |
---|
505 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
506 | <tr> |
---|
507 | <td class="md" nowrap valign="top"> virtual void G4VBasicShell::ExitHelp </td> |
---|
508 | <td class="md" valign="top">( </td> |
---|
509 | <td class="mdname1" valign="top" nowrap> </td> |
---|
510 | <td class="md" valign="top"> ) </td> |
---|
511 | <td class="md" nowrap><code> [protected, pure virtual]</code></td> |
---|
512 | </tr> |
---|
513 | |
---|
514 | </table> |
---|
515 | </td> |
---|
516 | </tr> |
---|
517 | </table> |
---|
518 | <table cellspacing=5 cellpadding=0 border=0> |
---|
519 | <tr> |
---|
520 | <td> |
---|
521 | |
---|
522 | </td> |
---|
523 | <td> |
---|
524 | |
---|
525 | <p> |
---|
526 | |
---|
527 | <p> |
---|
528 | Implemented in <a class="el" href="classG4UIQt.html#d5">G4UIQt</a>, <a class="el" href="classG4UIterminal.html#d3">G4UIterminal</a>, <a class="el" href="classG4UIWin32.html#d2">G4UIWin32</a>, <a class="el" href="classG4UIXaw.html#d2">G4UIXaw</a>, <a class="el" href="classG4UIXm.html#d2">G4UIXm</a>, and <a class="el" href="classG4UIGainServer.html#d4">G4UIGainServer</a>. |
---|
529 | <p> |
---|
530 | Referenced by <a class="el" href="G4VBasicShell_8cc-source.html#l00407">TerminalHelp()</a>. </td> |
---|
531 | </tr> |
---|
532 | </table> |
---|
533 | <a class="anchor" name="b4" doxytag="G4VBasicShell::FindCommand" ></a><p> |
---|
534 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
535 | <tr> |
---|
536 | <td class="mdRow"> |
---|
537 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
538 | <tr> |
---|
539 | <td class="md" nowrap valign="top"> G4UIcommand * G4VBasicShell::FindCommand </td> |
---|
540 | <td class="md" valign="top">( </td> |
---|
541 | <td class="md" nowrap valign="top">const char * </td> |
---|
542 | <td class="mdname1" valign="top" nowrap> <em>commandName</em> </td> |
---|
543 | <td class="md" valign="top"> ) </td> |
---|
544 | <td class="md" nowrap><code> [protected]</code></td> |
---|
545 | </tr> |
---|
546 | |
---|
547 | </table> |
---|
548 | </td> |
---|
549 | </tr> |
---|
550 | </table> |
---|
551 | <table cellspacing=5 cellpadding=0 border=0> |
---|
552 | <tr> |
---|
553 | <td> |
---|
554 | |
---|
555 | </td> |
---|
556 | <td> |
---|
557 | |
---|
558 | <p> |
---|
559 | |
---|
560 | <p> |
---|
561 | Definition at line <a class="el" href="G4VBasicShell_8cc-source.html#l00110">110</a> of file <a class="el" href="G4VBasicShell_8cc-source.html">G4VBasicShell.cc</a>. |
---|
562 | <p> |
---|
563 | References <a class="el" href="G4VBasicShell_8cc-source.html#l00125">ModifyPath()</a>. |
---|
564 | <p> |
---|
565 | Referenced by <a class="el" href="G4UIterminal_8cc-source.html#l00104">G4UIterminal::ExecuteCommand()</a>. |
---|
566 | <p> |
---|
567 | <div class="fragment"><pre>00111 { |
---|
568 | 00112 G4String rawCommandLine = (G4String)commandName; |
---|
569 | 00113 G4String commandLine = (G4String)rawCommandLine.strip(G4String::both); |
---|
570 | 00114 G4String commandString; |
---|
571 | 00115 size_t i = commandLine.index(<span class="stringliteral">" "</span>); |
---|
572 | 00116 <span class="keywordflow">if</span>( i != std::string::npos ) |
---|
573 | 00117 { commandString = (G4String)commandLine(0,i); } |
---|
574 | 00118 <span class="keywordflow">else</span> |
---|
575 | 00119 { commandString = commandLine; } |
---|
576 | 00120 |
---|
577 | 00121 G4String targetCom = <a class="code" href="classG4VBasicShell.html#d0">ModifyPath</a>(commandString); |
---|
578 | 00122 <span class="keywordflow">return</span> G4UImanager::GetUIpointer()->GetTree()->FindPath(targetCom); |
---|
579 | 00123 } |
---|
580 | </pre></div> </td> |
---|
581 | </tr> |
---|
582 | </table> |
---|
583 | |
---|
584 | <p> |
---|
585 | Here is the call graph for this function:<p><center><img src="classG4VBasicShell_b4_cgraph.png" border="0" usemap="#classG4VBasicShell_b4_cgraph_map" alt=""></center> |
---|
586 | <map name="classG4VBasicShell_b4_cgraph_map"> |
---|
587 | <area href="classG4VBasicShell.html#d0" shape="rect" coords="262,8,446,34" alt=""> |
---|
588 | </map> |
---|
589 | <a class="anchor" name="b3" doxytag="G4VBasicShell::FindDirectory" ></a><p> |
---|
590 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
591 | <tr> |
---|
592 | <td class="mdRow"> |
---|
593 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
594 | <tr> |
---|
595 | <td class="md" nowrap valign="top"> G4UIcommandTree * G4VBasicShell::FindDirectory </td> |
---|
596 | <td class="md" valign="top">( </td> |
---|
597 | <td class="md" nowrap valign="top">const char * </td> |
---|
598 | <td class="mdname1" valign="top" nowrap> <em>dirName</em> </td> |
---|
599 | <td class="md" valign="top"> ) </td> |
---|
600 | <td class="md" nowrap><code> [protected]</code></td> |
---|
601 | </tr> |
---|
602 | |
---|
603 | </table> |
---|
604 | </td> |
---|
605 | </tr> |
---|
606 | </table> |
---|
607 | <table cellspacing=5 cellpadding=0 border=0> |
---|
608 | <tr> |
---|
609 | <td> |
---|
610 | |
---|
611 | </td> |
---|
612 | <td> |
---|
613 | |
---|
614 | <p> |
---|
615 | |
---|
616 | <p> |
---|
617 | Definition at line <a class="el" href="G4VBasicShell_8cc-source.html#l00088">88</a> of file <a class="el" href="G4VBasicShell_8cc-source.html">G4VBasicShell.cc</a>. |
---|
618 | <p> |
---|
619 | References <a class="el" href="G4VBasicShell_8cc-source.html#l00125">ModifyPath()</a>. |
---|
620 | <p> |
---|
621 | Referenced by <a class="el" href="G4VBasicShell_8cc-source.html#l00075">ChangeDirectory()</a>, and <a class="el" href="G4VBasicShell_8cc-source.html#l00391">ListDirectory()</a>. |
---|
622 | <p> |
---|
623 | <div class="fragment"><pre>00089 { |
---|
624 | 00090 G4String aDirName = (G4String)dirName; |
---|
625 | 00091 G4String theDir = (G4String)aDirName.strip(G4String::both); |
---|
626 | 00092 G4String targetDir = <a class="code" href="classG4VBasicShell.html#d0">ModifyPath</a>( theDir ); |
---|
627 | 00093 <span class="keywordflow">if</span>( targetDir( targetDir.length()-1 ) != <span class="charliteral">'/'</span> ) |
---|
628 | 00094 { targetDir += <span class="stringliteral">"/"</span>; } |
---|
629 | 00095 G4UIcommandTree* comTree = G4UImanager::GetUIpointer()->GetTree(); |
---|
630 | 00096 <span class="keywordflow">if</span>( targetDir == <span class="stringliteral">"/"</span> ) |
---|
631 | 00097 { <span class="keywordflow">return</span> comTree; } |
---|
632 | 00098 size_t idx = 1; |
---|
633 | 00099 <span class="keywordflow">while</span>( idx < targetDir.length()-1 ) |
---|
634 | 00100 { |
---|
635 | 00101 size_t i = targetDir.index(<span class="stringliteral">"/"</span>,idx); |
---|
636 | 00102 comTree = comTree->GetTree((G4String)targetDir(0,i+1)); |
---|
637 | 00103 <span class="keywordflow">if</span>( comTree == NULL ) |
---|
638 | 00104 { <span class="keywordflow">return</span> NULL; } |
---|
639 | 00105 idx = i+1; |
---|
640 | 00106 } |
---|
641 | 00107 <span class="keywordflow">return</span> comTree; |
---|
642 | 00108 } |
---|
643 | </pre></div> </td> |
---|
644 | </tr> |
---|
645 | </table> |
---|
646 | |
---|
647 | <p> |
---|
648 | Here is the call graph for this function:<p><center><img src="classG4VBasicShell_b3_cgraph.png" border="0" usemap="#classG4VBasicShell_b3_cgraph_map" alt=""></center> |
---|
649 | <map name="classG4VBasicShell_b3_cgraph_map"> |
---|
650 | <area href="classG4VBasicShell.html#d0" shape="rect" coords="257,8,441,34" alt=""> |
---|
651 | </map> |
---|
652 | <a class="anchor" name="b6" doxytag="G4VBasicShell::FindMatchingPath" ></a><p> |
---|
653 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
654 | <tr> |
---|
655 | <td class="mdRow"> |
---|
656 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
657 | <tr> |
---|
658 | <td class="md" nowrap valign="top"> G4String G4VBasicShell::FindMatchingPath </td> |
---|
659 | <td class="md" valign="top">( </td> |
---|
660 | <td class="md" nowrap valign="top">G4UIcommandTree * </td> |
---|
661 | <td class="mdname" nowrap>, </td> |
---|
662 | </tr> |
---|
663 | <tr> |
---|
664 | <td></td> |
---|
665 | <td></td> |
---|
666 | <td class="md" nowrap>G4String </td> |
---|
667 | <td class="mdname" nowrap></td> |
---|
668 | </tr> |
---|
669 | <tr> |
---|
670 | <td></td> |
---|
671 | <td class="md">) </td> |
---|
672 | <td class="md" colspan="2"><code> [protected]</code></td> |
---|
673 | </tr> |
---|
674 | |
---|
675 | </table> |
---|
676 | </td> |
---|
677 | </tr> |
---|
678 | </table> |
---|
679 | <table cellspacing=5 cellpadding=0 border=0> |
---|
680 | <tr> |
---|
681 | <td> |
---|
682 | |
---|
683 | </td> |
---|
684 | <td> |
---|
685 | |
---|
686 | <p> |
---|
687 | |
---|
688 | <p> |
---|
689 | Definition at line <a class="el" href="G4VBasicShell_8cc-source.html#l00182">182</a> of file <a class="el" href="G4VBasicShell_8cc-source.html">G4VBasicShell.cc</a>. |
---|
690 | <p> |
---|
691 | Referenced by <a class="el" href="G4VBasicShell_8cc-source.html#l00168">Complete()</a>. |
---|
692 | <p> |
---|
693 | <div class="fragment"><pre>00187 { |
---|
694 | 00188 G4String empty = <span class="stringliteral">""</span>; |
---|
695 | 00189 <span class="keywordflow">if</span>(aTree==NULL) <span class="keywordflow">return</span> empty; |
---|
696 | 00190 G4String pathName = aTree->GetPathName(); |
---|
697 | 00191 <span class="keywordflow">if</span>( aCommandPath.index( pathName ) == std::string::npos ) <span class="keywordflow">return</span> empty; |
---|
698 | 00192 G4String remainingPath = aCommandPath; |
---|
699 | 00193 remainingPath.remove(0,pathName.length()); |
---|
700 | 00194 size_t i = remainingPath.first(<span class="charliteral">'/'</span>); |
---|
701 | 00195 <span class="keywordflow">if</span>( i == std::string::npos ) { |
---|
702 | 00196 <span class="comment">// Look for number of matching commands :</span> |
---|
703 | 00197 std::vector<G4UIcommand*> commands; |
---|
704 | 00198 G4int n_commandEntry = aTree->GetCommandEntry(); |
---|
705 | 00199 <span class="keywordflow">for</span>( G4int i_thCommand = 1; i_thCommand <= n_commandEntry; i_thCommand++ ) { |
---|
706 | 00200 G4UIcommand* cmd = aTree->GetCommand(i_thCommand); |
---|
707 | 00201 G4String ss = cmd->GetCommandName(); |
---|
708 | 00202 ss.resize(remainingPath.length()); |
---|
709 | 00203 <span class="keywordflow">if</span>( remainingPath == ss ) commands.push_back(cmd); |
---|
710 | 00204 } |
---|
711 | 00205 n_commandEntry = commands.size(); |
---|
712 | 00206 <span class="keywordflow">if</span>(n_commandEntry==1) { |
---|
713 | 00207 <span class="keywordflow">return</span> (pathName + commands[0]->GetCommandName()); |
---|
714 | 00208 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (n_commandEntry>=2) { |
---|
715 | 00209 G4cout << <span class="stringliteral">"Matching commands :"</span> << G4endl; |
---|
716 | 00210 <span class="keywordflow">for</span>( G4int i_thCommand = 0; i_thCommand < n_commandEntry; i_thCommand++ ) { |
---|
717 | 00211 G4UIcommand* cmd = commands[i_thCommand]; |
---|
718 | 00212 G4cout << cmd->GetCommandName() << G4endl; |
---|
719 | 00213 } |
---|
720 | 00214 <span class="keywordflow">return</span> empty; |
---|
721 | 00215 } |
---|
722 | 00216 <span class="comment">// Look for sub tree :</span> |
---|
723 | 00217 std::vector<G4UIcommandTree*> trees; |
---|
724 | 00218 G4String nextPath = pathName; |
---|
725 | 00219 nextPath.append(remainingPath); |
---|
726 | 00220 G4int n_treeEntry = aTree->GetTreeEntry(); |
---|
727 | 00221 <span class="keywordflow">for</span>( G4int i_thTree = 1; i_thTree <= n_treeEntry; i_thTree++ ) { |
---|
728 | 00222 G4UIcommandTree* tree = aTree->GetTree(i_thTree); |
---|
729 | 00223 G4String ss = tree->GetPathName(); |
---|
730 | 00224 ss.resize(nextPath.length()); |
---|
731 | 00225 <span class="keywordflow">if</span>( nextPath == ss ) trees.push_back(tree); |
---|
732 | 00226 } |
---|
733 | 00227 n_treeEntry = trees.size(); |
---|
734 | 00228 <span class="keywordflow">if</span>(n_treeEntry==1) { |
---|
735 | 00229 <span class="keywordflow">return</span> trees[0]->GetPathName(); |
---|
736 | 00230 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (n_treeEntry>=2) { |
---|
737 | 00231 G4cout << <span class="stringliteral">"Matching directories :"</span> << G4endl; |
---|
738 | 00232 <span class="keywordflow">for</span>( G4int i_thTree = 0; i_thTree < n_treeEntry; i_thTree++ ) { |
---|
739 | 00233 G4UIcommandTree* tree = trees[i_thTree]; |
---|
740 | 00234 G4cout << tree->GetPathName() << G4endl; |
---|
741 | 00235 } |
---|
742 | 00236 <span class="keywordflow">return</span> empty; |
---|
743 | 00237 } <span class="keywordflow">else</span> { |
---|
744 | 00238 <span class="keywordflow">return</span> empty; <span class="comment">// No match.</span> |
---|
745 | 00239 } |
---|
746 | 00240 } <span class="keywordflow">else</span> { |
---|
747 | 00241 <span class="comment">// Find path</span> |
---|
748 | 00242 G4String nextPath = pathName; |
---|
749 | 00243 nextPath.append(remainingPath(0,i+1)); |
---|
750 | 00244 G4int n_treeEntry = aTree->GetTreeEntry(); |
---|
751 | 00245 <span class="keywordflow">for</span>( G4int i_thTree = 1; i_thTree <= n_treeEntry; i_thTree++ ) { |
---|
752 | 00246 G4UIcommandTree* tree = aTree->GetTree(i_thTree); |
---|
753 | 00247 <span class="keywordflow">if</span>( nextPath == tree->GetPathName() ) { |
---|
754 | 00248 <span class="keywordflow">return</span> <a class="code" href="classG4VBasicShell.html#b6">FindMatchingPath</a>(tree,aCommandPath ); |
---|
755 | 00249 } |
---|
756 | 00250 } |
---|
757 | 00251 } |
---|
758 | 00252 <span class="keywordflow">return</span> empty; |
---|
759 | 00253 } |
---|
760 | </pre></div> </td> |
---|
761 | </tr> |
---|
762 | </table> |
---|
763 | <a class="anchor" name="b1" doxytag="G4VBasicShell::GetCurrentWorkingDirectory" ></a><p> |
---|
764 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
765 | <tr> |
---|
766 | <td class="mdRow"> |
---|
767 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
768 | <tr> |
---|
769 | <td class="md" nowrap valign="top"> G4String G4VBasicShell::GetCurrentWorkingDirectory </td> |
---|
770 | <td class="md" valign="top">( </td> |
---|
771 | <td class="mdname1" valign="top" nowrap> </td> |
---|
772 | <td class="md" valign="top"> ) </td> |
---|
773 | <td class="md" nowrap><code> [protected]</code></td> |
---|
774 | </tr> |
---|
775 | |
---|
776 | </table> |
---|
777 | </td> |
---|
778 | </tr> |
---|
779 | </table> |
---|
780 | <table cellspacing=5 cellpadding=0 border=0> |
---|
781 | <tr> |
---|
782 | <td> |
---|
783 | |
---|
784 | </td> |
---|
785 | <td> |
---|
786 | |
---|
787 | <p> |
---|
788 | |
---|
789 | <p> |
---|
790 | Definition at line <a class="el" href="G4VBasicShell_8cc-source.html#l00070">70</a> of file <a class="el" href="G4VBasicShell_8cc-source.html">G4VBasicShell.cc</a>. |
---|
791 | <p> |
---|
792 | References <a class="el" href="G4VBasicShell_8hh-source.html#l00102">currentDirectory</a>. |
---|
793 | <p> |
---|
794 | Referenced by <a class="el" href="G4VBasicShell_8cc-source.html#l00286">ApplyShellCommand()</a>, <a class="el" href="G4UIterminal_8cc-source.html#l00155">G4UIterminal::GetCommand()</a>, <a class="el" href="G4VBasicShell_8cc-source.html#l00391">ListDirectory()</a>, and <a class="el" href="G4VBasicShell_8cc-source.html#l00407">TerminalHelp()</a>. |
---|
795 | <p> |
---|
796 | <div class="fragment"><pre>00071 { |
---|
797 | 00072 <span class="keywordflow">return</span> <a class="code" href="classG4VBasicShell.html#r0">currentDirectory</a>; |
---|
798 | 00073 } |
---|
799 | </pre></div> </td> |
---|
800 | </tr> |
---|
801 | </table> |
---|
802 | <a class="anchor" name="b8" doxytag="G4VBasicShell::GetHelpChoice" ></a><p> |
---|
803 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
804 | <tr> |
---|
805 | <td class="mdRow"> |
---|
806 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
807 | <tr> |
---|
808 | <td class="md" nowrap valign="top"> virtual G4bool G4VBasicShell::GetHelpChoice </td> |
---|
809 | <td class="md" valign="top">( </td> |
---|
810 | <td class="md" nowrap valign="top">G4int & </td> |
---|
811 | <td class="mdname1" valign="top" nowrap> </td> |
---|
812 | <td class="md" valign="top"> ) </td> |
---|
813 | <td class="md" nowrap><code> [protected, pure virtual]</code></td> |
---|
814 | </tr> |
---|
815 | |
---|
816 | </table> |
---|
817 | </td> |
---|
818 | </tr> |
---|
819 | </table> |
---|
820 | <table cellspacing=5 cellpadding=0 border=0> |
---|
821 | <tr> |
---|
822 | <td> |
---|
823 | |
---|
824 | </td> |
---|
825 | <td> |
---|
826 | |
---|
827 | <p> |
---|
828 | |
---|
829 | <p> |
---|
830 | Implemented in <a class="el" href="classG4UIQt.html#d4">G4UIQt</a>, <a class="el" href="classG4UIterminal.html#d2">G4UIterminal</a>, <a class="el" href="classG4UIWin32.html#d1">G4UIWin32</a>, <a class="el" href="classG4UIXaw.html#d1">G4UIXaw</a>, <a class="el" href="classG4UIXm.html#d1">G4UIXm</a>, and <a class="el" href="classG4UIGainServer.html#d3">G4UIGainServer</a>. |
---|
831 | <p> |
---|
832 | Referenced by <a class="el" href="G4VBasicShell_8cc-source.html#l00407">TerminalHelp()</a>. </td> |
---|
833 | </tr> |
---|
834 | </table> |
---|
835 | <a class="anchor" name="b13" doxytag="G4VBasicShell::ListDirectory" ></a><p> |
---|
836 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
837 | <tr> |
---|
838 | <td class="mdRow"> |
---|
839 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
840 | <tr> |
---|
841 | <td class="md" nowrap valign="top"> void G4VBasicShell::ListDirectory </td> |
---|
842 | <td class="md" valign="top">( </td> |
---|
843 | <td class="md" nowrap valign="top">G4String </td> |
---|
844 | <td class="mdname1" valign="top" nowrap> </td> |
---|
845 | <td class="md" valign="top"> ) </td> |
---|
846 | <td class="md" nowrap><code> [protected]</code></td> |
---|
847 | </tr> |
---|
848 | |
---|
849 | </table> |
---|
850 | </td> |
---|
851 | </tr> |
---|
852 | </table> |
---|
853 | <table cellspacing=5 cellpadding=0 border=0> |
---|
854 | <tr> |
---|
855 | <td> |
---|
856 | |
---|
857 | </td> |
---|
858 | <td> |
---|
859 | |
---|
860 | <p> |
---|
861 | |
---|
862 | <p> |
---|
863 | Reimplemented in <a class="el" href="classG4UIGainServer.html#d9">G4UIGainServer</a>. |
---|
864 | <p> |
---|
865 | Definition at line <a class="el" href="G4VBasicShell_8cc-source.html#l00391">391</a> of file <a class="el" href="G4VBasicShell_8cc-source.html">G4VBasicShell.cc</a>. |
---|
866 | <p> |
---|
867 | References <a class="el" href="G4VBasicShell_8cc-source.html#l00088">FindDirectory()</a>, and <a class="el" href="G4VBasicShell_8cc-source.html#l00070">GetCurrentWorkingDirectory()</a>. |
---|
868 | <p> |
---|
869 | Referenced by <a class="el" href="G4VBasicShell_8cc-source.html#l00286">ApplyShellCommand()</a>, and <a class="el" href="G4UIterminal_8cc-source.html#l00155">G4UIterminal::GetCommand()</a>. |
---|
870 | <p> |
---|
871 | <div class="fragment"><pre>00392 { |
---|
872 | 00393 G4String targetDir; |
---|
873 | 00394 <span class="keywordflow">if</span>( newCommand.length() <= 3 ) { |
---|
874 | 00395 targetDir = <a class="code" href="classG4VBasicShell.html#b1">GetCurrentWorkingDirectory</a>(); |
---|
875 | 00396 } <span class="keywordflow">else</span> { |
---|
876 | 00397 G4String newPrefix = newCommand(3,newCommand.length()-3); |
---|
877 | 00398 targetDir = newPrefix.strip(G4String::both); |
---|
878 | 00399 } |
---|
879 | 00400 G4UIcommandTree* commandTree = <a class="code" href="classG4VBasicShell.html#b3">FindDirectory</a>( targetDir ); |
---|
880 | 00401 <span class="keywordflow">if</span>( commandTree == NULL ) { |
---|
881 | 00402 G4cout << <span class="stringliteral">"Directory <"</span> << targetDir << <span class="stringliteral">"> is not found."</span> << G4endl; |
---|
882 | 00403 } <span class="keywordflow">else</span> { |
---|
883 | 00404 commandTree->ListCurrent(); |
---|
884 | 00405 } |
---|
885 | 00406 } |
---|
886 | </pre></div> </td> |
---|
887 | </tr> |
---|
888 | </table> |
---|
889 | |
---|
890 | <p> |
---|
891 | Here is the call graph for this function:<p><center><img src="classG4VBasicShell_b13_cgraph.png" border="0" usemap="#classG4VBasicShell_b13_cgraph_map" alt=""></center> |
---|
892 | <map name="classG4VBasicShell_b13_cgraph_map"> |
---|
893 | <area href="classG4VBasicShell.html#b3" shape="rect" coords="295,7,493,34" alt=""> |
---|
894 | <area href="classG4VBasicShell.html#b1" shape="rect" coords="250,58,538,85" alt=""> |
---|
895 | <area href="classG4VBasicShell.html#d0" shape="rect" coords="587,7,771,34" alt=""> |
---|
896 | </map> |
---|
897 | <a class="anchor" name="d0" doxytag="G4VBasicShell::ModifyPath" ></a><p> |
---|
898 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
899 | <tr> |
---|
900 | <td class="mdRow"> |
---|
901 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
902 | <tr> |
---|
903 | <td class="md" nowrap valign="top"> G4String G4VBasicShell::ModifyPath </td> |
---|
904 | <td class="md" valign="top">( </td> |
---|
905 | <td class="md" nowrap valign="top">G4String </td> |
---|
906 | <td class="mdname1" valign="top" nowrap> <em>tempPath</em> </td> |
---|
907 | <td class="md" valign="top"> ) </td> |
---|
908 | <td class="md" nowrap><code> [private]</code></td> |
---|
909 | </tr> |
---|
910 | |
---|
911 | </table> |
---|
912 | </td> |
---|
913 | </tr> |
---|
914 | </table> |
---|
915 | <table cellspacing=5 cellpadding=0 border=0> |
---|
916 | <tr> |
---|
917 | <td> |
---|
918 | |
---|
919 | </td> |
---|
920 | <td> |
---|
921 | |
---|
922 | <p> |
---|
923 | |
---|
924 | <p> |
---|
925 | Definition at line <a class="el" href="G4VBasicShell_8cc-source.html#l00125">125</a> of file <a class="el" href="G4VBasicShell_8cc-source.html">G4VBasicShell.cc</a>. |
---|
926 | <p> |
---|
927 | References <a class="el" href="G4VBasicShell_8hh-source.html#l00102">currentDirectory</a>. |
---|
928 | <p> |
---|
929 | Referenced by <a class="el" href="G4VBasicShell_8cc-source.html#l00075">ChangeDirectory()</a>, <a class="el" href="G4VBasicShell_8cc-source.html#l00168">Complete()</a>, <a class="el" href="G4VBasicShell_8cc-source.html#l00110">FindCommand()</a>, <a class="el" href="G4VBasicShell_8cc-source.html#l00088">FindDirectory()</a>, and <a class="el" href="G4VBasicShell_8cc-source.html#l00048">ModifyToFullPathCommand()</a>. |
---|
930 | <p> |
---|
931 | <div class="fragment"><pre>00126 { |
---|
932 | 00127 G4String newPath = <a class="code" href="classG4VBasicShell.html#r0">currentDirectory</a>; |
---|
933 | 00128 |
---|
934 | 00129 <span class="keywordflow">if</span>( tempPath.length()>0 ) |
---|
935 | 00130 { |
---|
936 | 00131 |
---|
937 | 00132 <span class="keywordflow">if</span>( tempPath(0) == <span class="charliteral">'/'</span> ) <span class="comment">// full path is given</span> |
---|
938 | 00133 { newPath = tempPath; } |
---|
939 | 00134 <span class="keywordflow">else</span> <span class="keywordflow">if</span>( tempPath(0) != <span class="charliteral">'.'</span> ) <span class="comment">// add current prefix</span> |
---|
940 | 00135 { newPath += tempPath; } |
---|
941 | 00136 <span class="keywordflow">else</span> <span class="keywordflow">if</span>( tempPath(0,2) == <span class="stringliteral">"./"</span> ) <span class="comment">// add current prefix</span> |
---|
942 | 00137 { newPath += (G4String)tempPath(2,tempPath.length()-2); } |
---|
943 | 00138 <span class="keywordflow">else</span> <span class="comment">// swim up with ".."</span> |
---|
944 | 00139 { |
---|
945 | 00140 <span class="keywordflow">while</span>( 1 ) |
---|
946 | 00141 { |
---|
947 | 00142 <span class="keywordflow">if</span>( tempPath(0,2) == <span class="stringliteral">".."</span> ) |
---|
948 | 00143 { |
---|
949 | 00144 <span class="keywordflow">if</span>( newPath != <span class="stringliteral">"/"</span> ) |
---|
950 | 00145 { |
---|
951 | 00146 G4String tmpString = (G4String)newPath(0,newPath.length()-1); |
---|
952 | 00147 newPath = (G4String)newPath(0,tmpString.last(<span class="charliteral">'/'</span>)+1); |
---|
953 | 00148 } |
---|
954 | 00149 <span class="keywordflow">if</span>( tempPath == <span class="stringliteral">".."</span> || tempPath == <span class="stringliteral">"../"</span> ) |
---|
955 | 00150 { <span class="keywordflow">break</span>; } |
---|
956 | 00151 tempPath = (G4String)tempPath(3,tempPath.length()-3); |
---|
957 | 00152 } |
---|
958 | 00153 <span class="keywordflow">else</span> |
---|
959 | 00154 { |
---|
960 | 00155 newPath += tempPath; |
---|
961 | 00156 <span class="keywordflow">break</span>; |
---|
962 | 00157 } |
---|
963 | 00158 } |
---|
964 | 00159 } |
---|
965 | 00160 |
---|
966 | 00161 } |
---|
967 | 00162 |
---|
968 | 00163 <span class="keywordflow">return</span> newPath; |
---|
969 | 00164 } |
---|
970 | </pre></div> </td> |
---|
971 | </tr> |
---|
972 | </table> |
---|
973 | <a class="anchor" name="b0" doxytag="G4VBasicShell::ModifyToFullPathCommand" ></a><p> |
---|
974 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
975 | <tr> |
---|
976 | <td class="mdRow"> |
---|
977 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
978 | <tr> |
---|
979 | <td class="md" nowrap valign="top"> G4String G4VBasicShell::ModifyToFullPathCommand </td> |
---|
980 | <td class="md" valign="top">( </td> |
---|
981 | <td class="md" nowrap valign="top">const char * </td> |
---|
982 | <td class="mdname1" valign="top" nowrap> <em>aCommandLine</em> </td> |
---|
983 | <td class="md" valign="top"> ) </td> |
---|
984 | <td class="md" nowrap><code> [protected]</code></td> |
---|
985 | </tr> |
---|
986 | |
---|
987 | </table> |
---|
988 | </td> |
---|
989 | </tr> |
---|
990 | </table> |
---|
991 | <table cellspacing=5 cellpadding=0 border=0> |
---|
992 | <tr> |
---|
993 | <td> |
---|
994 | |
---|
995 | </td> |
---|
996 | <td> |
---|
997 | |
---|
998 | <p> |
---|
999 | |
---|
1000 | <p> |
---|
1001 | Definition at line <a class="el" href="G4VBasicShell_8cc-source.html#l00048">48</a> of file <a class="el" href="G4VBasicShell_8cc-source.html">G4VBasicShell.cc</a>. |
---|
1002 | <p> |
---|
1003 | References <a class="el" href="G4VBasicShell_8cc-source.html#l00125">ModifyPath()</a>. |
---|
1004 | <p> |
---|
1005 | Referenced by <a class="el" href="G4VBasicShell_8cc-source.html#l00286">ApplyShellCommand()</a>, <a class="el" href="G4UIterminal_8cc-source.html#l00155">G4UIterminal::GetCommand()</a>, <a class="el" href="G4VBasicShell_8cc-source.html#l00367">ShowCurrent()</a>, <a class="el" href="G4VBasicShell_8cc-source.html#l00407">TerminalHelp()</a>, and <a class="el" href="G4UIQt_8cc-source.html#l00368">G4UIQt::TerminalHelp()</a>. |
---|
1006 | <p> |
---|
1007 | <div class="fragment"><pre>00049 { |
---|
1008 | 00050 G4String rawCommandLine = (G4String)aCommandLine; |
---|
1009 | 00051 <span class="keywordflow">if</span>(rawCommandLine.isNull()||rawCommandLine(0)==<span class="charliteral">'\0'</span>) <span class="keywordflow">return</span> rawCommandLine; |
---|
1010 | 00052 G4String commandLine = (G4String)rawCommandLine.strip(G4String::both); |
---|
1011 | 00053 G4String commandString; |
---|
1012 | 00054 G4String parameterString; |
---|
1013 | 00055 size_t i = commandLine.index(<span class="stringliteral">" "</span>); |
---|
1014 | 00056 <span class="keywordflow">if</span>( i != std::string::npos ) |
---|
1015 | 00057 { |
---|
1016 | 00058 commandString = (G4String)commandLine(0,i); |
---|
1017 | 00059 parameterString = <span class="stringliteral">" "</span>; |
---|
1018 | 00060 parameterString += (G4String)commandLine(i+1,commandLine.length()-(i+1)); |
---|
1019 | 00061 } |
---|
1020 | 00062 <span class="keywordflow">else</span> |
---|
1021 | 00063 { commandString = commandLine; } |
---|
1022 | 00064 |
---|
1023 | 00065 G4String fullPathCommandLine |
---|
1024 | 00066 = <a class="code" href="classG4VBasicShell.html#d0">ModifyPath</a>( commandString )+parameterString; |
---|
1025 | 00067 <span class="keywordflow">return</span> fullPathCommandLine; |
---|
1026 | 00068 } |
---|
1027 | </pre></div> </td> |
---|
1028 | </tr> |
---|
1029 | </table> |
---|
1030 | |
---|
1031 | <p> |
---|
1032 | Here is the call graph for this function:<p><center><img src="classG4VBasicShell_b0_cgraph.png" border="0" usemap="#classG4VBasicShell_b0_cgraph_map" alt=""></center> |
---|
1033 | <map name="classG4VBasicShell_b0_cgraph_map"> |
---|
1034 | <area href="classG4VBasicShell.html#d0" shape="rect" coords="339,8,523,34" alt=""> |
---|
1035 | </map> |
---|
1036 | <a class="anchor" name="a3" doxytag="G4VBasicShell::PauseSessionStart" ></a><p> |
---|
1037 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
1038 | <tr> |
---|
1039 | <td class="mdRow"> |
---|
1040 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
1041 | <tr> |
---|
1042 | <td class="md" nowrap valign="top"> virtual void G4VBasicShell::PauseSessionStart </td> |
---|
1043 | <td class="md" valign="top">( </td> |
---|
1044 | <td class="md" nowrap valign="top">G4String </td> |
---|
1045 | <td class="mdname1" valign="top" nowrap> <em>Prompt</em> </td> |
---|
1046 | <td class="md" valign="top"> ) </td> |
---|
1047 | <td class="md" nowrap><code> [pure virtual]</code></td> |
---|
1048 | </tr> |
---|
1049 | |
---|
1050 | </table> |
---|
1051 | </td> |
---|
1052 | </tr> |
---|
1053 | </table> |
---|
1054 | <table cellspacing=5 cellpadding=0 border=0> |
---|
1055 | <tr> |
---|
1056 | <td> |
---|
1057 | |
---|
1058 | </td> |
---|
1059 | <td> |
---|
1060 | |
---|
1061 | <p> |
---|
1062 | |
---|
1063 | <p> |
---|
1064 | Implemented in <a class="el" href="classG4UIQt.html#a7">G4UIQt</a>, <a class="el" href="classG4UIterminal.html#a4">G4UIterminal</a>, <a class="el" href="classG4UIWin32.html#a7">G4UIWin32</a>, <a class="el" href="classG4UIXaw.html#a5">G4UIXaw</a>, <a class="el" href="classG4UIXm.html#a7">G4UIXm</a>, and <a class="el" href="classG4UIGainServer.html#a1">G4UIGainServer</a>. </td> |
---|
1065 | </tr> |
---|
1066 | </table> |
---|
1067 | <a class="anchor" name="a2" doxytag="G4VBasicShell::SessionStart" ></a><p> |
---|
1068 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
1069 | <tr> |
---|
1070 | <td class="mdRow"> |
---|
1071 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
1072 | <tr> |
---|
1073 | <td class="md" nowrap valign="top"> virtual G4UIsession* G4VBasicShell::SessionStart </td> |
---|
1074 | <td class="md" valign="top">( </td> |
---|
1075 | <td class="mdname1" valign="top" nowrap> </td> |
---|
1076 | <td class="md" valign="top"> ) </td> |
---|
1077 | <td class="md" nowrap><code> [pure virtual]</code></td> |
---|
1078 | </tr> |
---|
1079 | |
---|
1080 | </table> |
---|
1081 | </td> |
---|
1082 | </tr> |
---|
1083 | </table> |
---|
1084 | <table cellspacing=5 cellpadding=0 border=0> |
---|
1085 | <tr> |
---|
1086 | <td> |
---|
1087 | |
---|
1088 | </td> |
---|
1089 | <td> |
---|
1090 | |
---|
1091 | <p> |
---|
1092 | |
---|
1093 | <p> |
---|
1094 | Implemented in <a class="el" href="classG4UIQt.html#a1">G4UIQt</a>, <a class="el" href="classG4UIterminal.html#a3">G4UIterminal</a>, <a class="el" href="classG4UIWin32.html#a1">G4UIWin32</a>, <a class="el" href="classG4UIXaw.html#a2">G4UIXaw</a>, <a class="el" href="classG4UIXm.html#a1">G4UIXm</a>, and <a class="el" href="classG4UIGainServer.html#a0">G4UIGainServer</a>. </td> |
---|
1095 | </tr> |
---|
1096 | </table> |
---|
1097 | <a class="anchor" name="b11" doxytag="G4VBasicShell::ShowCurrent" ></a><p> |
---|
1098 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
1099 | <tr> |
---|
1100 | <td class="mdRow"> |
---|
1101 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
1102 | <tr> |
---|
1103 | <td class="md" nowrap valign="top"> void G4VBasicShell::ShowCurrent </td> |
---|
1104 | <td class="md" valign="top">( </td> |
---|
1105 | <td class="md" nowrap valign="top">G4String </td> |
---|
1106 | <td class="mdname1" valign="top" nowrap> </td> |
---|
1107 | <td class="md" valign="top"> ) </td> |
---|
1108 | <td class="md" nowrap><code> [protected]</code></td> |
---|
1109 | </tr> |
---|
1110 | |
---|
1111 | </table> |
---|
1112 | </td> |
---|
1113 | </tr> |
---|
1114 | </table> |
---|
1115 | <table cellspacing=5 cellpadding=0 border=0> |
---|
1116 | <tr> |
---|
1117 | <td> |
---|
1118 | |
---|
1119 | </td> |
---|
1120 | <td> |
---|
1121 | |
---|
1122 | <p> |
---|
1123 | |
---|
1124 | <p> |
---|
1125 | Reimplemented in <a class="el" href="classG4UIGainServer.html#d13">G4UIGainServer</a>. |
---|
1126 | <p> |
---|
1127 | Definition at line <a class="el" href="G4VBasicShell_8cc-source.html#l00367">367</a> of file <a class="el" href="G4VBasicShell_8cc-source.html">G4VBasicShell.cc</a>. |
---|
1128 | <p> |
---|
1129 | References <a class="el" href="G4VBasicShell_8cc-source.html#l00048">ModifyToFullPathCommand()</a>. |
---|
1130 | <p> |
---|
1131 | Referenced by <a class="el" href="G4VBasicShell_8cc-source.html#l00286">ApplyShellCommand()</a>, and <a class="el" href="G4UIterminal_8cc-source.html#l00155">G4UIterminal::GetCommand()</a>. |
---|
1132 | <p> |
---|
1133 | <div class="fragment"><pre>00368 { |
---|
1134 | 00369 G4UImanager* UI = G4UImanager::GetUIpointer(); |
---|
1135 | 00370 <span class="keywordflow">if</span>(UI==NULL) <span class="keywordflow">return</span>; |
---|
1136 | 00371 G4String comString = newCommand(1,newCommand.length()-1); |
---|
1137 | 00372 G4String theCommand = <a class="code" href="classG4VBasicShell.html#b0">ModifyToFullPathCommand</a>(comString); |
---|
1138 | 00373 G4String curV = UI->GetCurrentValues(theCommand); |
---|
1139 | 00374 <span class="keywordflow">if</span>( ! curV.isNull() ) { |
---|
1140 | 00375 G4cout << <span class="stringliteral">"Current value(s) of the parameter(s) : "</span> << curV << G4endl; |
---|
1141 | 00376 } |
---|
1142 | 00377 } |
---|
1143 | </pre></div> </td> |
---|
1144 | </tr> |
---|
1145 | </table> |
---|
1146 | |
---|
1147 | <p> |
---|
1148 | Here is the call graph for this function:<p><center><img src="classG4VBasicShell_b11_cgraph.png" border="0" usemap="#classG4VBasicShell_b11_cgraph_map" alt=""></center> |
---|
1149 | <map name="classG4VBasicShell_b11_cgraph_map"> |
---|
1150 | <area href="classG4VBasicShell.html#b0" shape="rect" coords="253,8,536,34" alt=""> |
---|
1151 | <area href="classG4VBasicShell.html#d0" shape="rect" coords="585,8,769,34" alt=""> |
---|
1152 | </map> |
---|
1153 | <a class="anchor" name="b14" doxytag="G4VBasicShell::TerminalHelp" ></a><p> |
---|
1154 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
1155 | <tr> |
---|
1156 | <td class="mdRow"> |
---|
1157 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
1158 | <tr> |
---|
1159 | <td class="md" nowrap valign="top"> void G4VBasicShell::TerminalHelp </td> |
---|
1160 | <td class="md" valign="top">( </td> |
---|
1161 | <td class="md" nowrap valign="top">G4String </td> |
---|
1162 | <td class="mdname1" valign="top" nowrap> </td> |
---|
1163 | <td class="md" valign="top"> ) </td> |
---|
1164 | <td class="md" nowrap><code> [protected]</code></td> |
---|
1165 | </tr> |
---|
1166 | |
---|
1167 | </table> |
---|
1168 | </td> |
---|
1169 | </tr> |
---|
1170 | </table> |
---|
1171 | <table cellspacing=5 cellpadding=0 border=0> |
---|
1172 | <tr> |
---|
1173 | <td> |
---|
1174 | |
---|
1175 | </td> |
---|
1176 | <td> |
---|
1177 | |
---|
1178 | <p> |
---|
1179 | |
---|
1180 | <p> |
---|
1181 | Reimplemented in <a class="el" href="classG4UIQt.html#d1">G4UIQt</a>, and <a class="el" href="classG4UIGainServer.html#d10">G4UIGainServer</a>. |
---|
1182 | <p> |
---|
1183 | Definition at line <a class="el" href="G4VBasicShell_8cc-source.html#l00407">407</a> of file <a class="el" href="G4VBasicShell_8cc-source.html">G4VBasicShell.cc</a>. |
---|
1184 | <p> |
---|
1185 | References <a class="el" href="classG4VBasicShell.html#b9">ExitHelp()</a>, <a class="el" href="G4VBasicShell_8cc-source.html#l00070">GetCurrentWorkingDirectory()</a>, <a class="el" href="classG4VBasicShell.html#b8">GetHelpChoice()</a>, and <a class="el" href="G4VBasicShell_8cc-source.html#l00048">ModifyToFullPathCommand()</a>. |
---|
1186 | <p> |
---|
1187 | Referenced by <a class="el" href="G4VBasicShell_8cc-source.html#l00286">ApplyShellCommand()</a>, and <a class="el" href="G4UIterminal_8cc-source.html#l00155">G4UIterminal::GetCommand()</a>. |
---|
1188 | <p> |
---|
1189 | <div class="fragment"><pre>00408 { |
---|
1190 | 00409 G4UImanager* UI = G4UImanager::GetUIpointer(); |
---|
1191 | 00410 <span class="keywordflow">if</span>(UI==NULL) <span class="keywordflow">return</span>; |
---|
1192 | 00411 G4UIcommandTree * treeTop = UI->GetTree(); |
---|
1193 | 00412 size_t i = newCommand.index(<span class="stringliteral">" "</span>); |
---|
1194 | 00413 <span class="keywordflow">if</span>( i != std::string::npos ) |
---|
1195 | 00414 { |
---|
1196 | 00415 G4String newValue = newCommand(i+1,newCommand.length()-(i+1)); |
---|
1197 | 00416 newValue.strip(G4String::both); |
---|
1198 | 00417 G4String targetCom = <a class="code" href="classG4VBasicShell.html#b0">ModifyToFullPathCommand</a>( newValue ); |
---|
1199 | 00418 G4UIcommand* theCommand = treeTop->FindPath( targetCom ); |
---|
1200 | 00419 <span class="keywordflow">if</span>( theCommand != NULL ) |
---|
1201 | 00420 { |
---|
1202 | 00421 theCommand->List(); |
---|
1203 | 00422 <span class="keywordflow">return</span>; |
---|
1204 | 00423 } |
---|
1205 | 00424 <span class="keywordflow">else</span> |
---|
1206 | 00425 { |
---|
1207 | 00426 G4cout << <span class="stringliteral">"Command <"</span> << newValue << <span class="stringliteral">" is not found."</span> << G4endl; |
---|
1208 | 00427 <span class="keywordflow">return</span>; |
---|
1209 | 00428 } |
---|
1210 | 00429 } |
---|
1211 | 00430 |
---|
1212 | 00431 G4UIcommandTree * floor[10]; |
---|
1213 | 00432 floor[0] = treeTop; |
---|
1214 | 00433 G4int iFloor = 0; |
---|
1215 | 00434 size_t prefixIndex = 1; |
---|
1216 | 00435 G4String prefix = <a class="code" href="classG4VBasicShell.html#b1">GetCurrentWorkingDirectory</a>(); |
---|
1217 | 00436 <span class="keywordflow">while</span>( prefixIndex < prefix.length()-1 ) |
---|
1218 | 00437 { |
---|
1219 | 00438 size_t ii = prefix.index(<span class="stringliteral">"/"</span>,prefixIndex); |
---|
1220 | 00439 floor[iFloor+1] = |
---|
1221 | 00440 floor[iFloor]->GetTree(G4String(prefix(0,ii+1))); |
---|
1222 | 00441 prefixIndex = ii+1; |
---|
1223 | 00442 iFloor++; |
---|
1224 | 00443 } |
---|
1225 | 00444 floor[iFloor]->ListCurrentWithNum(); |
---|
1226 | 00445 <span class="comment">// 1998 Oct 2 non-number input</span> |
---|
1227 | 00446 <span class="keywordflow">while</span>(1){ |
---|
1228 | 00447 <span class="comment">//G4cout << G4endl << "Type the number ( 0:end, -n:n level back ) : "<<std::flush;</span> |
---|
1229 | 00448 G4cout << G4endl << <span class="stringliteral">"Type the number ( 0:end, -n:n level back ) : "</span><<G4endl; |
---|
1230 | 00449 G4int i; |
---|
1231 | 00450 <span class="keywordflow">if</span>(!<a class="code" href="classG4VBasicShell.html#b8">GetHelpChoice</a>(i)){ |
---|
1232 | 00451 G4cout << G4endl << <span class="stringliteral">"Not a number, once more"</span> << G4endl; |
---|
1233 | 00452 <span class="keywordflow">continue</span>; |
---|
1234 | 00453 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( i < 0 ){ |
---|
1235 | 00454 iFloor += i; |
---|
1236 | 00455 <span class="keywordflow">if</span>( iFloor < 0 ) iFloor = 0; |
---|
1237 | 00456 floor[iFloor]->ListCurrentWithNum(); |
---|
1238 | 00457 <span class="keywordflow">continue</span>; |
---|
1239 | 00458 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(i == 0) { |
---|
1240 | 00459 <span class="keywordflow">break</span>; |
---|
1241 | 00460 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( i > 0 ) { |
---|
1242 | 00461 G4int n_tree = floor[iFloor]->GetTreeEntry(); |
---|
1243 | 00462 <span class="keywordflow">if</span>( i > n_tree ) |
---|
1244 | 00463 { |
---|
1245 | 00464 <span class="keywordflow">if</span>( i <= n_tree + floor[iFloor]->GetCommandEntry() ) |
---|
1246 | 00465 { |
---|
1247 | 00466 floor[iFloor]->GetCommand(i-n_tree)->List(); |
---|
1248 | 00467 } |
---|
1249 | 00468 } |
---|
1250 | 00469 <span class="keywordflow">else</span> |
---|
1251 | 00470 { |
---|
1252 | 00471 floor[iFloor+1] = floor[iFloor]->GetTree(i); |
---|
1253 | 00472 iFloor++; |
---|
1254 | 00473 floor[iFloor]->ListCurrentWithNum(); |
---|
1255 | 00474 } |
---|
1256 | 00475 } |
---|
1257 | 00476 } |
---|
1258 | 00477 G4cout << <span class="stringliteral">"Exit from HELP."</span> << G4endl << G4endl; |
---|
1259 | 00478 <span class="comment">//G4cout << G4endl;</span> |
---|
1260 | 00479 <a class="code" href="classG4VBasicShell.html#b9">ExitHelp</a>(); |
---|
1261 | 00480 } |
---|
1262 | </pre></div> </td> |
---|
1263 | </tr> |
---|
1264 | </table> |
---|
1265 | |
---|
1266 | <p> |
---|
1267 | Here is the call graph for this function:<p><center><img src="classG4VBasicShell_b14_cgraph.png" border="0" usemap="#classG4VBasicShell_b14_cgraph_map" alt=""></center> |
---|
1268 | <map name="classG4VBasicShell_b14_cgraph_map"> |
---|
1269 | <area href="classG4VBasicShell.html#b9" shape="rect" coords="313,8,481,34" alt=""> |
---|
1270 | <area href="classG4VBasicShell.html#b1" shape="rect" coords="253,58,541,85" alt=""> |
---|
1271 | <area href="classG4VBasicShell.html#b8" shape="rect" coords="293,109,501,136" alt=""> |
---|
1272 | <area href="classG4VBasicShell.html#b0" shape="rect" coords="256,160,538,186" alt=""> |
---|
1273 | <area href="classG4VBasicShell.html#d0" shape="rect" coords="590,160,774,186" alt=""> |
---|
1274 | </map> |
---|
1275 | <hr><h2>Member Data Documentation</h2> |
---|
1276 | <a class="anchor" name="r0" doxytag="G4VBasicShell::currentDirectory" ></a><p> |
---|
1277 | <table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
---|
1278 | <tr> |
---|
1279 | <td class="mdRow"> |
---|
1280 | <table cellpadding="0" cellspacing="0" border="0"> |
---|
1281 | <tr> |
---|
1282 | <td class="md" nowrap valign="top"> G4String <a class="el" href="classG4VBasicShell.html#r0">G4VBasicShell::currentDirectory</a><code> [private]</code> |
---|
1283 | </table> |
---|
1284 | </td> |
---|
1285 | </tr> |
---|
1286 | </table> |
---|
1287 | <table cellspacing=5 cellpadding=0 border=0> |
---|
1288 | <tr> |
---|
1289 | <td> |
---|
1290 | |
---|
1291 | </td> |
---|
1292 | <td> |
---|
1293 | |
---|
1294 | <p> |
---|
1295 | |
---|
1296 | <p> |
---|
1297 | Definition at line <a class="el" href="G4VBasicShell_8hh-source.html#l00102">102</a> of file <a class="el" href="G4VBasicShell_8hh-source.html">G4VBasicShell.hh</a>. |
---|
1298 | <p> |
---|
1299 | Referenced by <a class="el" href="G4VBasicShell_8cc-source.html#l00075">ChangeDirectory()</a>, <a class="el" href="G4VBasicShell_8cc-source.html#l00070">GetCurrentWorkingDirectory()</a>, and <a class="el" href="G4VBasicShell_8cc-source.html#l00125">ModifyPath()</a>. </td> |
---|
1300 | </tr> |
---|
1301 | </table> |
---|
1302 | <hr>The documentation for this class was generated from the following files:<ul> |
---|
1303 | <li><a class="el" href="G4VBasicShell_8hh-source.html">G4VBasicShell.hh</a><li><a class="el" href="G4VBasicShell_8cc-source.html">G4VBasicShell.cc</a></ul> |
---|
1304 | <hr size="1"><address style="align: right;"><small>Generated on Fri Jun 22 11:07:59 2007 by |
---|
1305 | <a href="http://www.doxygen.org/index.html"> |
---|
1306 | <img src="doxygen.png" alt="doxygen" align="middle" border=0 > |
---|
1307 | </a>1.3.4 </small></address> |
---|
1308 | </body> |
---|
1309 | </html> |
---|