[571] | 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>G4UIterminal.cc Source File</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>G4UIterminal.cc</h1><a href="G4UIterminal_8cc.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">//</span> |
---|
| 9 | 00002 <span class="comment">// ********************************************************************</span> |
---|
| 10 | 00003 <span class="comment">// * License and Disclaimer *</span> |
---|
| 11 | 00004 <span class="comment">// * *</span> |
---|
| 12 | 00005 <span class="comment">// * The Geant4 software is copyright of the Copyright Holders of *</span> |
---|
| 13 | 00006 <span class="comment">// * the Geant4 Collaboration. It is provided under the terms and *</span> |
---|
| 14 | 00007 <span class="comment">// * conditions of the Geant4 Software License, included in the file *</span> |
---|
| 15 | 00008 <span class="comment">// * LICENSE and available at http://cern.ch/geant4/license . These *</span> |
---|
| 16 | 00009 <span class="comment">// * include a list of copyright holders. *</span> |
---|
| 17 | 00010 <span class="comment">// * *</span> |
---|
| 18 | 00011 <span class="comment">// * Neither the authors of this software system, nor their employing *</span> |
---|
| 19 | 00012 <span class="comment">// * institutes,nor the agencies providing financial support for this *</span> |
---|
| 20 | 00013 <span class="comment">// * work make any representation or warranty, express or implied, *</span> |
---|
| 21 | 00014 <span class="comment">// * regarding this software system or assume any liability for its *</span> |
---|
| 22 | 00015 <span class="comment">// * use. Please see the license in the file LICENSE and URL above *</span> |
---|
| 23 | 00016 <span class="comment">// * for the full disclaimer and the limitation of liability. *</span> |
---|
| 24 | 00017 <span class="comment">// * *</span> |
---|
| 25 | 00018 <span class="comment">// * This code implementation is the result of the scientific and *</span> |
---|
| 26 | 00019 <span class="comment">// * technical work of the GEANT4 collaboration. *</span> |
---|
| 27 | 00020 <span class="comment">// * By using, copying, modifying or distributing the software (or *</span> |
---|
| 28 | 00021 <span class="comment">// * any work based on the software) you agree to acknowledge its *</span> |
---|
| 29 | 00022 <span class="comment">// * use in resulting scientific publications, and indicate your *</span> |
---|
| 30 | 00023 <span class="comment">// * acceptance of all terms of the Geant4 Software license. *</span> |
---|
| 31 | 00024 <span class="comment">// ********************************************************************</span> |
---|
| 32 | 00025 <span class="comment">//</span> |
---|
| 33 | 00026 <span class="comment">//</span> |
---|
| 34 | 00027 <span class="comment">// $Id: G4UIterminal.cc,v 1.21 2006/06/29 19:09:56 gunter Exp $</span> |
---|
| 35 | 00028 <span class="comment">// GEANT4 tag $Name: geant4-08-01-patch-01 $</span> |
---|
| 36 | 00029 <span class="comment">//</span> |
---|
| 37 | 00030 |
---|
| 38 | 00031 <span class="preprocessor">#include "G4Types.hh"</span> |
---|
| 39 | 00032 <span class="preprocessor">#include "G4StateManager.hh"</span> |
---|
| 40 | 00033 <span class="preprocessor">#include "G4UIcommandTree.hh"</span> |
---|
| 41 | 00034 <span class="preprocessor">#include "G4UIcommand.hh"</span> |
---|
| 42 | 00035 <span class="preprocessor">#include "G4UIcommandStatus.hh"</span> |
---|
| 43 | 00036 <span class="preprocessor">#include "<a class="code" href="G4UIterminal_8hh.html">G4UIterminal.hh</a>"</span> |
---|
| 44 | 00037 <span class="preprocessor">#include "<a class="code" href="G4UIcsh_8hh.html">G4UIcsh.hh</a>"</span> |
---|
| 45 | 00038 <span class="preprocessor">#include <sstream></span> |
---|
| 46 | 00039 |
---|
| 47 | 00040 |
---|
| 48 | <a name="l00042"></a><a class="code" href="classG4UIterminal.html#a0">00042</a> <a class="code" href="classG4UIterminal.html#a0">G4UIterminal::G4UIterminal</a>(<a class="code" href="classG4VUIshell.html">G4VUIshell</a>* aShell) |
---|
| 49 | 00044 { |
---|
| 50 | 00045 <a class="code" href="classG4UIterminal.html#r0">UI</a>= G4UImanager::GetUIpointer(); |
---|
| 51 | 00046 <a class="code" href="classG4UIterminal.html#r0">UI</a>-> SetSession(<span class="keyword">this</span>); |
---|
| 52 | 00047 <a class="code" href="classG4UIterminal.html#r0">UI</a>-> SetCoutDestination(<span class="keyword">this</span>); |
---|
| 53 | 00048 |
---|
| 54 | 00049 <a class="code" href="classG4UIterminal.html#r2">iExit</a>= FALSE; |
---|
| 55 | 00050 <a class="code" href="classG4UIterminal.html#r3">iCont</a>= FALSE; |
---|
| 56 | 00051 |
---|
| 57 | 00052 <span class="keywordflow">if</span>(aShell) <a class="code" href="classG4UIterminal.html#r1">shell</a>= aShell; |
---|
| 58 | 00053 <span class="keywordflow">else</span> <a class="code" href="classG4UIterminal.html#r1">shell</a>= <span class="keyword">new</span> <a class="code" href="classG4UIcsh.html">G4UIcsh</a>; |
---|
| 59 | 00054 } |
---|
| 60 | 00055 |
---|
| 61 | <a name="l00057"></a><a class="code" href="classG4UIterminal.html#a1">00057</a> <a class="code" href="classG4UIterminal.html#a1">G4UIterminal::~G4UIterminal</a>() |
---|
| 62 | 00058 |
---|
| 63 | 00059 { |
---|
| 64 | 00060 <span class="keywordflow">if</span>(<a class="code" href="classG4UIterminal.html#r1">shell</a>) <span class="keyword">delete</span> <a class="code" href="classG4UIterminal.html#r1">shell</a>; |
---|
| 65 | 00061 |
---|
| 66 | 00062 <span class="keywordflow">if</span>(G4UImanager::GetUIpointer()) { |
---|
| 67 | 00063 <a class="code" href="classG4UIterminal.html#r0">UI</a>-> SetSession(NULL); |
---|
| 68 | 00064 <a class="code" href="classG4UIterminal.html#r0">UI</a>-> SetCoutDestination(NULL); |
---|
| 69 | 00065 } |
---|
| 70 | 00066 } |
---|
| 71 | 00067 |
---|
| 72 | 00068 |
---|
| 73 | <a name="l00070"></a><a class="code" href="classG4UIterminal.html#a2">00070</a> <span class="keywordtype">void</span> <a class="code" href="classG4UIterminal.html#a2">G4UIterminal::SetPrompt</a>(<span class="keyword">const</span> G4String& prompt) |
---|
| 74 | 00071 |
---|
| 75 | 00072 { |
---|
| 76 | 00073 <a class="code" href="classG4UIterminal.html#r1">shell</a>-> <a class="code" href="classG4UIterminal.html#a2">SetPrompt</a>(prompt); |
---|
| 77 | 00074 } |
---|
| 78 | 00075 |
---|
| 79 | <a name="l00077"></a><a class="code" href="classG4UIterminal.html#a3">00077</a> G4UIsession* <a class="code" href="classG4UIterminal.html#a3">G4UIterminal::SessionStart</a>() |
---|
| 80 | 00079 { |
---|
| 81 | 00080 <a class="code" href="classG4UIterminal.html#r2">iExit</a>= TRUE; |
---|
| 82 | 00081 |
---|
| 83 | 00082 G4String newCommand= <a class="code" href="classG4UIterminal.html#d1">GetCommand</a>(); |
---|
| 84 | 00083 <span class="keywordflow">while</span>(<a class="code" href="classG4UIterminal.html#r2">iExit</a>){ |
---|
| 85 | 00084 <a class="code" href="classG4UIterminal.html#d0">ExecuteCommand</a>(newCommand); |
---|
| 86 | 00085 newCommand= <a class="code" href="classG4UIterminal.html#d1">GetCommand</a>(); |
---|
| 87 | 00086 } |
---|
| 88 | 00087 <span class="keywordflow">return</span> NULL; |
---|
| 89 | 00088 } |
---|
| 90 | 00089 |
---|
| 91 | <a name="l00091"></a><a class="code" href="classG4UIterminal.html#a4">00091</a> <span class="keywordtype">void</span> <a class="code" href="classG4UIterminal.html#a4">G4UIterminal::PauseSessionStart</a>(G4String msg) |
---|
| 92 | 00093 { |
---|
| 93 | 00094 <a class="code" href="classG4UIterminal.html#r3">iCont</a>= TRUE; |
---|
| 94 | 00095 |
---|
| 95 | 00096 G4String newCommand= <a class="code" href="classG4UIterminal.html#d1">GetCommand</a>(msg); |
---|
| 96 | 00097 <span class="keywordflow">while</span>(<a class="code" href="classG4UIterminal.html#r3">iCont</a>){ |
---|
| 97 | 00098 <a class="code" href="classG4UIterminal.html#d0">ExecuteCommand</a>(newCommand); |
---|
| 98 | 00099 newCommand= <a class="code" href="classG4UIterminal.html#d1">GetCommand</a>(msg); |
---|
| 99 | 00100 } |
---|
| 100 | 00101 } |
---|
| 101 | 00102 |
---|
| 102 | <a name="l00104"></a><a class="code" href="classG4UIterminal.html#d0">00104</a> <span class="keywordtype">void</span> <a class="code" href="classG4UIterminal.html#d0">G4UIterminal::ExecuteCommand</a>(G4String aCommand) |
---|
| 103 | 00106 { |
---|
| 104 | 00107 <span class="keywordflow">if</span>(aCommand.length()<2) <span class="keywordflow">return</span>; |
---|
| 105 | 00108 |
---|
| 106 | 00109 G4int returnVal = <a class="code" href="classG4UIterminal.html#r0">UI</a>-> ApplyCommand(aCommand); |
---|
| 107 | 00110 |
---|
| 108 | 00111 G4int paramIndex = returnVal % 100; |
---|
| 109 | 00112 <span class="comment">// 0 - 98 : paramIndex-th parameter is invalid</span> |
---|
| 110 | 00113 <span class="comment">// 99 : convination of parameters is invalid</span> |
---|
| 111 | 00114 G4int commandStatus = returnVal - paramIndex; |
---|
| 112 | 00115 |
---|
| 113 | 00116 G4UIcommand* cmd = 0; |
---|
| 114 | 00117 <span class="keywordflow">if</span>(commandStatus!=fCommandSucceeded) |
---|
| 115 | 00118 { cmd = <a class="code" href="classG4VBasicShell.html#b4">FindCommand</a>(aCommand); } |
---|
| 116 | 00119 |
---|
| 117 | 00120 <span class="keywordflow">switch</span>(commandStatus) { |
---|
| 118 | 00121 <span class="keywordflow">case</span> fCommandSucceeded: |
---|
| 119 | 00122 <span class="keywordflow">break</span>; |
---|
| 120 | 00123 <span class="keywordflow">case</span> fCommandNotFound: |
---|
| 121 | 00124 G4cerr << <span class="stringliteral">"command <"</span> << <a class="code" href="classG4UIterminal.html#r0">UI</a>->SolveAlias(aCommand) << <span class="stringliteral">"> not found"</span> << G4endl; |
---|
| 122 | 00125 <span class="keywordflow">if</span>( aCommand.index(<span class="stringliteral">"@@"</span>) != G4String::npos) { |
---|
| 123 | 00126 G4cout << <span class="stringliteral">"@@G4UIterminal"</span> << G4endl; |
---|
| 124 | 00127 } |
---|
| 125 | 00128 <span class="keywordflow">break</span>; |
---|
| 126 | 00129 <span class="keywordflow">case</span> fIllegalApplicationState: |
---|
| 127 | 00130 G4cerr << <span class="stringliteral">"illegal application state -- command refused"</span> << G4endl; |
---|
| 128 | 00131 <span class="keywordflow">break</span>; |
---|
| 129 | 00132 <span class="keywordflow">case</span> fParameterOutOfRange: |
---|
| 130 | 00133 <span class="comment">// if(paramIndex<99) {</span> |
---|
| 131 | 00134 <span class="comment">// G4cerr << "Parameter is out of range (index " << paramIndex << ")" << G4endl;</span> |
---|
| 132 | 00135 <span class="comment">// G4cerr << "Allowed range : " << cmd->GetParameter(paramIndex)->GetParameterRange() << G4endl;</span> |
---|
| 133 | 00136 <span class="comment">// } else {</span> |
---|
| 134 | 00137 <span class="comment">// G4cerr << "Parameter is out of range" << G4endl;</span> |
---|
| 135 | 00138 <span class="comment">// G4cerr << "Allowed range : " << cmd->GetRange() << G4endl;</span> |
---|
| 136 | 00139 <span class="comment">// }</span> |
---|
| 137 | 00140 <span class="keywordflow">break</span>; |
---|
| 138 | 00141 <span class="keywordflow">case</span> fParameterOutOfCandidates: |
---|
| 139 | 00142 G4cerr << <span class="stringliteral">"Parameter is out of candidate list (index "</span> << paramIndex << <span class="stringliteral">")"</span> << G4endl; |
---|
| 140 | 00143 G4cerr << <span class="stringliteral">"Candidates : "</span> << cmd->GetParameter(paramIndex)->GetParameterCandidates() << G4endl; |
---|
| 141 | 00144 <span class="keywordflow">break</span>; |
---|
| 142 | 00145 <span class="keywordflow">case</span> fParameterUnreadable: |
---|
| 143 | 00146 G4cerr << <span class="stringliteral">"Parameter is wrong type and/or is not omittable (index "</span> << paramIndex << <span class="stringliteral">")"</span> << G4endl; |
---|
| 144 | 00147 <span class="keywordflow">break</span>; |
---|
| 145 | 00148 <span class="keywordflow">case</span> fAliasNotFound: |
---|
| 146 | 00149 <span class="keywordflow">default</span>: |
---|
| 147 | 00150 G4cerr << <span class="stringliteral">"command refused ("</span> << commandStatus << <span class="stringliteral">")"</span> << G4endl; |
---|
| 148 | 00151 } |
---|
| 149 | 00152 } |
---|
| 150 | 00153 |
---|
| 151 | <a name="l00155"></a><a class="code" href="classG4UIterminal.html#d1">00155</a> G4String <a class="code" href="classG4UIterminal.html#d1">G4UIterminal::GetCommand</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* msg) |
---|
| 152 | 00157 { |
---|
| 153 | 00158 G4String newCommand; |
---|
| 154 | 00159 G4String nullString; |
---|
| 155 | 00160 |
---|
| 156 | 00161 newCommand= <a class="code" href="classG4UIterminal.html#r1">shell</a>-> GetCommandLine(msg); |
---|
| 157 | 00162 |
---|
| 158 | 00163 G4String nC= newCommand.strip(G4String::leading); |
---|
| 159 | 00164 <span class="keywordflow">if</span>( nC.length() == 0 ) { |
---|
| 160 | 00165 newCommand= nullString; |
---|
| 161 | 00166 |
---|
| 162 | 00167 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( nC(0) == <span class="charliteral">'#'</span> ) { |
---|
| 163 | 00168 G4cout << nC << G4endl; |
---|
| 164 | 00169 newCommand= nullString; |
---|
| 165 | 00170 |
---|
| 166 | 00171 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(nC==<span class="stringliteral">"ls"</span> || nC(0,3)==<span class="stringliteral">"ls "</span> ) { <span class="comment">// list commands</span> |
---|
| 167 | 00172 <a class="code" href="classG4VBasicShell.html#b13">ListDirectory</a>(nC); |
---|
| 168 | 00173 newCommand= nullString; |
---|
| 169 | 00174 |
---|
| 170 | 00175 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(nC==<span class="stringliteral">"lc"</span> || nC(0,3)==<span class="stringliteral">"lc "</span> ) { <span class="comment">// ... by shell</span> |
---|
| 171 | 00176 <a class="code" href="classG4UIterminal.html#r1">shell</a>-> ListCommand(nC.remove(0,2)); |
---|
| 172 | 00177 newCommand= nullString; |
---|
| 173 | 00178 |
---|
| 174 | 00179 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(nC == <span class="stringliteral">"pwd"</span>) { <span class="comment">// show current directory</span> |
---|
| 175 | 00180 G4cout << <span class="stringliteral">"Current Command Directory : "</span> |
---|
| 176 | 00181 << <a class="code" href="classG4VBasicShell.html#b1">GetCurrentWorkingDirectory</a>() << G4endl; |
---|
| 177 | 00182 newCommand= nullString; |
---|
| 178 | 00183 |
---|
| 179 | 00184 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(nC == <span class="stringliteral">"cwd"</span>) { <span class="comment">// ... by shell</span> |
---|
| 180 | 00185 <a class="code" href="classG4UIterminal.html#r1">shell</a>-> ShowCurrentDirectory(); |
---|
| 181 | 00186 newCommand= nullString; |
---|
| 182 | 00187 |
---|
| 183 | 00188 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(nC == <span class="stringliteral">"cd"</span> || nC(0,3) == <span class="stringliteral">"cd "</span>) { <span class="comment">// "cd"</span> |
---|
| 184 | 00189 <a class="code" href="classG4VBasicShell.html#b12">ChangeDirectoryCommand</a>(nC); |
---|
| 185 | 00190 <a class="code" href="classG4UIterminal.html#r1">shell</a>-> SetCurrentDirectory(<a class="code" href="classG4VBasicShell.html#b1">GetCurrentWorkingDirectory</a>()); |
---|
| 186 | 00191 newCommand= nullString; |
---|
| 187 | 00192 |
---|
| 188 | 00193 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(nC == <span class="stringliteral">"help"</span> || nC(0,5) == <span class="stringliteral">"help "</span>) { <span class="comment">// "help"</span> |
---|
| 189 | 00194 <a class="code" href="classG4VBasicShell.html#b14">TerminalHelp</a>(nC); |
---|
| 190 | 00195 newCommand= nullString; |
---|
| 191 | 00196 |
---|
| 192 | 00197 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(nC(0) == <span class="charliteral">'?'</span>) { <span class="comment">// "show current value of a parameter"</span> |
---|
| 193 | 00198 <a class="code" href="classG4VBasicShell.html#b11">ShowCurrent</a>(nC); |
---|
| 194 | 00199 newCommand= nullString; |
---|
| 195 | 00200 |
---|
| 196 | 00201 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(nC == <span class="stringliteral">"hist"</span> || nC == <span class="stringliteral">"history"</span>) { <span class="comment">// "hist/history"</span> |
---|
| 197 | 00202 G4int nh= <a class="code" href="classG4UIterminal.html#r0">UI</a>-> GetNumberOfHistory(); |
---|
| 198 | 00203 <span class="keywordflow">for</span> (G4int i=0; i<nh; i++) { |
---|
| 199 | 00204 G4cout << i << <span class="stringliteral">": "</span> << <a class="code" href="classG4UIterminal.html#r0">UI</a>->GetPreviousCommand(i) << G4endl; |
---|
| 200 | 00205 } |
---|
| 201 | 00206 newCommand= nullString; |
---|
| 202 | 00207 |
---|
| 203 | 00208 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(nC(0) == <span class="charliteral">'!'</span>) { <span class="comment">// "!"</span> |
---|
| 204 | 00209 G4String ss= nC(1, nC.length()-1); |
---|
| 205 | 00210 G4int vl; |
---|
| 206 | 00211 <span class="keyword">const</span> <span class="keywordtype">char</span>* tt= ss; |
---|
| 207 | 00212 std::istringstream is(tt); |
---|
| 208 | 00213 is >> vl; |
---|
| 209 | 00214 G4int nh= <a class="code" href="classG4UIterminal.html#r0">UI</a>-> GetNumberOfHistory(); |
---|
| 210 | 00215 <span class="keywordflow">if</span>(vl>=0 && vl<nh) { |
---|
| 211 | 00216 newCommand= <a class="code" href="classG4UIterminal.html#r0">UI</a>-> GetPreviousCommand(vl); |
---|
| 212 | 00217 G4cout << newCommand << G4endl; |
---|
| 213 | 00218 } <span class="keywordflow">else</span> { |
---|
| 214 | 00219 G4cerr << <span class="stringliteral">"history "</span> << vl << <span class="stringliteral">" is not found."</span> << G4endl; |
---|
| 215 | 00220 newCommand= nullString; |
---|
| 216 | 00221 } |
---|
| 217 | 00222 |
---|
| 218 | 00223 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(nC == <span class="stringliteral">"exit"</span>) { <span class="comment">// "exit"</span> |
---|
| 219 | 00224 <span class="keywordflow">if</span>(<a class="code" href="classG4UIterminal.html#r3">iCont</a>) { |
---|
| 220 | 00225 G4cout << <span class="stringliteral">"You are now processing RUN."</span> << G4endl; |
---|
| 221 | 00226 G4cout << <span class="stringliteral">"Please abort it using \"/run/abort\" command first"</span> << G4endl; |
---|
| 222 | 00227 G4cout << <span class="stringliteral">" and use \"continue\" command until the application"</span> |
---|
| 223 | 00228 << G4endl; |
---|
| 224 | 00229 G4cout << <span class="stringliteral">" becomes to Idle."</span> << G4endl; |
---|
| 225 | 00230 } <span class="keywordflow">else</span> { |
---|
| 226 | 00231 <a class="code" href="classG4UIterminal.html#r2">iExit</a>= FALSE; |
---|
| 227 | 00232 newCommand= nullString; |
---|
| 228 | 00233 } |
---|
| 229 | 00234 |
---|
| 230 | 00235 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( nC == <span class="stringliteral">"cont"</span> || nC == <span class="stringliteral">"continue"</span>){ <span class="comment">// "cont/continu"</span> |
---|
| 231 | 00236 <a class="code" href="classG4UIterminal.html#r3">iCont</a>= FALSE; |
---|
| 232 | 00237 newCommand= nullString; |
---|
| 233 | 00238 |
---|
| 234 | 00239 } <span class="keywordflow">else</span> <span class="keywordflow">if</span>( nC.empty() ){ <span class="comment">// NULL command</span> |
---|
| 235 | 00240 newCommand= nullString; |
---|
| 236 | 00241 |
---|
| 237 | 00242 } <span class="keywordflow">else</span> { |
---|
| 238 | 00243 } |
---|
| 239 | 00244 |
---|
| 240 | 00245 <span class="keywordflow">return</span> <a class="code" href="classG4VBasicShell.html#b0">ModifyToFullPathCommand</a>(newCommand); |
---|
| 241 | 00246 } |
---|
| 242 | 00247 |
---|
| 243 | 00248 |
---|
| 244 | <a name="l00250"></a><a class="code" href="classG4UIterminal.html#a5">00250</a> G4int <a class="code" href="classG4UIterminal.html#a5">G4UIterminal::ReceiveG4cout</a>(G4String coutString) |
---|
| 245 | 00252 { |
---|
| 246 | 00253 std::cout << coutString << std::flush; |
---|
| 247 | 00254 <span class="keywordflow">return</span> 0; |
---|
| 248 | 00255 } |
---|
| 249 | 00256 |
---|
| 250 | <a name="l00258"></a><a class="code" href="classG4UIterminal.html#a6">00258</a> G4int <a class="code" href="classG4UIterminal.html#a6">G4UIterminal::ReceiveG4cerr</a>(G4String cerrString) |
---|
| 251 | 00260 { |
---|
| 252 | 00261 std::cerr << cerrString << std::flush; |
---|
| 253 | 00262 <span class="keywordflow">return</span> 0; |
---|
| 254 | 00263 } |
---|
| 255 | 00264 |
---|
| 256 | <a name="l00266"></a><a class="code" href="classG4UIterminal.html#d2">00266</a> G4bool <a class="code" href="classG4UIterminal.html#d2">G4UIterminal::GetHelpChoice</a>(G4int& aInt) |
---|
| 257 | 00268 { |
---|
| 258 | 00269 G4cin >> aInt; |
---|
| 259 | 00270 <span class="keywordflow">if</span>(!G4cin.good()){ |
---|
| 260 | 00271 G4cin.clear(); |
---|
| 261 | 00272 G4cin.ignore(30,<span class="charliteral">'\n'</span>); |
---|
| 262 | 00273 <span class="keywordflow">return</span> FALSE; |
---|
| 263 | 00274 } |
---|
| 264 | 00275 <span class="keywordflow">return</span> TRUE; |
---|
| 265 | 00276 } |
---|
| 266 | 00277 |
---|
| 267 | <a name="l00279"></a><a class="code" href="classG4UIterminal.html#d3">00279</a> <span class="keywordtype">void</span> <a class="code" href="classG4UIterminal.html#d3">G4UIterminal::ExitHelp</a>() |
---|
| 268 | 00281 { |
---|
| 269 | 00282 <span class="keywordtype">char</span> temp[100]; |
---|
| 270 | 00283 G4cin.getline(temp, 100); |
---|
| 271 | 00284 } |
---|
| 272 | 00285 |
---|
| 273 | </pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri Jun 22 11:07:02 2007 by |
---|
| 274 | <a href="http://www.doxygen.org/index.html"> |
---|
| 275 | <img src="doxygen.png" alt="doxygen" align="middle" border=0 > |
---|
| 276 | </a>1.3.4 </small></address> |
---|
| 277 | </body> |
---|
| 278 | </html> |
---|