Revert "[SRUK] (StyleManager) Create a style manager"
[platform/core/uifw/dali-toolkit.git] / optional / dali-toolkit / public-api / builder / json-parser.cpp
1 //
2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://floralicense.org/license/
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 // CLASS HEADER
18 #include <dali-toolkit/public-api/builder/json-parser.h>
19
20 #include <memory.h>
21 #include <functional>
22 #include <iostream>
23 #include <vector>
24 #include <cstring>
25 #include <algorithm>
26
27 // INTERNAL INCLUDES
28 #include <dali-toolkit/internal/builder/json-parser-impl.h>
29
30 namespace Dali
31 {
32
33 namespace Toolkit
34 {
35
36 JsonParser JsonParser::New()
37 {
38   Internal::JsonParser* internal = new Internal::JsonParser();
39   return JsonParser(internal);
40 }
41
42 JsonParser JsonParser::New(const TreeNode& tree)
43 {
44   Internal::JsonParser* internal = new Internal::JsonParser(tree);
45   return JsonParser(internal);
46 }
47
48 JsonParser::JsonParser()
49 {
50 }
51
52 JsonParser::~JsonParser()
53 {
54 }
55
56 JsonParser DownCast( BaseHandle handle )
57 {
58   return JsonParser( dynamic_cast<Internal::JsonParser*>(handle.GetObjectPtr()) );
59 }
60
61 int JsonParser::Parse(const std::string& source)
62 {
63   return GetImplementation(*this).Parse(source);
64 }
65
66 void JsonParser::Pack(void)
67 {
68   return GetImplementation(*this).Pack();
69 }
70
71 const TreeNode* JsonParser::GetRoot() const
72 {
73   return GetImplementation(*this).GetRoot();
74 }
75
76 bool JsonParser::ParseError() const
77 {
78   return GetImplementation(*this).ParseError();
79 }
80
81 int JsonParser::GetErrorPosition() const
82 {
83   return GetImplementation(*this).GetErrorPosition();
84 }
85
86 std::string JsonParser::GetErrorDescription() const
87 {
88   return GetImplementation(*this).GetErrorDescription();
89 }
90
91 int JsonParser::GetErrorLineNumber() const
92 {
93   return GetImplementation(*this).GetErrorLineNumber();
94 }
95
96 int JsonParser::GetErrorColumn() const
97 {
98   return GetImplementation(*this).GetErrorColumn();
99 }
100
101 void JsonParser::Write(std::ostream& output, int indent) const
102 {
103   return GetImplementation(*this).Write(output, indent);
104 }
105
106 JsonParser::JsonParser(Internal::JsonParser* internal)
107   : BaseHandle(internal)
108 {
109 }
110
111 } // namespace toolkit
112
113 } // namespace Dali
114