JString fix to compress initial assignment JSON.

This commit is contained in:
barant committed 2024-12-17 09:56:55 -08:00
1 parent 83e9b8ca99
commit 95254310f0
6 files changed
+45 -9

No files matched your search

+22 -1
View File
@@ -142,5 +142,26 @@ namespace coreutils {
}
// std::cout << "not found cursor: " << unparsed() << std::endl;
return false;
}
}
JString & JString::operator=(coreutils:: ZString value) {
setSize(value.getLength());
memcpy(data, value.getData(), value.getLength());
removeWhitespace();
return *this;
}
void JString::removeWhitespace() {
reset();
while(!eod()) {
if(*cursor == ' ')
remove(1);
else if(startsWith("\""))
getContainer();
else
++cursor;
}
reset();
}
}