*/
//---------------------------------------------------------------------------
-#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
+#include <cerrno>
+#include <cstring>
+#include <cstdlib>
+
#include <fstream>
#include <algorithm>
+
#include "conffiles.h"
#include "common.h"
return e;
}
//---------------------------------------------------------------------------
-int CONFIGFILE::FindParameter(const string ¶meter, string * value) const
-{
-it = param_val.find(parameter);
-if (it == param_val.end())
- return -1;
-
-*value = param_val[parameter];
-return 0;
-}
-//---------------------------------------------------------------------------
int CONFIGFILE::Flush()
{
fstream f(fileName.c_str(), ios::out);
return 0;
}
//---------------------------------------------------------------------------
-
-
#ifndef ConfFilesH
#define ConfFilesH
-#include <sys/types.h>
-#include <stdio.h>
+
#include <map>
#include <string>
using namespace std;
//---------------------------------------------------------------------------
-//#define CONF_STR_LEN 300
-//typedef char STRING[CONF_STR_LEN];
typedef bool (*StringCaseCmp_t)(const string & str1, const string & str2);
int ReadString(const string & param, char * val, int * maxLen, const char * defaultVal) const;
int ReadString(const string & param, string * val, const string & defaultVal) const;
- int FindParameter(const string ¶meter, string * value) const;
-
int ReadTime (const string & param, time_t *, time_t) const;
int ReadShortInt (const string & param, short int *, short int) const;