2005-11-09 21:44:34 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
// FILE: configparser.h
|
|
|
|
// AUTHOR: Johannes Winkelmann, jw@tks6.net
|
|
|
|
// COPYRIGHT: (c) 2002-2005 by Johannes Winkelmann
|
|
|
|
// ---------------------------------------------------------------------
|
2006-02-23 14:18:42 +00:00
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation; either version 2 of the License, or
|
|
|
|
// (at your option) any later version.
|
2005-11-09 21:44:34 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _CONFIGPARSER_H_
|
|
|
|
#define _CONFIGPARSER_H_
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
struct Config
|
|
|
|
{
|
2006-02-23 14:18:42 +00:00
|
|
|
Config()
|
|
|
|
: proxyHost(""),
|
|
|
|
proxyPort(""),
|
|
|
|
proxyUser(""),
|
|
|
|
proxyPassword(""),
|
|
|
|
operationTimeout("")
|
2005-11-09 21:44:34 +00:00
|
|
|
{}
|
2006-02-23 14:18:42 +00:00
|
|
|
|
2005-11-09 21:44:34 +00:00
|
|
|
std::string proxyHost;
|
|
|
|
std::string proxyPort;
|
|
|
|
std::string proxyUser;
|
|
|
|
std::string proxyPassword;
|
2006-02-23 14:18:42 +00:00
|
|
|
std::string operationTimeout;
|
2005-11-09 21:44:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class ConfigParser
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static std::string stripWhiteSpace(const std::string& input);
|
|
|
|
static int parseConfig(const std::string& fileName,
|
|
|
|
Config& config);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* _CONFIGPARSER_H_ */
|