mirror of
https://github.com/yanyiwu/cppjieba.git
synced 2025-07-18 00:00:12 +08:00
43 lines
695 B
C++
43 lines
695 B
C++
/************************************
|
|
* file enc : utf8
|
|
* author : wuyanyi09@gmail.com
|
|
************************************/
|
|
#ifndef CPPCOMMON_CONFIG_H
|
|
#define CPPCOMMON_CONFIG_H
|
|
|
|
|
|
#include <map>
|
|
#include <fstream>
|
|
#include <iostream>
|
|
#include "logger.h"
|
|
|
|
namespace CPPCOMMON
|
|
{
|
|
using std::map;
|
|
using std::string;
|
|
using std::cout;
|
|
using std::endl;
|
|
using std::ifstream;
|
|
class Config
|
|
{
|
|
public:
|
|
Config();
|
|
~Config();
|
|
bool init(const string& configFile);
|
|
void display();
|
|
string getByKey(const string& key);
|
|
private:
|
|
string _stripComment(const string& line);
|
|
map<string, string> _map;
|
|
bool _isInit;
|
|
|
|
};
|
|
}
|
|
|
|
namespace CPPCOMMON
|
|
{
|
|
extern Config gConfig;
|
|
}
|
|
|
|
#endif
|