git-svn-id: svn://db.shs.com.ru/libs@116 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2016-08-15 13:59:53 +00:00
parent 59d9f04b2f
commit 91f4f74df4
10 changed files with 132 additions and 68 deletions

View File

@@ -33,9 +33,9 @@ const CDType KInterface::operator [](int v) const {
CDSection & KInterface::section(int v) {
CDSection & ret = core->k_.section(v);
piCout << "[get section]" << v << ret.name;
return ret;
// CDSection & ret = core->k_.section(v);
// piCout << "[get section]" << v << ret.name;
return core->k_.section(v);
}
const CDSection KInterface::section(int v) const {
@@ -43,43 +43,17 @@ const CDSection KInterface::section(int v) const {
}
//CDSection & KInterface::section(const PIDeque<int> &path) {
// piCout << "error"; return root();
// PIDeque<int> spath = path;
// CDSection & rs = core->k_;
// CDSection trs = rs;
// piCout << "[get section from path]" << path << rs.name;
// PIString tab;
// while (!spath.isEmpty()) {
// piCout << "!1" << tab << rs.alias << rs.name;
// rs = rs.section(spath.take_front());
// tab += " ";
//// rs = trs;
// }
// piCout << "!2" << tab << rs.alias << rs.name;
// return rs;
//}
const CDSection KInterface::section(const PIDeque<int> &path) const {
CDSection & KInterface::section(const PIDeque<int> &path) {
PIDeque<int> spath = path;
CDSection rs = core->k_;
CDSection trs = rs;
//piCout << "[get section from path]" << path << rs.name;
PIString tab;
CDSection * rs = &core->k_;
while (!spath.isEmpty()) {
//piCout << "!1" << tab << rs.alias << rs.name;
trs = rs.section(spath.take_front());
tab += " ";
rs = trs;
rs = &rs->section(spath.take_front());
}
//piCout << "!2" << tab << rs.alias << rs.name;
return rs;
return *rs;
}
CDSection & KInterface::root() {
piCout << "[root]" << core->k_.name;
return core->k_;
}