Esempio n. 1
0
void OpfListener::startElement(const gchar* name, const gchar** atts)
{
    if (!UT_go_utf8_collate_casefold(name, "manifest"))
    {
        m_inManifest = true;
    }

    if (!UT_go_utf8_collate_casefold(name, "spine"))
    {
        m_inSpine = true;
    }

    if (m_inManifest)
    {
        if (!UT_go_utf8_collate_casefold(name, "item"))
        {
            m_manifestItems.insert(
				   make_pair(std::string(UT_getAttribute("id", atts)),
					     std::string(UT_getAttribute("href", atts))));
            UT_DEBUGMSG(("Found manifest item: %s\n", UT_getAttribute("href", atts)));
        }
    }

    if (m_inSpine)
    {
        if (!UT_go_utf8_collate_casefold(name, "itemref"))
        {
            // We can ignore "linear" attribute as it said in specification
	    m_spine.push_back(std::string(UT_getAttribute("idref", atts)));
            UT_DEBUGMSG(("Found spine itemref: %s\n", UT_getAttribute("idref", atts)));
        }
    }

}
Esempio n. 2
0
void ContainerListener::startElement(const gchar* name, const gchar** atts)
{
    if (!UT_go_utf8_collate_casefold(name, "rootfile"))
    {
        m_rootFilePath = std::string(UT_getAttribute("full-path", atts));
        UT_DEBUGMSG(("Found rootfile%s\n", m_rootFilePath.c_str()));
    }
}
Esempio n. 3
0
std::string IE_Exp_EPUB::getMimeType(const std::string &uri)
{
    const gchar *extension = strchr(uri.c_str(), '.');

    if (extension == NULL)
    {
        return UT_go_get_mime_type(uri.c_str());
    }
    else
    {
        if (!UT_go_utf8_collate_casefold(extension + 1, "xhtml"))
        {
            return "application/xhtml+xml";
        }
        else
        {
            return UT_go_get_mime_type(uri.c_str());
        }
    }
}