MCPcopy Create free account
hub / github.com/audeering/opensmile / loadFileIntoCache

Method loadFileIntoCache

src/core/configManager.cpp:1718–1735  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1716}
1717
1718char * cFileConfigReader::loadFileIntoCache(const char *filename,
1719 /*FILE *f,*/ int *bufSize) {
1720 std::string s(filename);
1721 if (cacheMap_.find(s) == cacheMap_.end()) {
1722 // not in cache, need to create and load
1723 cConfigFileBuffer b(1024);
1724 // load file
1725 if (!b.loadFile(filename))
1726 return NULL;
1727 cacheMap_[s] = b;
1728 if (bufSize != NULL)
1729 *bufSize = cacheMap_[s].getSize();
1730 return cacheMap_[s].getPointer();
1731 }
1732 // file was already in cache, use getConfigFileBufferFromCache
1733 // to retrieve a pointer to the buffer
1734 return NULL;
1735}
1736
1737char* cFileConfigReader::addAudExtensionIfNeeded(const char * fname) {
1738 bool addAudExt = false;

Callers

nothing calls this directly

Calls 5

findMethod · 0.80
getPointerMethod · 0.80
endMethod · 0.45
loadFileMethod · 0.45
getSizeMethod · 0.45

Tested by

no test coverage detected