bool JucerDocument::isValidJucerCppFile (const File& f) { if (f.hasFileExtension (".cpp")) if (ScopedPointer<XmlElement> xml = pullMetaDataFromCppFile (f.loadFileAsString())) return xml->hasTagName (jucerCompXmlTag); return false; }
bool JucerDocument::isValidJucerCppFile (const File& f) { if (f.hasFileExtension (cppFileExtensions)) { std::unique_ptr<XmlElement> xml (pullMetaDataFromCppFile (f.loadFileAsString())); if (xml != nullptr) return xml->hasTagName (jucerCompXmlTag); } return false; }
bool JucerDocument::reloadFromDocument() { const String cppContent (cpp->getCodeDocument().getAllContent()); ScopedPointer<XmlElement> newXML (pullMetaDataFromCppFile (cppContent)); if (newXML == nullptr || ! newXML->hasTagName (jucerCompXmlTag)) return false; if (currentXML != nullptr && currentXML->isEquivalentTo (newXML, true)) return true; currentXML = newXML; stopTimer(); resources.loadFromCpp (getCppFile(), cppContent); return loadFromXml (*currentXML); }
bool JucerDocument::reloadFromDocument() { const String cppContent (cpp->getCodeDocument().getAllContent()); std::unique_ptr<XmlElement> newXML (pullMetaDataFromCppFile (cppContent)); if (newXML == nullptr || ! newXML->hasTagName (jucerCompXmlTag)) return false; if (currentXML != nullptr && currentXML->isEquivalentTo (newXML.get(), true)) return true; currentXML.reset (newXML.release()); stopTimer(); resources.loadFromCpp (getCppFile(), cppContent); bool result = loadFromXml (*currentXML); extractCustomPaintSnippetsFromCppFile (cppContent); return result; }