Changeset 4624 in orxonox.OLD for orxonox/trunk/src/util/loading/load_param.cc
- Timestamp:
- Jun 13, 2005, 8:32:05 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/loading/load_param.cc
r4623 r4624 113 113 } 114 114 115 116 int isInt(const char* Int, int defaultValue) 117 { 118 char* endPtr = NULL; 119 int result = strtol(Int, &endPtr, 10); 120 121 if ( endPtr >= Int && endPtr < Int + strlen(Int)) 122 return defaultValue; 123 else 124 return result; 125 } 126 127 float isFloat(const char* Float, float defaultValue) 128 { 129 char* endPtr = NULL; 130 double result = strtod(Float, &endPtr); 131 132 if ( endPtr >= Float && endPtr < Float + strlen(Float)) 133 return defaultValue; 134 else 135 return result; 136 } 137 138 const char* isString(const char* string, const char* defaultValue) 139 { 140 if (string != NULL) 141 return string; 142 else 143 return defaultValue; 144 } 145 146 115 147 /** 116 148 \param descriptionText The text to set as a description for this Parameter
Note: See TracChangeset
for help on using the changeset viewer.