Revert "ScrollView - Store properties in local values for GetCurrentScrollPosition"
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / public-api / builder / json-parser.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0
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
18 // CLASS HEADER
19 #include <dali-toolkit/public-api/builder/json-parser.h>
20
21 #include <memory.h>
22 #include <functional>
23 #include <iostream>
24 #include <vector>
25 #include <cstring>
26 #include <algorithm>
27
28 // INTERNAL INCLUDES
29 #include <dali-toolkit/internal/builder/json-parser-impl.h>
30
31 namespace Dali
32 {
33
34 namespace Toolkit
35 {
36
37 JsonParser JsonParser::New()
38 {
39   Internal::JsonParser* internal = new Internal::JsonParser();
40   return JsonParser(internal);
41 }
42
43 JsonParser JsonParser::New(const TreeNode& tree)
44 {
45   Internal::JsonParser* internal = new Internal::JsonParser(tree);
46   return JsonParser(internal);
47 }
48
49 JsonParser::JsonParser()
50 {
51 }
52
53 JsonParser::~JsonParser()
54 {
55 }
56
57 JsonParser DownCast( BaseHandle handle )
58 {
59   return JsonParser( dynamic_cast<Internal::JsonParser*>(handle.GetObjectPtr()) );
60 }
61
62 int JsonParser::Parse(const std::string& source)
63 {
64   return GetImplementation(*this).Parse(source);
65 }
66
67 void JsonParser::Pack(void)
68 {
69   return GetImplementation(*this).Pack();
70 }
71
72 const TreeNode* JsonParser::GetRoot() const
73 {
74   return GetImplementation(*this).GetRoot();
75 }
76
77 bool JsonParser::ParseError() const
78 {
79   return GetImplementation(*this).ParseError();
80 }
81
82 int JsonParser::GetErrorPosition() const
83 {
84   return GetImplementation(*this).GetErrorPosition();
85 }
86
87 std::string JsonParser::GetErrorDescription() const
88 {
89   return GetImplementation(*this).GetErrorDescription();
90 }
91
92 int JsonParser::GetErrorLineNumber() const
93 {
94   return GetImplementation(*this).GetErrorLineNumber();
95 }
96
97 int JsonParser::GetErrorColumn() const
98 {
99   return GetImplementation(*this).GetErrorColumn();
100 }
101
102 void JsonParser::Write(std::ostream& output, int indent) const
103 {
104   return GetImplementation(*this).Write(output, indent);
105 }
106
107 JsonParser::JsonParser(Internal::JsonParser* internal)
108   : BaseHandle(internal)
109 {
110 }
111
112 } // namespace toolkit
113
114 } // namespace Dali
115