MCPcopy Index your code
hub / github.com/electric-sql/pglite / addCString

Method addCString

packages/pg-protocol/src/buffer-writer.ts:44–56  ·  view source on GitHub ↗
(string: string)

Source from the content-addressed store, hash-verified

42 }
43
44 public addCString(string: string): Writer {
45 if (string) {
46 // TODO(msfstef): might be faster to extract `addString` code and
47 // ensure length + 1 once rather than length and then +1?
48 this.addString(string)
49 }
50
51 // set null terminator
52 this.#ensure(1)
53 this.#bufferView.setUint8(this.#offset, 0)
54 this.#offset++
55 return this
56 }
57
58 public addString(string: string = ''): Writer {
59 const length = byteLengthUtf8(string)

Callers 8

cstringMessageFunction · 0.95
startupFunction · 0.45
passwordFunction · 0.45
queryFunction · 0.45
parseFunction · 0.45
bindFunction · 0.45
serializer.tsFile · 0.45

Calls 2

addStringMethod · 0.95
#ensureMethod · 0.95

Tested by

no test coverage detected