36 :guidance(NULL),broadcastCommands(true)
40 :guidance(NULL),broadcastCommands(true)
49 for( i=0; i < n_treeEntry; i++ )
66 G4String remainingPath = commandPath;
68 if( remainingPath.
isNull() )
79 if( i ==
G4int(std::string::npos) )
83 for(
G4int i_thCommand = 0; i_thCommand < n_commandEntry; i_thCommand++ )
85 if( remainingPath ==
command[i_thCommand]->GetCommandName() )
90 command.push_back( newCommand );
97 nextPath.
append(remainingPath(0,i+1));
99 for(
G4int i_thTree = 0; i_thTree < n_treeEntry; i_thTree++ )
104 tree[i_thTree]->AddNewCommand( newCommand, workerThreadOnly );
109 tree.push_back( newTree );
120 G4String remainingPath = commandPath;
122 if( remainingPath.
isNull() )
129 if( i ==
G4int(std::string::npos) )
133 for(
G4int i_thCommand = 0; i_thCommand < n_commandEntry; i_thCommand++ )
135 if( remainingPath ==
command[i_thCommand]->GetCommandName() )
146 nextPath.
append(remainingPath(0,i+1));
148 for(
G4int i_thTree = 0; i_thTree < n_treeEntry; i_thTree++ )
152 tree[i_thTree]->RemoveCommand( aCommand );
153 G4int n_commandRemain =
tree[i_thTree]->GetCommandEntry();
155 if(n_commandRemain == 0 && n_treeRemain == 0)
173 G4String remainingPath = commandPath;
178 if( i ==
G4int(std::string::npos) )
182 for(
G4int i_thCommand = 0; i_thCommand < n_commandEntry; i_thCommand++ )
184 if( remainingPath ==
command[i_thCommand]->GetCommandName() )
185 {
return command[i_thCommand]; }
192 nextPath.
append(remainingPath(0,i+1));
194 for(
G4int i_thTree = 0; i_thTree < n_treeEntry; i_thTree++ )
197 {
return tree[i_thTree]->FindPath( commandPath ); }
211 G4String remainingPath = commandPath;
216 if( i !=
G4int(std::string::npos) )
220 nextPath.
append(remainingPath(0,i+1));
222 for(
G4int i_thTree = 0; i_thTree < n_treeEntry; i_thTree++ )
225 return tree[i_thTree];
228 return tree[i_thTree]->FindCommandTree( commandPath );
240 G4String remainingPath = aCommandPath;
246 if(jpre !=
G4int(G4String::npos)) pName.
remove(jpre+1);
253 if( pName.
index( pName ) == std::string::npos )
return empty;
255 std::vector<G4String> paths;
265 for(
G4int idir=1; idir<=Ndir; idir++) {
268 if( fpdir.
index(remainingPath, 0) == 0) {
270 matchingPath = fpdir;
275 paths.push_back(fpdir);
279 if (paths.size()>=2) {
281 for(
unsigned int i_thCommand = 0; i_thCommand < paths.size(); i_thCommand++ ) {
287 std::vector<G4String> commands;
289 for(
G4int icmd=1; icmd<=Ncmd; icmd++){
293 if( fpcmd.
index(remainingPath, 0) ==0) {
295 matchingPath= fpcmd +
" ";
301 commands.push_back(fpcmd+
" ");
305 if (commands.size()>=2) {
307 for(
unsigned int i_thCommand = 0; i_thCommand < commands.size(); i_thCommand++ ) {
321 int nlen1= str1.length();
322 int nlen2= str2.length();
324 int nmin = nlen1<nlen2 ? nlen1 : nlen2;
327 for(
size_t i=0;
G4int(i)<nmin; i++){
328 if(str1[i]==str2[i]) {
329 strMatched+= str1[i];
344 for(
G4int i_thTree = 0; i_thTree < n_treeEntry; i_thTree++ )
346 G4cout <<
" " <<
tree[i_thTree]->GetPathName();
356 for(
G4int i_thCommand = 0; i_thCommand < n_commandEntry; i_thCommand++ )
359 if(
command[i_thCommand]->IsWorkerThreadOnly())
374 for(
G4int i_thTree = 0; i_thTree < n_treeEntry; i_thTree++ )
377 G4cout <<
" " << i <<
") " <<
tree[i_thTree]->GetPathName()
378 <<
" " <<
tree[i_thTree]->GetTitle() <<
G4endl;
382 for(
G4int i_thCommand = 0; i_thCommand < n_commandEntry; i_thCommand++ )
385 G4cout <<
" " << i <<
") " <<
command[i_thCommand]->GetCommandName()
394 for(
G4int i_thCommand = 0; i_thCommand < n_commandEntry; i_thCommand++ )
399 for(
G4int i_thTree = 0; i_thTree < n_treeEntry; i_thTree++ )
401 tree[i_thTree]->List();
409 while((idxs=fn.
index(
"/"))!=
G4int(std::string::npos))
429 sx +=
"&";
break;
440 std::ofstream oF(ofileName, std::ios::out);
451 oF <<
"<p><hr><p>" <<
G4endl;
453 oF <<
"<h2>Sub-directories : </h2><dl>" <<
G4endl;
454 for(
G4int i_thTree = 0; i_thTree <
G4int(
tree.size()); i_thTree++ )
459 tree[i_thTree]->CreateHTML();
462 oF <<
"</dl><p><hr><p>" <<
G4endl;
464 oF <<
"<h2>Commands : </h2><dl>" <<
G4endl;
475 oF <<
"<p><dd>" <<
G4endl;
480 std::vector<G4ApplicationState>* availabelStateList = cmd->
GetStateList();
481 if(availabelStateList->size()==6)
482 { oF <<
"<p><dd>Available at all Geant4 states." <<
G4endl; }
485 oF <<
"<p><dd>Available Geant4 state(s) : ";
486 for(
G4int ias=0;ias<
G4int(availabelStateList->size());ias++)
491 oF <<
"<p><dd>Parameters<table border=1>" <<
G4endl;
500 oF <<
"Omittable : ";
502 { oF <<
"current value is used as the default value." <<
G4endl; }
512 oF <<
"</table>" <<
G4endl;
517 oF <<
"</dl></body></html>" <<
G4endl;
G4UIcommandTree * FindCommandTree(const char *commandPath)
Try to match a command or a path with the one given.
G4String GetParameterCandidates() const
const G4String & GetRange() const
G4bool IsWorkerThreadOnly() const
G4String & remove(str_size)
G4UIcommand * FindPath(const char *commandPath) const
G4int GetCommandEntry() const
G4int operator==(const G4UIcommandTree &right) const
G4String GetParameterName() const
G4UIcommand * GetCommand(G4int i)
void SetToBeBroadcasted(G4bool val)
G4int GetTreeEntry() const
G4int operator!=(const G4UIcommandTree &right) const
std::vector< G4UIcommand * > command
const G4String & GetGuidanceLine(G4int i) const
std::vector< G4UIcommandTree * > tree
G4bool IsOmittable() const
static G4StateManager * GetStateManager()
G4bool ToBeBroadcasted() const
G4GLOB_DLL std::ostream G4cout
str_size index(const char *, G4int pos=0) const
G4UIcommandTree * GetTree(G4int i)
G4UIparameter * GetParameter(G4int i) const
void ListCurrentWithNum() const
void RemoveCommand(G4UIcommand *aCommand, G4bool workerThreadOnly=false)
const G4String & GetCommandPath() const
G4String GetFirstMatchedString(const G4String &, const G4String &) const
G4String ModStr(const char *strS)
const G4String GetPathName() const
const G4String & GetCommandName() const
void SetWorkerThreadOnly(G4bool val=true)
const G4String GetTitle() const
void AddNewCommand(G4UIcommand *newCommand, G4bool workerThreadOnly=false)
G4String & append(const G4String &)
G4String GetDefaultValue() const
std::vector< G4ApplicationState > * GetStateList()
const G4UIcommand * GetGuidance() const
char GetParameterType() const
G4String CreateFileName(const char *pName)
G4String GetParameterRange() const
G4int GetGuidanceEntries() const
G4int GetParameterEntries() const
G4bool GetCurrentAsDefault() const
G4String CompleteCommandPath(const G4String &commandPath)
G4String GetStateString(G4ApplicationState aState) const