Beispiel #1
0
const ManifestItem* Library::ManifestItemForCFI(const IRI &urlWithCFI, CFI* pRemainingCFI)
{
    CFI cfi = urlWithCFI.ContentFragmentIdentifier();
    if ( cfi.Empty() )
        return nullptr;
    
    const Package* pkg = PackageForEPubURL(urlWithCFI);
    if ( pkg == nullptr )
        return nullptr;
    
    return pkg->ManifestItemForCFI(cfi, pRemainingCFI);
}
Beispiel #2
0
Auto<ByteStream> Library::ReadStreamForEPubURL(const IRI &url, CFI *pRemainingCFI)
{
    CFI cfi = url.ContentFragmentIdentifier();
    if ( cfi.Empty() )
    {
        // it references a content document directly
        const Package* pkg = PackageForEPubURL(url);
        if ( pkg != nullptr )
            return pkg->ReadStreamForItemAtPath(url.Path());
    }
    else
    {
        const ManifestItem* item = ManifestItemForCFI(url, pRemainingCFI);
        if ( item != nullptr )
            return item->Reader();
    }
    
    return nullptr;
}
Beispiel #3
0
void IRI::SetContentFragmentIdentifier(const CFI &cfi)
{
    if ( cfi.Empty() )
        return;
    SetFragment(cfi.String());
}