MCPcopy Create free account
hub / github.com/SmingHub/Sming / moveString

Method moveString

Sming/Core/Data/Stream/MemoryDataStream.cpp:100–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98}
99
100bool MemoryDataStream::moveString(String& s)
101{
102 // Ensure size < capacity
103 bool sizeOk = ensureCapacity(size + 1);
104
105 // If we couldn't reallocate for the NUL terminator, drop the last character
106 bool res = s.setBuffer({buffer, capacity, sizeOk ? size : size - 1});
107 (void)res;
108 assert(res);
109
110 buffer = nullptr;
111 readPos = 0;
112 size = 0;
113 capacity = 0;
114 return sizeOk;
115}

Callers 8

executeMethod · 0.45
executeMethod · 0.45
checkMethod · 0.45
streamTestsMethod · 0.45
getBodyMethod · 0.45
getBodyMethod · 0.45
processTelnetInputFunction · 0.45
processNowMethod · 0.45

Calls 1

setBufferMethod · 0.45

Tested by

no test coverage detected