2 * Copyright (c) 2014 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/public-api/builder/json-parser.h>
30 #include <dali-toolkit/internal/builder/json-parser-impl.h>
38 JsonParser JsonParser::New()
40 Internal::JsonParser* internal = new Internal::JsonParser();
41 return JsonParser(internal);
44 JsonParser JsonParser::New(const TreeNode& tree)
46 Internal::JsonParser* internal = new Internal::JsonParser(tree);
47 return JsonParser(internal);
50 JsonParser::JsonParser()
54 JsonParser::~JsonParser()
58 JsonParser DownCast( BaseHandle handle )
60 return JsonParser( dynamic_cast<Internal::JsonParser*>(handle.GetObjectPtr()) );
63 int JsonParser::Parse(const std::string& source)
65 return GetImplementation(*this).Parse(source);
68 void JsonParser::Pack(void)
70 return GetImplementation(*this).Pack();
73 const TreeNode* JsonParser::GetRoot() const
75 return GetImplementation(*this).GetRoot();
78 bool JsonParser::ParseError() const
80 return GetImplementation(*this).ParseError();
83 int JsonParser::GetErrorPosition() const
85 return GetImplementation(*this).GetErrorPosition();
88 std::string JsonParser::GetErrorDescription() const
90 return GetImplementation(*this).GetErrorDescription();
93 int JsonParser::GetErrorLineNumber() const
95 return GetImplementation(*this).GetErrorLineNumber();
98 int JsonParser::GetErrorColumn() const
100 return GetImplementation(*this).GetErrorColumn();
103 void JsonParser::Write(std::ostream& output, int indent) const
105 return GetImplementation(*this).Write(output, indent);
108 JsonParser::JsonParser(Internal::JsonParser* internal)
109 : BaseHandle(internal)
113 } // namespace toolkit