4.06.2013 - Version 0.3.4 - PIOBJECT() macro, ethernet improvement, documentation based on Doxygen

This commit is contained in:
peri4
2013-06-04 21:28:15 +04:00
parent 02c629d6a8
commit 9111640ca8
53 changed files with 3019 additions and 910 deletions

View File

@@ -277,7 +277,7 @@ void PIConfig::addEntry(const PIString & name, const PIString & value, const PIS
void PIConfig::setValue(const PIString & name, const PIString & value, const PIString & type, bool write) {
Entry & e(getValue(name));
if (&e == &empty) {
addEntry(name, value, type);
addEntry(name, value, type, write);
return;
}
e._value = value;
@@ -376,10 +376,14 @@ void PIConfig::removeEntry(Branch & b, PIConfig::Entry * e) {
void PIConfig::writeAll() {
//cout << this << " write < " << size() << endl;
clear();
//*this << "1234567894132456798\n"; return;
//writeEntry(&root);
buildFullNames(&root);
Branch b = allLeaves();
//for (int i = 0; i < b.size_s(); ++i)
// cout << b[i]->_name << " = " << b[i]->_value << endl;
int j = 0;
for (int i = 0; i < other.size_s(); ++i) {
//cout << j << endl;
@@ -387,25 +391,27 @@ void PIConfig::writeAll() {
if (b[j]->_line == i) {
b[j]->buildLine();
*this << b[j]->_all << '\n';
//cout << this << " " << b[j]->_all << endl;
++j;
} else {
*this << other[i];
if (i < other.size_s() - 1) *this << '\n';
//cout << this << " " << other[i] << endl;
}
} else {
*this << other[i];
if (i < other.size_s() - 1) *this << '\n';
//cout << this << " " << other[i] << endl;
}
//cout << other[i] << endl;
}
flush();
readAll();
//cout << this << " write > " << size() << endl;
}
void PIConfig::readAll() {
root.clear();
flush();
parse();
}