Restructured some for clarity, got rid of the crappy JSON library, general awesomeness.

This commit is contained in:
Thulinma 2012-04-07 23:45:03 +02:00
parent 022ff26205
commit e3ecdb1e4b
34 changed files with 965 additions and 6996 deletions

37
util/config.h Normal file
View file

@ -0,0 +1,37 @@
/// \file config.h
/// Contains generic function headers for managing configuration.
#include <string>
#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
/// Contains utility code, not directly related to streaming media
namespace Util{
/// Deals with parsing configuration from files or commandline options.
class Config{
private:
bool ignore_daemon;
bool ignore_interface;
bool ignore_port;
bool ignore_user;
public:
std::string confsection;
std::string configfile;
bool daemon_mode;
std::string interface;
int listen_port;
std::string username;
Config();
void parseArgs(int argc, char ** argv);
void parseFile();
};
/// Will set the active user to the named username.
void setUser(std::string user);
/// Will turn the current process into a daemon.
void Daemonize();
};