git-svn-id: svn://db.shs.com.ru/pip@6 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2015-02-28 18:37:44 +00:00
parent 02fdf8b415
commit 0891d1ba2d
319 changed files with 10557 additions and 0 deletions

27
doc/examples/piconfig.cpp Normal file
View File

@@ -0,0 +1,27 @@
#include "pip.h"
void _() {
//! [PIConfig::Entry]
/* "example.conf"
a = 1
s0.a = A
s0.b = B
*/
PIConfig conf("example.conf", PIIODevice::ReadOnly);
PIConfig::Entry ce = conf.getValue("a");
int a = ce; // a = 1
PIString A = ce; // A = "1"
ce = conf.getValue("s0");
piCout << ce.childCount(); // 2
A = ce.getValue("b"); // A = "B"
A = conf.getValue("s0.a"); // A = "A"
//! [PIConfig::Entry]
//! [fullName]
PIConfig conf("example.conf", PIIODevice::ReadOnly);
piCout << conf.getValue("a.b.c").name(); // "c"
piCout << conf.getValue("a.b.c").fullName(); // "a.b.c"
//! [fullName]
};