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

Method pushFront

Sming/Core/Data/CStringArray.cpp:84–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84bool CStringArray::pushFront(const char* str)
85{
86 if(str == nullptr) {
87 // Nothing to insert
88 return true;
89 }
90
91 auto str_len = strlen(str) + 1;
92 auto len = length();
93 if(!setLength(len + str_len)) {
94 return false;
95 }
96 char* ptr = String::begin();
97 memmove(ptr + str_len, ptr, str_len);
98 memcpy(ptr, str, str_len);
99 if(stringCount != 0) {
100 ++stringCount;
101 }
102 return true;
103}
104
105String CStringArray::popFront()
106{

Callers 1

executeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected