00001 // ******************************************************************** 00002 // * License and Disclaimer * 00003 // * * 00004 // * The Geant4 software is copyright of the Copyright Holders of * 00005 // * the Geant4 Collaboration. It is provided under the terms and * 00006 // * conditions of the Geant4 Software License, included in the file * 00007 // * LICENSE and available at http://cern.ch/geant4/license . These * 00008 // * include a list of copyright holders. * 00009 // * * 00010 // * Neither the authors of this software system, nor their employing * 00011 // * institutes,nor the agencies providing financial support for this * 00012 // * work make any representation or warranty, express or implied, * 00013 // * regarding this software system or assume any liability for its * 00014 // * use. Please see the license in the file LICENSE and URL above * 00015 // * for the full disclaimer and the limitation of liability. * 00016 // * * 00017 // * This code implementation is the result of the scientific and * 00018 // * technical work of the GEANT4 collaboration. * 00019 // * By using, copying, modifying or distributing the software (or * 00020 // * any work based on the software) you agree to acknowledge its * 00021 // * use in resulting scientific publications, and indicate your * 00022 // * acceptance of all terms of the Geant4 Software license. * 00023 // ******************************************************************** 00024 // 00025 // 00026 // $Id: G4UIaliasList.cc,v 1.6 2006-06-29 19:08:33 gunter Exp $ 00027 // 00028 00029 #include "G4AnyType.hh" 00030 #include "G4UIcommand.hh" 00031 #include "G4Types.hh" 00032 #include "G4ThreeVector.hh" 00033 00034 template <> void G4AnyType::Ref<bool>::FromString(const std::string& val) { 00035 fRef = G4UIcommand::ConvertToBool(val.c_str()); 00036 } 00037 00038 template <> void G4AnyType::Ref<G4String>::FromString(const std::string& val) { 00039 if (val[0] == '"' ) fRef = val.substr(1,val.size()-2); 00040 else fRef = val; 00041 } 00042 00043 template <> void G4AnyType::Ref<G4ThreeVector>::FromString(const std::string& val) { 00044 fRef = G4UIcommand::ConvertTo3Vector(val.c_str()); 00045 }