Ejemplo n.º 1
0
ItemProperties::ItemProperties(const IRI& iri) : _p(None)
{
    string attr(iri.Fragment());
    if ( attr.empty() )
        attr = iri.LastPathComponent();
    
    this->operator=(attr);
}
Ejemplo n.º 2
0
EPUB3_EXPORT
DCType DCTypeFromIRI(const IRI& iri)
{
    if ( iri.IsEmpty() )
        return DCType::Invalid;
    auto found = NameToIDMap.find(iri.Fragment());
    if ( found == NameToIDMap.end() )
        return DCType::Custom;
    return found->second;
}
Ejemplo n.º 3
0
void Package::FireLoadEvent(const IRI &url) const
{
    if ( _loadEventHandler == nullptr )
        throw std::runtime_error(_Str("No load event handler installed to load '", url.URIString(), "'"));
    
    if ( url.Path().find(_pathBase) == 0 )
    {
        _loadEventHandler(url);
        return;
    }
    
    IRI fixed(IRI::gEPUBScheme, UniqueID(), _pathBase, url.Query(), url.Fragment());
    fixed.AddPathComponent(url.Path());
    IRI::IRICredentials creds(url.Credentials());
    fixed.SetCredentials(creds.first, creds.second);
    
    _loadEventHandler(fixed);
}