MCPcopy Create free account
hub / github.com/alibaba/CicadaPlayer / checkConfig

Method checkConfig

framework/cacheModule/cache/CacheChecker.cpp:35–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35CacheRet CacheChecker::checkConfig()
36{
37 if (!mCacheConfig.mEnable) {
38 AF_LOGE("cache config not enable");
39 return CACHE_ERROR_NOT_ENABLE;
40 }
41
42 string &cacheDir = mCacheConfig.mCacheDir;
43
44 if (cacheDir.empty()) {
45 //not set cache dir
46 AF_LOGE("cache config not set cache dir");
47 return CACHE_ERROR_CACHE_DIR_EMPTY;
48 }
49
50 if (!FileUtils::isDirExist(cacheDir.c_str())) {
51 //create cache dir if not exits.
52 if (FileUtils::mkdirs(cacheDir.c_str())) {
53 return CACHE_SUCCESS;
54 } else {
55 return CACHE_ERROR_CACHE_DIR_ERROR;
56 }
57 } else {
58 return CACHE_SUCCESS;
59 }
60}
61
62void CacheChecker::setMediaInfo(int64_t fileSize, int64_t duration)
63{

Callers 1

checkCanBeCachedMethod · 0.80

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected