Lines Matching defs:FileCache
18 FileCache::FileCache(const std::string& path) : path_(path), fp_(nullptr)
20 PROFILER_LOG_INFO(LOG_CORE, "FileCache: path(%s)!", path_.c_str());
23 FileCache::~FileCache()
29 bool FileCache::Open(const std::string& file)
36 CHECK_NOTNULL(fp_, false, "FileCache: open(%s) Failed, errno(%d)", targetFile.c_str(), errno);
40 long FileCache::Write(char* bytes, int32_t len)
42 CHECK_TRUE((len >= 0) && (bytes != nullptr), -1, "FileCache:%s param invalid!", __func__);
43 CHECK_NOTNULL(fp_, -1, "FileCache:%s fp_ invalid!", __func__);
50 CHECK_TRUE(len >= 0, -1, "FileCache: write failed, error(%d)!", errno);
57 long FileCache::Read(char* content)
59 CHECK_NOTNULL(content, -1, "FileCache:%s param invalid!", __func__);
60 CHECK_NOTNULL(fp_, -1, "FileCache:%s fp_ invalid!", __func__);
65 CHECK_TRUE(ret == 0, -1, "FileCache:%s fseek_end failed, error(%d)!", __func__, errno);
67 CHECK_TRUE(dataLen > 0, -1, "FileCache:%s ftell failed, error(%d)!", __func__, errno);
69 CHECK_TRUE(ret == 0, -1, "FileCache:%s fseek_set failed, error(%d)!", __func__, errno);
73 CHECK_TRUE(len >= 0, -1, "FileCache:%s read failed, error(%d)!", __func__, errno);
80 bool FileCache::Close()
82 CHECK_NOTNULL(fp_, false, "FileCache: %s fp is null", __func__);