MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / String

Method String

src/simulate/bin_serializer.cpp:131–145  ·  view source on GitHub ↗

types

Source from the content-addressed store, hash-verified

129 }
130 // types
131 virtual void String ( char * & data ) override {
132 DEBUG_BIN_DATA("string\n");
133 if ( reading ) {
134 uint32_t length = 0;
135 load ( length );
136 char * temp = new char[length+1];
137 read ( temp, length );
138 data = (char *) context->allocateString(temp,length, debugInfo);
139 delete [] temp;
140 } else {
141 uint32_t length = stringLengthSafe(*context, data);
142 save ( length );
143 write ( data, length );
144 }
145 }
146 virtual void Bool ( bool & data ) override {
147 serialize(data);
148 }

Callers

nothing calls this directly

Calls 4

stringLengthSafeFunction · 0.85
allocateStringMethod · 0.80
readFunction · 0.50
writeFunction · 0.50

Tested by

no test coverage detected