X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fbuilder%2Fdictionary.h;h=b570c047513852f50cd83507a9f9d23b3ebabf91;hb=87a2f04c12ba736b814218ee9edaefbdfb339a08;hp=a3036d97475a536efeee549bcc4ac6915ea75316;hpb=b05a852e155e887cb0e9e1018205c57bfbbfa334;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/builder/dictionary.h b/dali-toolkit/internal/builder/dictionary.h index a3036d9..b570c04 100644 --- a/dali-toolkit/internal/builder/dictionary.h +++ b/dali-toolkit/internal/builder/dictionary.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_BUILDER_DICTIONARY_H /* - * Copyright (c) 2020 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. @@ -30,7 +30,6 @@ namespace Toolkit { namespace Internal { - /** * The Dictionary template class enables a means of storing key-value * pairs where the keys are strings and the value can be a complex @@ -41,7 +40,7 @@ namespace Internal using DictionaryKeys = std::vector; -inline void Merge( DictionaryKeys& toDict, const DictionaryKeys& fromDict ) +inline void Merge(DictionaryKeys& toDict, const DictionaryKeys& fromDict) { for(const auto& element : fromDict) { @@ -53,7 +52,6 @@ inline void Merge( DictionaryKeys& toDict, const DictionaryKeys& fromDict ) } } - template class Dictionary { @@ -64,7 +62,7 @@ private: struct Element { std::string key; - EntryType entry; + EntryType entry; Element(std::string name, EntryType entry) : key(std::move(name)), entry(std::move(entry)) @@ -82,9 +80,9 @@ private: auto FindElement(std::string_view key) { - return std::find_if(container.begin(), container.end(), [key](auto& e){ - return bool(key == e.key); - }); + return std::find_if(container.begin(), container.end(), [key](auto& e) { + return bool(key == e.key); + }); } public: @@ -138,12 +136,12 @@ public: if(iter != End()) { - container.erase( iter ); + container.erase(iter); } } } - void Merge( const Dictionary& dictionary ) + void Merge(const Dictionary& dictionary) { for(const auto& element : dictionary.container) { @@ -166,7 +164,7 @@ public: */ const EntryType* FindConst(std::string_view key) const { - if( ! key.empty() ) + if(!key.empty()) { auto iter = FindElementCaseInsensitive(key); @@ -184,7 +182,7 @@ public: */ EntryType* Find(std::string_view key) const { - if( ! key.empty() ) + if(!key.empty()) { auto iter = FindElementCaseInsensitive(key); @@ -209,7 +207,7 @@ public: return container.cend(); } - void GetKeys( DictionaryKeys& keys ) const + void GetKeys(DictionaryKeys& keys) const { keys.clear(); for(const auto& element : container) @@ -224,10 +222,8 @@ public: } }; - - -}//Internal -}//Toolkit -}//Dali +} // namespace Internal +} // namespace Toolkit +} // namespace Dali #endif // DALI_TOOLKIT_INTERNAL_BUILDER_DICTIONARY_H