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

Function WriteByteString

src/pdf/PDFUnion.cpp:86–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84}
85
86void WriteByteString(const std::shared_ptr<WriteStream>& stream, const char* data, size_t length) {
87 size_t literalExtras = 0;
88 for (size_t i = 0; i < length; i++) {
89 auto c = static_cast<uint8_t>(data[i]);
90 if (c < ' ' || '~' < c) {
91 literalExtras += 3;
92 } else if (c == '\\' || c == '(' || c == ')') {
93 ++literalExtras;
94 }
95 }
96 WriteOptimizedByteString(stream, data, length, literalExtras);
97}
98
99void WriteTextString(const std::shared_ptr<WriteStream>& stream, const char* data, size_t length) {
100 bool inputIsValidUTF8 = true;

Callers 1

emitObjectMethod · 0.85

Calls 1

WriteOptimizedByteStringFunction · 0.70

Tested by

no test coverage detected