MCPcopy Create free account
hub / github.com/AbyssEngine/AbyssEngineOld / size

Method size

src/Abyss/FileSystem/InputStream.cpp:9–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7InputStream::InputStream(InputStream &&other) noexcept : std::istream(other._streamBuff.get()), _streamBuff(std::move(other._streamBuff)) {}
8
9std::streamsize InputStream::size() {
10 if (const auto *sizeable = dynamic_cast<SizeableStreambuf *>(_streamBuff.get()))
11 return sizeable->size();
12
13 const auto curPos = tellg();
14 seekg(0, end);
15 const auto endPos = tellg();
16 seekg(curPos, beg);
17 return endPos;
18}
19
20} // namespace Abyss::FileSystem

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected