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>
29 #include <dali-toolkit/internal/builder/json-parser-impl.h>
37 JsonParser JsonParser::New()
39 Internal::JsonParser* internal = new Internal::JsonParser();
40 return JsonParser(internal);
43 JsonParser JsonParser::New(const TreeNode& tree)
45 Internal::JsonParser* internal = new Internal::JsonParser(tree);
46 return JsonParser(internal);
49 JsonParser::JsonParser()
53 JsonParser::~JsonParser()
57 JsonParser DownCast( BaseHandle handle )
59 return JsonParser( dynamic_cast<Internal::JsonParser*>(handle.GetObjectPtr()) );
62 int JsonParser::Parse(const std::string& source)
64 return GetImplementation(*this).Parse(source);
67 void JsonParser::Pack(void)
69 return GetImplementation(*this).Pack();
72 const TreeNode* JsonParser::GetRoot() const
74 return GetImplementation(*this).GetRoot();
77 bool JsonParser::ParseError() const
79 return GetImplementation(*this).ParseError();
82 int JsonParser::GetErrorPosition() const
84 return GetImplementation(*this).GetErrorPosition();
87 std::string JsonParser::GetErrorDescription() const
89 return GetImplementation(*this).GetErrorDescription();
92 int JsonParser::GetErrorLineNumber() const
94 return GetImplementation(*this).GetErrorLineNumber();
97 int JsonParser::GetErrorColumn() const
99 return GetImplementation(*this).GetErrorColumn();
102 void JsonParser::Write(std::ostream& output, int indent) const
104 return GetImplementation(*this).Write(output, indent);
107 JsonParser::JsonParser(Internal::JsonParser* internal)
108 : BaseHandle(internal)
112 } // namespace toolkit