umd/core/src/compiler/WisdomContainer.cpp
bool WisdomContainer::getEntry(const std::string &path,
                               const std::string &name,
                               IWisdomContainerEntry::EntryType type,
                               WisdomContainerEntry *entry)
{
    if ( !isOpen() )
    {
        return false;
    }

    const string fname(entryFilename(path, name));
    // gLogDebug << "getEntry for root=[" << m_root << "] path=[" << path <<
    //        "] name=[" << name << "] type=" << int(type) << " fname=[" << fname << "]" << endl;


    bool ok;
    NvDlaFileHandle file;
    NvDlaError rc = NvDlaFopen((m_root + fname).c_str(), NVDLA_OPEN_READ, &file);
    ok = rc == NvDlaSuccess;
    if (!ok)
    {
        // gLogError << "couldn't open (read) entry file " << fname << endl;
    }
    else
    {
        NvDlaFclose(file);
        if ( type == IWisdomContainerEntry::ENTRY_TYPE_OBJECT ) {
            // gLogError << "open ok, instance new (dir) entry... " << fname << endl;
            std::string dirname = path;
            if ( name.size() && (name != string(".")) ) {
                dirname += "/" + name;
            }
            *entry = WisdomContainerEntry(this, dirname, string(""), type);
        } else {
            // gLogError << "open ok, instance new entry... " << fname << endl;
            *entry = WisdomContainerEntry(this, path, name, type);
        }
    }

    return ok;
}
//
// this version of getEntry is internal-only and makes use of an on-the-stack entry
//
this version of getEntry is internal-only and makes use of an on-the-stack entry
this version of getEntry is internal - only and makes use of an on - the - stack entry
bool WisdomContainer::getEntry(const std::string &path,
                               const std::string &name,
                               IWisdomContainerEntry::EntryType type,
                               WisdomContainerEntry *entry)
{
    if ( !isOpen() )
    {
        return false;
    }
    const string fname(entryFilename(path, name));
    bool ok;
    NvDlaFileHandle file;
    NvDlaError rc = NvDlaFopen((m_root + fname).c_str(), NVDLA_OPEN_READ, &file);
    ok = rc == NvDlaSuccess;
    if (!ok)
    {
    }
    else
    {
        NvDlaFclose(file);
        if ( type == IWisdomContainerEntry::ENTRY_TYPE_OBJECT ) {
            std::string dirname = path;
            if ( name.size() && (name != string(".")) ) {
                dirname += "/" + name;
            }
            *entry = WisdomContainerEntry(this, dirname, string(""), type);
        } else {
            *entry = WisdomContainerEntry(this, path, name, type);
        }
    }
    return ok;
}
bool WisdomContainer :: getEntry ( const std :: string & path , const std :: string & name , IWisdomContainerEntry :: EntryType type , WisdomContainerEntry * entry ) { if ( ! isOpen ( ) ) { return false ; } const string fname ( entryFilename ( path , name ) ) ; bool ok ; NvDlaFileHandle file ; NvDlaError rc = NvDlaFopen ( ( m_root + fname ) . c_str ( ) , NVDLA_OPEN_READ , & file ) ; ok = rc == NvDlaSuccess ; if ( ! ok ) { } else { NvDlaFclose ( file ) ; if ( type == IWisdomContainerEntry :: ENTRY_TYPE_OBJECT ) { std :: string dirname = path ; if ( name . size ( ) && ( name != string ( " " ) ) ) { dirname += " " + name ; } * entry = WisdomContainerEntry ( this , dirname , string ( " " ) , type ) ; } else { * entry = WisdomContainerEntry ( this , path , name , type ) ; } } return ok ; }
this version of getEntry is internal-only and makes use of an on-the-stack entry
this version of getEntry is internal - only and makes use of an on - the - stack entry
// gLogDebug << "getEntry for root=[" << m_root << "] path=[" << path << //        "] name=[" << name << "] type=" << int(type) << " fname=[" << fname << "]" << endl; // gLogError << "couldn't open (read) entry file " << fname << endl; // gLogError << "open ok, instance new (dir) entry... " << fname << endl; // gLogError << "open ok, instance new entry... " << fname << endl;