jsoncpp 升级1.9.5

Signed-off-by: zt147369 <zhangting201@huawei.com>
This commit is contained in:
zt147369
2023-03-10 09:16:32 +00:00
parent d48008ac97
commit 855b19ce1e
68 changed files with 1234 additions and 1193 deletions
+1
View File
@@ -0,0 +1 @@
{'//this is bad JSON.'}
+1 -1
View File
@@ -1,4 +1,4 @@
[ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
[ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"ccccccccccccccccccccccc",
"dddddddddddddddddddddddddddddddddddddddddddddddddddd" ]
+11 -11
View File
@@ -1,17 +1,17 @@
{
{
"count" : 1234,
"name" : { "aka" : "T.E.S.T.", "id" : 123987 },
"attribute" : [
"random",
"short",
"bold",
12,
{ "height" : 7, "width" : 64 }
"attribute" : [
"random",
"short",
"bold",
12,
{ "height" : 7, "width" : 64 }
],
"test": { "1" :
{ "2" :
{ "3" : { "coord" : [ 1,2] }
}
"test": { "1" :
{ "2" :
{ "3" : { "coord" : [ 1,2] }
}
}
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
{
{
"count" : 1234,
"name" : "test",
"attribute" : "random"
+1 -1
View File
@@ -1,3 +1,3 @@
{
{
"" : 1234
}
@@ -6,6 +6,6 @@
/* Comment before 'second'
*/
.second=2
/* A comment at
/* A comment at
the end of the file.
*/
@@ -9,6 +9,6 @@
"second" : 2
}
/* A comment at
/* A comment at
the end of the file.
*/
+4 -4
View File
@@ -15,7 +15,7 @@ import types
if len(sys.argv) != 2:
print("Usage: %s input-json-file", sys.argv[0])
sys.exit(3)
input_path = sys.argv[1]
base_path = os.path.splitext(input_path)[0]
actual_path = base_path + '.actual'
@@ -23,7 +23,7 @@ rewrite_path = base_path + '.rewrite'
rewrite_actual_path = base_path + '.actual-rewrite'
def valueTreeToString(fout, value, path = '.'):
ty = type(value)
ty = type(value)
if ty is types.DictType:
fout.write('%s={}\n' % path)
suffix = path[-1] != '.' and '.' or ''
@@ -49,7 +49,7 @@ def valueTreeToString(fout, value, path = '.'):
fout.write('%s=null\n' % path)
else:
assert False and "Unexpected value type"
def parseAndSaveValueTree(input, actual_path):
root = json.loads(input)
fout = file(actual_path, 'wt')
@@ -62,7 +62,7 @@ def rewriteValueTree(value, rewrite_path):
#rewrite = rewrite[1:-1] # Somehow the string is quoted ! jsonpy bug ?
file(rewrite_path, 'wt').write(rewrite + '\n')
return rewrite
input = file(input_path, 'rt').read()
root = parseAndSaveValueTree(input, actual_path)
rewrite = rewriteValueTree(json.write(root), rewrite_path)