3 ==================================================================================
4 Copyright (c) 2020 Nokia
5 Copyright (c) 2020 AT&T Intellectual Property.
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18 ==================================================================================
23 Abstract: This class provides the ability to parse a json string into
24 a hashtable, and exposes various functions that can be used
25 to read the data from the hash.
28 Author: E. Scott Daniels
37 // ------------------------------------------------------------------------
41 void* st; // the resulting symbol table generated by parse
42 void* master_st; // if user switches to a sub-blob; this tracks the original root st
44 Jhash& operator=( const Jhash& soi ); // jhashes cannot be copied because of underlying symbol table goo
45 Jhash( const Jhash& soi );
49 Jhash( const char* jblob ); // builder
50 Jhash( Jhash&& soi ); // mover
51 Jhash& operator=( Jhash&& soi ); // move operator
52 ~Jhash(); // destruction
54 bool Set_blob( const char* name ); // blob/root selection
56 bool Set_blob_ele( const char* name, int eidx ); // set from an array element
61 std::string String( const char* name ); // value fetching
62 double Value( const char* name );
63 bool Bool( const char* name );
65 bool Exists( const char* name ); // presence checking
66 bool Is_missing( const char* name );
68 bool Is_bool( const char* name ); // type checking functions
69 bool Is_null( const char* name );
70 bool Is_string( const char* name );
71 bool Is_value( const char* name );
73 int Array_len( const char* name );
75 bool Is_bool_ele( const char* name, int eidx ); // type of array element checks
76 bool Is_null_ele( const char* name, int eidx );
77 bool Is_string_ele( const char* name, int eidx );
78 bool Is_value_ele( const char* name, int eidx );
80 bool Bool_ele( const char* name, int eidx ); // array oriented sussing functions
81 std::string String_ele( const char* name, int eidx );
82 double Value_ele( const char* name, int eidx );