config.h
#ifndef CONFIG_H_
#define CONFIG_H_
#include
#include
测试 test_config.cpp
#include "config.h"
int main(int argc, char* argv[])
{
Config config(argv[1]);
config.print();
cout << config.getConfig("port") << endl;
cout << config.getInteger("port") << endl;
return 0;
}
运行:
clang++ -std=c++11 -stdlib=libc++ test_config.cpp
./a.out example.config
Comments