Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

# G4InteractorMessenger.cc File Reference

Go to the source code of this file.

## Functions
G4bool | GetValues (G4String, int, G4String *)

## Function Documentation

G4bool GetValues | ( | G4String | ,
|  | int | ,
|  | G4String * |
| ) | `[static]`

| Definition at line 110 of file G4InteractorMessenger.cc. Referenced by G4InteractorMessenger::SetNewValue().
    00115 {
    00116   char* value = STRDUP(newValue.data());
    00117   if(value==NULL) return false;
    00118   char* tok = strtok(value," ");
    00119   for( int i=0; i<paramn;i++ ) {
    00120     if(tok==NULL) {
    00121       STRDEL(value);
    00122       return false;
    00123     }
    00124     G4String token = tok;
    00125     if( token(0)=='"' ) {
    00126       while( token(token.length()-1) != '"' ) {
    00127         tok = strtok(NULL," ");
    00128         if( (tok==NULL) || (*tok=='\0')) {
    00129           STRDEL(value);
    00130           return false;
    00131         }
    00132         token += " ";
    00133         token += tok;
    00134       }
    00135       token = (G4String)token.strip(G4String::both,'"');
    00136     }
    00137     if( token.isNull() ) {
    00138       STRDEL(value);
    00139       return false;
    00140     } else {
    00141       params[i] = token;
    00142     }
    00143     tok = strtok(NULL," ");
    00144   }
    00145   STRDEL(value);
    00146   return true;
    00147 }