1#!/usr/bin/env python 2# -*- coding: utf-8 -*- 3 4# Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. 5# 6# HDF is dual licensed: you can use it either under the terms of 7# the GPL, or the BSD license, at your option. 8# See the LICENSE file in the root of this repository for complete details. 9 10import json 11import sys 12import CppHeaderParser 13 14if __name__ == "__main__": 15 fileName = sys.argv[1]; 16 try: 17 hjson = json.loads(CppHeaderParser.CppHeader(fileName).toJSON()) 18 print(json.dumps({ 19 "result": hjson 20 })) 21 except CppHeaderParser.CppParseError: 22 print(CppHeaderParser.CppParseError) 23 finally: 24 pass