2 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali-toolkit/devel-api/builder/json-parser.h>
29 #include <dali-toolkit/internal/builder/json-parser-impl.h>
35 JsonParser JsonParser::New()
37 Internal::JsonParser* internal = new Internal::JsonParser();
38 return JsonParser(internal);
41 JsonParser JsonParser::New(const TreeNode& tree)
43 Internal::JsonParser* internal = new Internal::JsonParser(tree);
44 return JsonParser(internal);
47 JsonParser::JsonParser()
51 JsonParser::~JsonParser()
55 JsonParser JsonParser::DownCast(BaseHandle handle)
57 return JsonParser(dynamic_cast<Internal::JsonParser*>(handle.GetObjectPtr()));
60 bool JsonParser::Parse(const std::string& source)
62 return GetImplementation(*this).Parse(source);
65 void JsonParser::Pack(void)
67 return GetImplementation(*this).Pack();
70 const TreeNode* JsonParser::GetRoot() const
72 return GetImplementation(*this).GetRoot();
75 bool JsonParser::ParseError() const
77 return GetImplementation(*this).ParseError();
80 int JsonParser::GetErrorPosition() const
82 return GetImplementation(*this).GetErrorPosition();
85 std::string JsonParser::GetErrorDescription() const
87 return GetImplementation(*this).GetErrorDescription();
90 int JsonParser::GetErrorLineNumber() const
92 return GetImplementation(*this).GetErrorLineNumber();
95 int JsonParser::GetErrorColumn() const
97 return GetImplementation(*this).GetErrorColumn();
100 void JsonParser::Write(std::ostream& output, int indent) const
102 return GetImplementation(*this).Write(output, indent);
105 JsonParser::JsonParser(Internal::JsonParser* internal)
106 : BaseHandle(internal)
110 } // namespace Toolkit