void ZendParser::prepareTypes(File &file, vector<pair<string, string>> &out, vector<string> &tmp) { // cout << "file: " <<file.name << " ---------- \n"; extractTypes(file.content, out, tmp); PreparedType prepType; for (pair<string, string> pair : out) { prepType.type = pair.first; prepType.raw = pair.second; prepType.replace = pair.second; // cout << "first:" << pair.first << ",second:" << pair.second << "\n"; file.prepTypes.push_back(prepType); } vector<PreparedType> outPrep; filterPreparedTypes(file.prepTypes, outPrep); file.prepTypes = outPrep; generatePreparedTypes(file, tmp); }
void TypeObjectGenerator::extract(const QString &data) { QDir().mkpath(m_dst); QMap<QString, QList<GeneratorTypes::TypeStruct> > types = extractTypes(data, "object", QString(), "types"); QMapIterator<QString, QList<GeneratorTypes::TypeStruct> > i(types); while(i.hasNext()) { i.next(); const QString &name = i.key(); const QList<GeneratorTypes::TypeStruct> &types = i.value(); writeType(name, types); } writePri(types.keys()); writeMainHeader(types.keys()); writeQmlRegister(types.keys()); copyEmbeds(); }