mirror of
https://github.com/minetest/minetestmapper.git
synced 2024-11-25 00:43:51 +01:00
ecc2b31f78
I noticed it didn't work correctly in some cases...
19 lines
365 B
C++
19 lines
365 B
C++
#ifndef UTIL_H
|
|
#define UTIL_H
|
|
|
|
#include <string>
|
|
#include <fstream>
|
|
|
|
std::string read_setting(const std::string &name, std::istream &is);
|
|
|
|
inline std::string read_setting_default(const std::string &name, std::istream &is, const std::string &def)
|
|
{
|
|
try {
|
|
return read_setting(name, is);
|
|
} catch(const std::runtime_error &e) {
|
|
return def;
|
|
}
|
|
}
|
|
|
|
#endif // UTIL_H
|