Skip to content
Snippets Groups Projects
Commit 5ff7e3cf authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

parse_cmortable_buffer_json(): changed interface

parent 57283271
No related branches found
No related tags found
1 merge request!246M214003/develop
......@@ -217,7 +217,7 @@ KVList_append_json(KVList &kvlist, const char *key, const char *js, jsmntok_t *t
}
static int
addTokensJson(PMList &pmlist, const char *js, jsmntok_t *t, int count)
add_tokens_json(PMList &pmlist, const char *js, jsmntok_t *t, int count)
{
bool debug = false;
char name[4096];
......@@ -298,12 +298,12 @@ addTokensJson(PMList &pmlist, const char *js, jsmntok_t *t, int count)
}
static void
parse_cmortable_buffer_json(PMList &pmlist, size_t buffersize, char *buffer, const char *filename)
parse_cmortable_buffer_json(PMList &pmlist, const std::vector<char> &buffer, const char *filename)
{
// Prepare parser
auto p = jsmn_new();
auto status = jsmn_parse(p, buffer, buffersize);
auto status = jsmn_parse(p, buffer.data(), buffer.size());
if (status != 0)
{
switch (status)
......@@ -316,7 +316,7 @@ parse_cmortable_buffer_json(PMList &pmlist, size_t buffersize, char *buffer, con
}
}
addTokensJson(pmlist, buffer, p->tokens, (int) p->toknext);
add_tokens_json(pmlist, buffer.data(), p->tokens, (int) p->toknext);
jsmn_destroy(p);
}
......@@ -328,7 +328,7 @@ PMList::read_cmor_table(FILE *fp, const char *name)
int buffer0 = listBuffer.buffer[0];
if (buffer0 == '{') { parse_cmortable_buffer_json(*this, listBuffer.buffer.size(), listBuffer.buffer.data(), name); }
if (buffer0 == '{') { parse_cmortable_buffer_json(*this, listBuffer.buffer, name); }
else if (std::strncmp(listBuffer.buffer.data(), "table_id:", 9) == 0)
{
parse_cmortable_buffer(*this, listBuffer.buffer.size(), listBuffer.buffer.data());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment