HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_PerfMonJSONHandle.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_PerfMonJSONHandle.h ( UT Library, C++)
7  *
8  * COMMENTS: This class handles the parsing of performance monitor
9  * profile files stored in JSON format.
10  *
11  */
12 
13 #ifndef __UT_PerfMonJSONHandle__
14 #define __UT_PerfMonJSONHandle__
15 
16 #include "UT_API.h"
17 
18 #include "UT_JSONHandle.h"
19 #include "UT_JSONParser.h"
20 #include "UT_String.h"
21 
22 class UT_PerfMonProfile;
23 class UT_StringArray;
24 struct ut_ParseInputData;
25 struct ut_ParseStateData;
26 
28 {
29 public:
30  /// `profile` is an empty profile that will be populated at parse time
31  /// by the JSON contents stored in the given file.
32  UT_PerfMonJSONHandle(const char *file_path, UT_PerfMonProfile *profile);
33 
34  ~UT_PerfMonJSONHandle() override;
35 
36  /// Parse the JSON file and populate the profile with the data
37  /// stored in the file.
38  bool parseJSON(UT_StringArray &errors);
39 
40  /// Inherited from UT_JSONHandle.
41  bool jsonNull(UT_JSONParser &p) override;
42  bool jsonBool(
43  UT_JSONParser &p, bool value) override;
44  bool jsonInt(
45  UT_JSONParser &p, int64 value) override;
46  bool jsonReal(
47  UT_JSONParser &p, fpreal64 value) override;
48  bool jsonString(
49  UT_JSONParser &p, const char *value,
50  int64 len) override;
51  bool jsonKey(
52  UT_JSONParser &p, const char *v,
53  int64 len) override;
54  bool jsonBeginMap(UT_JSONParser &p) override;
55  bool jsonEndMap(UT_JSONParser &p) override;
56  bool jsonBeginArray(UT_JSONParser &p) override;
57  bool jsonEndArray(UT_JSONParser &p) override;
58 
59 private:
60 
61  bool processInput_(UT_JSONParser &p,
62  const ut_ParseInputData &input);
63 
64  UT_String myFilePath;
65  ut_ParseStateData *myData;
66 };
67 
68 #endif
virtual bool jsonInt(UT_JSONParser &p, int64 value)=0
Event method to process an integer.
const GLdouble * v
Definition: glcorearb.h:837
UT_JSONHandle processes events from a UT_JSONParser parser.
Definition: UT_JSONHandle.h:36
virtual bool jsonBool(UT_JSONParser &p, bool value)=0
Event method to process a bool (true or false tokens)
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:87
#define UT_API
Definition: UT_API.h:14
virtual bool jsonBeginArray(UT_JSONParser &p)=0
Event method invoked at the beginning of an array object.
double fpreal64
Definition: SYS_Types.h:201
virtual bool jsonEndArray(UT_JSONParser &p)=0
Event method invoked at the end of an array object.
virtual bool jsonKey(UT_JSONParser &p, const char *v, int64 len)=0
Event method to process the key of a map/object is read.
long long int64
Definition: SYS_Types.h:116
virtual bool jsonReal(UT_JSONParser &p, fpreal64 value)=0
Event method to process a real/float.
virtual bool jsonString(UT_JSONParser &p, const char *value, int64 len)=0
Event method to process a string value.
virtual bool jsonBeginMap(UT_JSONParser &p)=0
Event method invoked at the start of a map/object.
Definition: core.h:1131
virtual bool jsonNull(UT_JSONParser &p)=0
Event method to process a null token.
virtual bool jsonEndMap(UT_JSONParser &p)=0
Event method invoked at the end of a map/object.