JString fix to compress initial assignment JSON.
This commit is contained in:
1 parent
83e9b8ca99
commit
95254310f0
6 files changed
+45
-9
No files matched your search
+22
-1
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user