MCPcopy Create free account
hub / github.com/comaps/comaps / Size

Method Size

libs/coding/internal/file_data.cpp:92–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90static int64_t constexpr INVALID_POS = -1;
91
92uint64_t FileData::Size() const
93{
94 int64_t const pos = ftell64(m_File);
95 if (pos == INVALID_POS)
96 MYTHROW(Reader::SizeException, (GetErrorProlog(), pos));
97
98 if (fseek64(m_File, 0, SEEK_END))
99 MYTHROW(Reader::SizeException, (GetErrorProlog()));
100
101 int64_t const size = ftell64(m_File);
102 if (size == INVALID_POS)
103 MYTHROW(Reader::SizeException, (GetErrorProlog(), size));
104
105 if (fseek64(m_File, static_cast<off_t>(pos), SEEK_SET))
106 MYTHROW(Reader::SizeException, (GetErrorProlog(), pos));
107
108 ASSERT_GREATER_OR_EQUAL(size, 0, ());
109 return static_cast<uint64_t>(size);
110}
111
112void FileData::Read(uint64_t pos, void * p, size_t size)
113{

Callers 13

UNIT_TESTFunction · 0.45
UNIT_TESTFunction · 0.45
UNIT_TESTFunction · 0.45
TestSDCFunction · 0.45
UNIT_TESTFunction · 0.45
UNIT_TESTFunction · 0.45
CheckFileOKFunction · 0.45
CreateAndTestZipFunction · 0.45
TestFileSorterFunction · 0.45
GetFileSizeFunction · 0.45
IsEqualFilesFunction · 0.45

Calls

no outgoing calls

Tested by 10

UNIT_TESTFunction · 0.36
UNIT_TESTFunction · 0.36
UNIT_TESTFunction · 0.36
TestSDCFunction · 0.36
UNIT_TESTFunction · 0.36
UNIT_TESTFunction · 0.36
CheckFileOKFunction · 0.36
CreateAndTestZipFunction · 0.36
TestFileSorterFunction · 0.36