Exemplo n.º 1
0
/* Make
 */
static
rc_t SRAMgrInitPath ( SRAMgr *mgr, const KDirectory *wd )
{
#if OLD_SRAPATH_MGR
    /* try to make the path manager */
    rc_t rc = SRAPathMake ( & mgr -> _pmgr, wd );

    if ( GetRCState ( rc ) == rcNotFound && GetRCTarget ( rc ) == rcDylib )
    {
        /* we are operating outside of the archive */
        assert ( mgr -> _pmgr == NULL );
        rc = 0;
    }

    return rc;
#else
    KConfig *kfg;
    rc_t rc = KConfigMake ( & kfg, NULL );
    if ( rc == 0 )
    {
        VFSManager *vfs;
        rc = VFSManagerMake ( & vfs );
        if ( rc == 0 )
        {
            rc = VFSManagerMakeResolver ( vfs, ( VResolver** ) & mgr -> _pmgr, kfg );
            VFSManagerRelease ( vfs );
        }
        KConfigRelease ( kfg );
    }
    if ( rc != 0 )
        mgr -> _pmgr = NULL;

    return 0;
#endif
}
Exemplo n.º 2
0
CVResolver::CVResolver(const CVFSManager& mgr, const CKConfig& cfg)
    : m_Mgr(mgr)
{
    if ( rc_t rc = VFSManagerMakeResolver(mgr, x_InitPtr(), cfg) ) {
        *x_InitPtr() = 0;
        NCBI_THROW2(CSraException, eInitFailed,
                    "Cannot create VResolver", rc);
    }
}