MCPcopy Create free account
hub / github.com/boostorg/json / to_string

Method to_string

src/boost_json_gdb_printers.py:169–183  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

167 return 'string'
168
169 def to_string(self):
170 kind = self.impl['s_']['k']
171 if kind == self.impl['short_string_']:
172 sbo_size = self.impl['sbo_chars_']
173 size = sbo_size - self.impl['s_']['buf'][sbo_size]
174 pointer = self.impl['s_']['buf']
175 elif kind == self.impl['key_string_']:
176 size = self.impl['k_']['n']
177 pointer = self.impl['k_']['s']
178 else:
179 size = self.impl['p_']['t'].dereference()['size']
180 pointer = self.impl['p_']['t']
181 pointer += 1
182 pointer = pointer.cast(self._char_const_ptr)
183 return pointer.lazy_string(length=size)
184
185
186@pretty_printer

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected