2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 // http://floralicense.org/license/
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.
18 #include <dali-toolkit/public-api/builder/json-parser.h>
28 #include <dali-toolkit/internal/builder/json-parser-impl.h>
36 JsonParser JsonParser::New()
38 Internal::JsonParser* internal = new Internal::JsonParser();
39 return JsonParser(internal);
42 JsonParser JsonParser::New(const TreeNode& tree)
44 Internal::JsonParser* internal = new Internal::JsonParser(tree);
45 return JsonParser(internal);
48 JsonParser::JsonParser()
52 JsonParser::~JsonParser()
56 JsonParser DownCast( BaseHandle handle )
58 return JsonParser( dynamic_cast<Internal::JsonParser*>(handle.GetObjectPtr()) );
61 int JsonParser::Parse(const std::string& source)
63 return GetImplementation(*this).Parse(source);
66 void JsonParser::Pack(void)
68 return GetImplementation(*this).Pack();
71 const TreeNode* JsonParser::GetRoot() const
73 return GetImplementation(*this).GetRoot();
76 bool JsonParser::ParseError() const
78 return GetImplementation(*this).ParseError();
81 int JsonParser::GetErrorPosition() const
83 return GetImplementation(*this).GetErrorPosition();
86 std::string JsonParser::GetErrorDescription() const
88 return GetImplementation(*this).GetErrorDescription();
91 int JsonParser::GetErrorLineNumber() const
93 return GetImplementation(*this).GetErrorLineNumber();
96 int JsonParser::GetErrorColumn() const
98 return GetImplementation(*this).GetErrorColumn();
101 void JsonParser::Write(std::ostream& output, int indent) const
103 return GetImplementation(*this).Write(output, indent);
106 JsonParser::JsonParser(Internal::JsonParser* internal)
107 : BaseHandle(internal)
111 } // namespace toolkit