more precise using PIIODevice::reading_now flag, Warning! one should use it manually now
small enum fix for pip_cmg
This commit is contained in:
@@ -298,16 +298,24 @@ void writeClassStreamMembersIn(PIIOTextStream & ts, const PICodeParser::Entity *
|
||||
if (m.meta.contains("id"))
|
||||
cnt = m.meta.value("id").toInt();
|
||||
if (m.dims.isEmpty()) {
|
||||
bool is_enum = parser.isEnum(m.type);
|
||||
if (simple) {
|
||||
ts << "\ts >> ";
|
||||
if (parser.isEnum(m.type))
|
||||
ts << "(int&)";
|
||||
ts << "v." << m.name << ";\n";
|
||||
ts << "\t";
|
||||
if (is_enum) ts << "{int i; ";
|
||||
ts << "s >> ";
|
||||
if (is_enum) ts << "i;";
|
||||
else ts << "v." << m.name << ";";
|
||||
if (is_enum) ts << " v." << m.name << " = (" << m.type << ")i;}";
|
||||
ts << "\n";
|
||||
} else {
|
||||
ts << "\t\tcase " << cnt << ": cs.get(";
|
||||
if (parser.isEnum(m.type))
|
||||
ts << "(int&)";
|
||||
ts << "v." << m.name << "); break;\n";
|
||||
ts << "\t\tcase " << cnt << ":";
|
||||
if (is_enum) ts << " {int i;";
|
||||
ts << " cs.get(";
|
||||
if (is_enum) ts << "i";
|
||||
else ts << "v." << m.name;
|
||||
ts << ");";
|
||||
if (is_enum) ts << " v." << m.name << " = (" << m.type << ")i;}";
|
||||
ts << " break;\n";
|
||||
}
|
||||
} else {
|
||||
PIString ptype = m.type.left(m.type.find('[')).trim();
|
||||
|
||||
Reference in New Issue
Block a user