MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / get

Method get

src/ifcparse/FileReader.cpp:99–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97 size_t size() const override { return file_size_; }
98
99 char get(size_t pos) const override {
100 if (pos >= file_size_) throw std::out_of_range("get out of range");
101 const size_t pidx = pos / page_size_;
102 const FileReader::Page& p = fetchPage_(pidx);
103 const size_t off = pos % page_size_;
104 if (off >= p.data.size()) throw std::out_of_range("offset beyond valid page bytes");
105 return p.data[off];
106 }
107
108private:
109 const FileReader::Page& fetchPage_(size_t idx) const {

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected