MCPcopy Create free account
hub / github.com/Tencent/tgfx / markStartOfObject

Method markStartOfObject

src/pdf/PDFDocumentImpl.cpp:59–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59void PDFOffsetMap::markStartOfObject(int referenceNumber,
60 const std::shared_ptr<WriteStream>& stream) {
61 DEBUG_ASSERT(referenceNumber > 0);
62 auto index = static_cast<size_t>(referenceNumber - 1);
63 if (index >= offsets.size()) {
64 offsets.resize(index + 1);
65 }
66 offsets[index] = static_cast<int>(Difference(stream->bytesWritten(), baseOffset));
67}
68
69size_t PDFOffsetMap::objectCount() const {
70 return offsets.size() + 1; // Include the special zeroth object in the count.

Callers 1

begin_indirect_objectFunction · 0.80

Calls 3

DifferenceFunction · 0.85
sizeMethod · 0.45
bytesWrittenMethod · 0.45

Tested by

no test coverage detected