MCPcopy Create free account
hub / github.com/Tencent/MMKV / getActualFileSize

Method getActualFileSize

Core/MemoryFile.cpp:118–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118size_t File::getActualFileSize() const {
119# ifdef MMKV_ANDROID
120 if (m_fileType == MMFILE_TYPE_ASHMEM) {
121 return ASharedMemory_getSize(m_fd);
122 }
123# endif
124 size_t size = 0;
125 if (isFileValid()) {
126 mmkv::getFileSize(m_fd, size);
127 } else {
128 mmkv::getFileSize(m_path.c_str(), size);
129 }
130 return size;
131}
132
133bool MemoryFile::openIfNeeded() {
134 if (!m_diskFile.isFileValid()) {

Callers 3

loadFromFileMethod · 0.45
copyFileContentFunction · 0.45
copyFileContentFunction · 0.45

Calls 4

ASharedMemory_getSizeFunction · 0.85
getFileSizeFunction · 0.70
isFileValidFunction · 0.50
isFileValidMethod · 0.45

Tested by

no test coverage detected