Make the "lldb/Utility/JSON.h" able to parse JSON into tokens with the new JSONParser class.

Change over existing code to use this new parser so StructuredData can use the tokenizer to parse JSON instead of doing it manually.

This allowed us to easily parse JSON into JSON* objects as well as into StructuredData.

llvm-svn: 241522
This commit is contained in:
Greg Clayton
2015-07-06 23:40:40 +00:00
parent 8ee6a30b8d
commit 98424c4460
7 changed files with 722 additions and 338 deletions

View File

@@ -476,3 +476,12 @@ StringExtractor::GetNameColonValue (std::string &name, std::string &value)
m_index = UINT64_MAX;
return false;
}
void
StringExtractor::SkipSpaces ()
{
const size_t n = m_packet.size();
while (m_index < n && isspace(m_packet[m_index]))
++m_index;
}