File: util.h

package info (click to toggle)
minetestmapper 20180325-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 236 kB
  • sloc: cpp: 2,101; ansic: 32; makefile: 9; sh: 9
file content (18 lines) | stat: -rw-r--r-- 358 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#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(std::runtime_error e) {
		return def;
	}
}

#endif // UTIL_H