没有任何数据可供显示
开源项目社区 | 当前位置 : |
|
www.trustie.net/open_source_projects | 主页 > 开源项目社区 > treeconf |
treeconf
|
0 | 0 | 2 |
贡献者 | 讨论 | 代码提交 |
类Python语法C配置库配置信息必须是树型结构的, 这是本项目的出发点. 但显然, 使用XML, JSON或者Lua/Python脚本语言, 都是没有必要的. 本项目开发的配置文件, 通过TAB缩进来表示树型关系. 看起来有点像Python的意思. 源码很简单, 代码量不多, 希望对你有帮助.
Configurations should be in the form of tree, that's what I started from. In many cases, XML/JSON, even script languages like Lua/Python are not necessary. This project develop a C/C++ library that reads configuration files which grammar uses TAB to indicate parent-child relation. I may say, it is Pythonic. The source code is quit simple and small, hope it helps you, enjoy it.
配置文件示例/Configuration file example# this is a comment
author : ideawu
url: http://www.ideawu.net
proxy :
php =
host = 127.0.0.1
port = 8088
py :
host = 127.0.0.1
port = 8080
cgi =
pl = /usr/bin/perlC 语言使用示例/C program example that uses treeconfcfg = cfg_load_file("cfg_test.conf");
printf("proxy.php.host = %s\n", cfg_getstr(cfg, "proxy.php.host"));