| 45 | } |
| 46 | |
| 47 | long INIReader::GetInteger(const string §ion, const string &name, const long &default_value) { |
| 48 | string valstr = Get(section, name, ""); |
| 49 | const char* value = valstr.c_str(); |
| 50 | char* end; |
| 51 | // This parses "1234" (decimal) and also "0x4D2" (hex) |
| 52 | long n = strtol(value, &end, 0); |
| 53 | return end > value ? n : default_value; |
| 54 | } |
| 55 | |
| 56 | int INIReader::ValueHandler(void* user, const char* section, const char* name, const char* value) { |
| 57 | INIReader* reader = (INIReader*) user; |