Ejemplo n.º 1
0
bool JucerDocument::isValidJucerCppFile (const File& f)
{
    if (f.hasFileExtension (".cpp"))
        if (ScopedPointer<XmlElement> xml = pullMetaDataFromCppFile (f.loadFileAsString()))
            return xml->hasTagName (jucerCompXmlTag);

    return false;
}
Ejemplo n.º 2
0
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;
}
Ejemplo n.º 3
0
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);
}
Ejemplo n.º 4
0
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;
}