MCPcopy Create free account
hub / github.com/aardappel/treesheets / ToString

Method ToString

lobster/src/vmdata.cpp:47–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45void LString::DeleteSelf(VM &vm) { vm.pool.dealloc(this, sizeof(LString) + len + 1); }
46
47void LString::ToString(ostringstream &ss, PrintPrefs &pp) {
48 if (CycleCheck(ss, pp)) return;
49 auto sv = strv();
50 auto dd = string_view();
51 if (len > pp.budget) {
52 sv = sv.substr(0, pp.budget);
53 dd = "..";
54 }
55 if (pp.quoted) {
56 EscapeAndQuote(sv, ss);
57 } else {
58 ss << sv;
59 }
60 ss << dd;
61}
62
63LVector::LVector(VM &vm, intp _initial, intp _max, type_elem_t _tti)
64 : RefObj(_tti), len(_initial), maxl(_max) {

Callers 6

DumpVarMethod · 0.45
EndEvalMethod · 0.45
ValToGUIFunction · 0.45
RefToStringFunction · 0.45
VectorOrObjectToStringFunction · 0.45
GenFieldOffsetFunction · 0.45

Calls 5

EscapeAndQuoteFunction · 0.85
VectorOrObjectToStringFunction · 0.85
EnumNameMethod · 0.80
ReverseLookupTypeMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected