X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fbuilder%2Fjson-parser-impl.h;h=58c2ce000a1639eeca9304c62ee462d396b7395b;hb=b8da2e53925b9abb9fa362560069e8ca4aa62f81;hp=987799e1900fd48d6610ca99490987fc7a45e9b9;hpb=57869973578f6a0b0f836d396c7232ddb8302c6b;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/builder/json-parser-impl.h b/dali-toolkit/internal/builder/json-parser-impl.h index 987799e..58c2ce0 100644 --- a/dali-toolkit/internal/builder/json-parser-impl.h +++ b/dali-toolkit/internal/builder/json-parser-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_JSON_PARSER_IMPL_H__ -#define __DALI_JSON_PARSER_IMPL_H__ +#ifndef DALI_JSON_PARSER_IMPL_H +#define DALI_JSON_PARSER_IMPL_H /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * 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. @@ -18,26 +18,24 @@ * */ -#include -#include +// EXTERNAL INCLUDES +#include +#include #include +#include -// -#include -#include -#include +// INTERNAL INCLUDES +#include +#include #include namespace Dali { - namespace Toolkit { - namespace Internal { - /* * Parses JSON */ @@ -56,12 +54,12 @@ public: /* */ - ~JsonParser(); + ~JsonParser() override; /* * @copydoc Toolkit::JsonParser::Parse() */ - int Parse(const std::string& source); + bool Parse(const std::string& source); /* * @copydoc Toolkit::JsonParser::Pack() @@ -104,45 +102,42 @@ public: void Write(std::ostream& output, int indent) const; private: - typedef std::vector VectorChar; + typedef std::vector VectorChar; typedef VectorChar::iterator VectorCharIter; - typedef std::list SourceContainer; + typedef std::list SourceContainer; typedef std::list::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(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(); @@ -153,5 +148,4 @@ inline Internal::JsonParser& GetImplementation(Toolkit::JsonParser& parser) } // namespace Dali - -#endif // __DALI_JSON_PARSER_IMPL_H__ +#endif // DALI_JSON_PARSER_IMPL_H