All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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  */
13 #ifndef __UT_PerfMonJSONHandle__
14 #define __UT_PerfMonJSONHandle__
16 #include "UT_API.h"
18 #include "UT_JSONHandle.h"
19 #include "UT_JSONParser.h"
20 #include "UT_String.h"
22 class UT_PerfMonProfile;
23 class UT_StringArray;
24 struct ut_ParseInputData;
25 struct ut_ParseStateData;
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);
34  virtual ~UT_PerfMonJSONHandle();
36  /// Parse the JSON file and populate the profile with the data
37  /// stored in the file.
38  bool parseJSON(UT_StringArray &errors);
40  /// Inherited from UT_JSONHandle.
41  virtual bool jsonNull(UT_JSONParser &p);
42  virtual bool jsonBool(UT_JSONParser &p, bool value);
43  virtual bool jsonInt(UT_JSONParser &p, int64 value);
44  virtual bool jsonReal(UT_JSONParser &p, fpreal64 value);
45  virtual bool jsonString(
46  UT_JSONParser &p, const char *value,
47  int64 len);
48  virtual bool jsonKey(
49  UT_JSONParser &p, const char *v,
50  int64 len);
51  virtual bool jsonBeginMap(UT_JSONParser &p);
52  virtual bool jsonEndMap(UT_JSONParser &p);
53  virtual bool jsonBeginArray(UT_JSONParser &p);
54  virtual bool jsonEndArray(UT_JSONParser &p);
56 private:
58  bool processInput_(UT_JSONParser &p,
59  const ut_ParseInputData &input);
61  UT_String myFilePath;
62  ut_ParseStateData *myData;
63 };
65 #endif
png_infop png_charpp int png_charpp profile
Definition: png.h:2467
virtual bool jsonInt(UT_JSONParser &p, int64 value)=0
Event method to process an integer.
const GLdouble * v
Definition: glcorearb.h:836
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:75
#define UT_API
Definition: UT_API.h:13
virtual bool jsonBeginArray(UT_JSONParser &p)=0
Event method invoked at the beginning of an array object.
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:107
double fpreal64
Definition: SYS_Types.h:192
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.
GLsizei const GLfloat * value
Definition: glcorearb.h:823
virtual bool jsonBeginMap(UT_JSONParser &p)=0
Event method invoked at the start of a map/object.
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.