Changeset 560 for code/branches/FICN/src/misc
- Timestamp:
- Dec 17, 2007, 3:20:46 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/misc/String2Number.h
r507 r560 5 5 #include <sstream> 6 6 #include <iostream> 7 8 #include "../orxonox/core/Debug.h" 7 9 8 10 /** … … 16 18 * 17 19 * @example 18 * float f; 20 * float f; 19 21 * String2Number<float>(f, std::string(" 123.45 ")); 20 22 */ … … 29 31 * 30 32 * First value is the target variable, the second vector is the 31 * string where the number is taken from, the third parameter 33 * string where the number is taken from, the third parameter 32 34 * should be one of std::hex, std::dec or std::oct (dec is default value) 33 35 */ … … 36 38 std::istringstream iss(s); 37 39 success_ = !(iss >> f >> t).fail(); 38 40 39 41 if (!success_ && haltOnError==1) 40 42 { 41 std::cout << "Conversion error from string to number in \"" << s << "\"" << std::endl;43 COUT(1) << "Error: Conversion from string to number in \"" << s << "\" failed." << std::endl; 42 44 exit(1); 43 45 }
Note: See TracChangeset
for help on using the changeset viewer.