1 #ifndef DALI_TOOLKIT_INTERNAL_BUILDER_IMPL_DEBUG_H
2 #define DALI_TOOLKIT_INTERNAL_BUILDER_IMPL_DEBUG_H
5 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
20 #include <dali-toolkit/devel-api/builder/json-parser.h>
21 #include <dali/integration-api/debug.h>
23 #if defined(DEBUG_ENABLED)
31 #define DUMP_PARSE_TREE(parser) LogTree(parser)
32 #define DUMP_TEST_MAPPINGS(parser) \
33 OptionalChild mappings = IsChild(parser.GetRoot(), KEYNAME_MAPPINGS); \
36 std::ostringstream oss; \
37 oss << "Mappings: {" << std::endl; \
38 for(TreeNode::ConstIterator iter = (*mappings).CBegin(); iter != (*mappings).CEnd(); ++iter) \
40 Property::Value value; \
41 bool converted = GetPropertyMap(*mappings, (*iter).first, Property::NONE, value); \
44 oss << " " << (*iter).first << ":" << value << std::endl; \
47 oss << "}" << std::endl; \
48 DALI_LOG_INFO(gFilterScript, Debug::Verbose, oss.str().c_str()); \
51 void LogTree(const Toolkit::JsonParser& mParser);
53 std::string PropertyValueToString(const Property::Value& value);
55 } // namespace Internal
56 } // namespace Toolkit
61 #define DUMP_PARSE_TREE(parser)
62 #define DUMP_TEST_MAPPINGS(parser)
64 #endif // DEBUG_ENABLED
65 #endif // DALI_TOOLKIT_INTERNAL_BUILDER_IMPL_DEBUG_H