-#ifndef __DALI_JSON_PARSER_IMPL_H__
-#define __DALI_JSON_PARSER_IMPL_H__
-
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+#ifndef DALI_JSON_PARSER_IMPL_H
+#define DALI_JSON_PARSER_IMPL_H
-#include <string>
-#include <vector>
-#include <list>
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
-//
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/vector-wrapper.h>
#include <dali/public-api/object/base-object.h>
-#include <dali-toolkit/public-api/builder/json-parser.h>
-#include <dali-toolkit/public-api/builder/tree-node.h>
+#include <list>
+#include <string>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/devel-api/builder/json-parser.h>
+#include <dali-toolkit/devel-api/builder/tree-node.h>
#include <dali-toolkit/internal/builder/builder-get-is.inl.h>
-namespace Dali DALI_IMPORT_API
+namespace Dali
{
-
namespace Toolkit
{
-
-namespace Internal DALI_INTERNAL
+namespace Internal
{
-
/*
* Parses JSON
*/
/*
*/
- ~JsonParser();
+ ~JsonParser() override;
/*
* @copydoc Toolkit::JsonParser::Parse()
*/
- int Parse(const std::string& source);
+ bool Parse(const std::string& source);
/*
* @copydoc Toolkit::JsonParser::Pack()
void Write(std::ostream& output, int indent) const;
private:
- typedef std::vector<char> VectorChar;
+ typedef std::vector<char> VectorChar;
typedef VectorChar::iterator VectorCharIter;
- typedef std::list<VectorChar> SourceContainer;
+ typedef std::list<VectorChar> SourceContainer;
typedef std::list<VectorChar>::iterator SourceContainerIter;
- JsonParser(JsonParser &);
+ JsonParser(JsonParser&);
JsonParser& operator=(const JsonParser&);
- SourceContainer mSources; ///< List of strings from Parse() merge operations
-
- TreeNode* mRoot; ///< Tree root
+ SourceContainer mSources; ///< List of strings from Parse() merge operations
- const char *mErrorDescription; ///< Last parse error description
- int mErrorPosition; ///< Last parse error position
- int mErrorLine; ///< Last parse error line
- int mErrorColumn; ///< Last parse error column
+ TreeNode* mRoot; ///< Tree root
- int mNumberOfChars; ///< The size of string data for all nodes
- int mNumberOfNodes; ///< Node count
+ const char* mErrorDescription; ///< Last parse error description
+ int mErrorPosition; ///< Last parse error position
+ int mErrorLine; ///< Last parse error line
+ int mErrorColumn; ///< Last parse error column
+ int mNumberOfChars; ///< The size of string data for all nodes
+ int mNumberOfNodes; ///< Node count
};
} // namespace Internal
-
inline const Internal::JsonParser& GetImplementation(const Toolkit::JsonParser& parser)
{
- DALI_ASSERT_ALWAYS( parser && "JsonParser handle is empty" );
+ DALI_ASSERT_ALWAYS(parser && "JsonParser handle is empty");
const BaseObject& handle = parser.GetBaseObject();
return static_cast<const Internal::JsonParser&>(handle);
}
-
inline Internal::JsonParser& GetImplementation(Toolkit::JsonParser& parser)
{
- DALI_ASSERT_ALWAYS( parser && "JsonParser handle is empty" );
+ DALI_ASSERT_ALWAYS(parser && "JsonParser handle is empty");
BaseObject& handle = parser.GetBaseObject();
} // namespace Dali
-
-#endif // __DALI_JSON_PARSER_IMPL_H__
+#endif // DALI_JSON_PARSER_IMPL_H