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

This commit is contained in:
2018-05-12 09:57:00 +00:00
parent e62e5a0c95
commit 56e250c150
15 changed files with 512 additions and 374 deletions

View File

@@ -78,10 +78,10 @@ PIVector<int> enumValues(const PIString & e, const PIMap<PIString, CDSection> &
CDSection CDParser::parse(PIIODevice * d, int cdsection_type) {
CDType::cdT et = (CDType::cdT)cdsection_type;
if (!d) return CDSection();
if (!d->canRead()) return CDSection();
if (!d) return CDSection(et);
if (!d->canRead()) return CDSection(et);
//piCout << "[CDSection] parse start";
CDSection cs;
CDSection cs(et);
CDType ck;
PIMap<PIString, CDSection> sections;
PIMap<PIString, int> enum_values;
@@ -112,7 +112,7 @@ CDSection CDParser::parse(PIIODevice * d, int cdsection_type) {
cind += 4;
continue;
}
cs = CDSection();
cs = CDSection(et);
cs.name = line;
//piCout << "enum" << cs.name;
int cev = 0;
@@ -129,11 +129,11 @@ CDSection CDParser::parse(PIIODevice * d, int cdsection_type) {
// piCout << "#" << enum_values;
if (!enum_values.contains(alias)) {
piCout << "Parse error: can`t find section alias \"" << alias << "\"!";
return CDSection();
return CDSection(et);
}
if (!sections.contains(iarr.front())) {
piCout << "Parse error: can`t find section \"" << iarr.front() << "\"!";
return CDSection();
return CDSection(et);
}
//piCout << "insert" << alias << iarr;
int aval = enum_values.value(alias);
@@ -150,7 +150,7 @@ CDSection CDParser::parse(PIIODevice * d, int cdsection_type) {
ts.name = is.name;
ts.name.insert(ibpos, PIString("[") << a << "]");
is = ts;
ts = CDSection();
ts = CDSection(et);
}
is.alias = alias;
cs.section(aval) = is;
@@ -187,7 +187,7 @@ CDSection CDParser::parse(PIIODevice * d, int cdsection_type) {
case CDType::cdK : return sections.value("KDescription");
case CDType::cdX : return sections.value("XDescription");
case CDType::cdC : return sections.value("CDescription");
default: return CDSection();
default: return CDSection(et);
}
return CDSection();
return CDSection(et);
}