31#define G4UIparsing_hh 1
45 std::istringstream is(s);
54 std::ostringstream os;
64 auto tmpval = std::stoll(str);
65 if(tmpval > LONG_MAX || tmpval < LONG_MIN) {
66 G4cerr <<
"input string '" << str <<
"' out-of-range for conversion to 'long int' value" <<
G4endl;
71 auto tmpval = std::stol(str);
73 G4cerr <<
"input string '" << str <<
"' out-of-range for conversion to 'int' value" <<
G4endl;
85 if (*p ==
'+' || *p ==
'-') {
88 if (isdigit((
G4int)(*p)) != 0) {
89 while (isdigit((
G4int)(*p)) != 0) {
94 if (length > maxDigits) {
98 return ChkMax(str,maxDigits);
109 return IsInt(str, 7);
119 if (isdigit(*p) != 0) {
120 while (isdigit((
G4int)(*p)) != 0) {
134 if (*p ==
'e' || *p ==
'E') {
137 if (isdigit(*p) != 0) {
138 while (isdigit((
G4int)(*p)) != 0) {
144 if (*p ==
'e' || *p ==
'E') {
158 if (isdigit(*p) != 0) {
159 while (isdigit((
G4int)(*p)) != 0) {
165 if (*p ==
'e' || *p ==
'E') {
173 if (isdigit(*p) != 0) {
174 while (isdigit((
G4int)(*p)) != 0) {
180 if (*p ==
'e' || *p ==
'E') {
186 if (isdigit(*p) != 0) {
187 while (isdigit((
G4int)(*p)) != 0) {
193 if (*p ==
'e' || *p ==
'E') {
201 if (*p ==
'e' || *p ==
'E') {
204 if (isdigit(*p) != 0) {
205 while (isdigit((
G4int)(*p)) != 0) {
211 if (*p ==
'e' || *p ==
'E') {
227 result =
static_cast<G4int>(arg1 > arg2);
230 result =
static_cast<G4int>(arg1 >= arg2);
233 result =
static_cast<G4int>(arg1 < arg2);
236 result =
static_cast<G4int>(arg1 <= arg2);
239 result =
static_cast<G4int>(arg1 == arg2);
242 result =
static_cast<G4int>(arg1 != arg2);
245 G4cerr <<
"Parameter range: error at CompareInt" <<
G4endl;
257 result =
static_cast<G4int>(arg1 > arg2);
260 result =
static_cast<G4int>(arg1 >= arg2);
263 result =
static_cast<G4int>(arg1 < arg2);
266 result =
static_cast<G4int>(arg1 <= arg2);
269 result =
static_cast<G4int>(arg1 == arg2);
272 result =
static_cast<G4int>(arg1 != arg2);
275 G4cerr <<
"Parameter range: error at CompareInt" <<
G4endl;
287 result =
static_cast<G4int>(arg1 > arg2);
290 result =
static_cast<G4int>(arg1 >= arg2);
293 result =
static_cast<G4int>(arg1 < arg2);
296 result =
static_cast<G4int>(arg1 <= arg2);
299 result =
static_cast<G4int>(arg1 == arg2);
302 result =
static_cast<G4int>(arg1 != arg2);
305 G4cerr <<
"Parameter range: error at CompareDouble" <<
G4endl;
G4GLOB_DLL std::ostream G4cerr
G4bool IsDouble(const char *str)
G4bool ExpectExponent(const char *str)
G4bool ChkMax(const char *str, short maxDigits)
T StoT(const G4String &s)
G4int CompareLong(G4long arg1, G4int op, G4long arg2, G4int &errCode)
G4int CompareDouble(G4double arg1, G4int op, G4double arg2, G4int &errCode)
G4bool IsInt(const char *str, short maxDigits)
G4int CompareInt(G4int arg1, G4int op, G4int arg2, G4int &errCode)