summaryrefslogtreecommitdiff
path: root/src/settings.h
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2014-02-05 00:05:58 -0500
committerkwolekr <kwolekr@minetest.net>2014-02-05 00:05:58 -0500
commitc6c5edd73a97f2991113ba48d9c2415222fe4709 (patch)
treee894c58afc17bf475bcfb9ced574a0b02b0fa7d7 /src/settings.h
parent7859e57f6c4bafe6d9213be905b16cc3e015ee07 (diff)
downloadminetest-c6c5edd73a97f2991113ba48d9c2415222fe4709.tar.gz
minetest-c6c5edd73a97f2991113ba48d9c2415222fe4709.tar.bz2
minetest-c6c5edd73a97f2991113ba48d9c2415222fe4709.zip
Revert "Fix settings to honor numeric conversion errors"
This reverts commit 3f376a092e1c16429fb52f24736e9da98aff4cd5.
Diffstat (limited to 'src/settings.h')
-rw-r--r--src/settings.h42
1 files changed, 11 insertions, 31 deletions
diff --git a/src/settings.h b/src/settings.h
index 11b11e635..f019ce50c 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -745,19 +745,17 @@ fail:
}
//////////// Try to get value, no exception thrown
- bool getNoEx(std::string name, std::string &val)
+ bool tryGet(std::string name, std::string &val)
{
try {
val = get(name);
return true;
} catch (SettingNotFoundException &e) {
return false;
- } catch (NumericException &e) {
- return false;
}
}
- bool getFlagStrNoEx(std::string name, u32 &val, FlagDesc *flagdesc)
+ bool tryGetFlagStr(std::string name, u32 &val, FlagDesc *flagdesc)
{
try {
val = getFlagStr(name, flagdesc);
@@ -767,111 +765,93 @@ fail:
}
}
- bool getFloatNoEx(std::string name, float &val)
+ bool tryGetFloat(std::string name, float &val)
{
try {
val = getFloat(name);
return true;
} catch (SettingNotFoundException &e) {
return false;
- } catch (NumericException &e) {
- return false;
}
}
- bool getU16NoEx(std::string name, int &val)
+ bool tryGetU16(std::string name, int &val)
{
try {
val = getU16(name);
return true;
} catch (SettingNotFoundException &e) {
return false;
- } catch (NumericException &e) {
- return false;
}
}
- bool getU16NoEx(std::string name, u16 &val)
+ bool tryGetU16(std::string name, u16 &val)
{
try {
val = getU16(name);
return true;
} catch (SettingNotFoundException &e) {
return false;
- } catch (NumericException &e) {
- return false;
}
}
- bool getS16NoEx(std::string name, int &val)
+ bool tryGetS16(std::string name, int &val)
{
try {
val = getU16(name);
return true;
} catch (SettingNotFoundException &e) {
return false;
- } catch (NumericException &e) {
- return false;
}
}
- bool getS16NoEx(std::string name, s16 &val)
+ bool tryGetS16(std::string name, s16 &val)
{
try {
val = getS16(name);
return true;
} catch (SettingNotFoundException &e) {
return false;
- } catch (NumericException &e) {
- return false;
}
}
- bool getS32NoEx(std::string name, s32 &val)
+ bool tryGetS32(std::string name, s32 &val)
{
try {
val = getS32(name);
return true;
} catch (SettingNotFoundException &e) {
return false;
- } catch (NumericException &e) {
- return false;
}
}
- bool getV3FNoEx(std::string name, v3f &val)
+ bool tryGetV3F(std::string name, v3f &val)
{
try {
val = getV3F(name);
return true;
} catch (SettingNotFoundException &e) {
return false;
- } catch (NumericException &e) {
- return false;
}
}
- bool getV2FNoEx(std::string name, v2f &val)
+ bool tryGetV2F(std::string name, v2f &val)
{
try {
val = getV2F(name);
return true;
} catch (SettingNotFoundException &e) {
return false;
- } catch (NumericException &e) {
- return false;
}
}
- bool getU64NoEx(std::string name, u64 &val)
+ bool tryGetU64(std::string name, u64 &val)
{
try {
val = getU64(name);
return true;
} catch (SettingNotFoundException &e) {
return false;
- } catch (NumericException &e) {
- return false;
}
}