CUBRID Engine  latest
db_json_types_internal.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
20 
21 bool
23 {
24  return !IsArray () && !IsObject ();
25 }
26 
27 /*
28  * db_json_doc_to_value ()
29  * doc (in)
30  * value (out)
31  * We need this cast in order to use the overloaded methods
32  * JSON_DOC is derived from GenericDocument which also extends GenericValue
33  * Yet JSON_DOC and JSON_VALUE are two different classes because they are templatized and their type is not known
34  * at compile time
35  */
36 JSON_VALUE &
38 {
39  return reinterpret_cast<JSON_VALUE &> (doc);
40 }
41 
42 const JSON_VALUE &
44 {
45  return reinterpret_cast<const JSON_VALUE &> (doc);
46 }
JSON_VALUE & db_json_doc_to_value(JSON_DOC &doc)
rapidjson::GenericValue< JSON_ENCODING, JSON_PRIVATE_MEMPOOL > JSON_VALUE