33 #include "G4String.hh"
39 std::string::size_type begIdx, std::string::size_type& endIdx)
41 while ( line[begIdx] ==
' ') ++begIdx;
42 if ( line[begIdx] ==
'"' ) {
43 endIdx = line.find(
'"', begIdx+1);
44 if ( endIdx == std::string::npos ) endIdx = line.length();
45 token = line.substr(begIdx+1, (endIdx-1)-begIdx);
49 endIdx = line.find(
' ', begIdx);
50 if ( endIdx == std::string::npos ) endIdx = line.length();
51 token = line.substr(begIdx, endIdx-begIdx);
53 return ( token.length() > 0 );
67 <<
" Illegal value of number of bins: nbins <= 0" <<
G4endl;
85 <<
" Illegal values of (xmin >= xmax)" <<
G4endl;
95 <<
" Illegal value of (xmin = 0) with logarithmic binning" <<
G4endl;
108 if ( edges.size() <= 1 ) {
111 <<
" Illegal edges vector (size <= 1)" <<
G4endl;
124 if ( ! name.size() ) {
127 <<
" Empty " << objectType <<
" name is not allowed." <<
G4endl
128 <<
" " << objectType <<
" was not created." <<
G4endl;
141 if ( unit !=
"none" ) {
143 if ( value == 0. ) value = 1.;
153 if ( fcnName !=
"none" ) { title +=
" "; title += fcnName; title +=
"("; }
154 if ( unitName !=
"none" ) { title +=
" ["; title += unitName; title +=
"]";}
155 if ( fcnName !=
"none" ) { title +=
")"; }
162 std::string::size_type begIdx = 0;
163 std::string::size_type endIdx = 0;
167 if ( GetToken(line, token, begIdx, endIdx) ) {
170 tokens.push_back(token);
174 while ( endIdx != line.length() );
std::ostringstream G4ExceptionDescription
void UpdateTitle(G4String &title, const G4String &unitName, const G4String &fcnName)
static G4double GetValueOf(const G4String &)
G4bool CheckName(const G4String &name, const G4String &objectType)
G4bool CheckMinMax(G4double xmin, G4double xmax, const G4String &binSchemeName)
G4double GetUnitValue(const G4String &unit)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void Tokenize(const G4String &line, std::vector< G4String > &tokens)
G4BinScheme GetBinScheme(const G4String &binSchemeName)
G4bool CheckNbins(G4int nbins)
G4bool CheckEdges(const std::vector< G4double > &edges)