XosConfig

DcsConfig gDcssConfig
\\
XosConfig  config;
XosConfig  defConfig;
\\


#ifndef __Include_XosConfig_h__
#define __Include_XosConfig_h__
#include "xos.h"
#include <string>
#include <map>
#include <list>

typedef std::list<std::string> StrList;
typedef std::multimap<std::string, std::string> StrMMap;

class XosConfig
{
public:
 XosConfig();
 XosConfig(const std::string& f);
 virtual ~XosConfig();
 virtual bool load();
 bool save(const std::string& file);
 bool get(const std::string& key, std::string& ret) const;
 bool getRange(const std::string& key, StrList& ret) const;
 void set(const std::string& key, const std::string& value);
 std::string getConfigFile() const
 {
  return file;
 }
 void setConfigFile(const std::string& f)
 {
  file = f;
 }
protected:
 std::string file;
 StrMMap data; 
};


#endif // __Include_XosConfig_h__

原文地址:https://www.cnblogs.com/greencolor/p/2218959.html