summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
893ec49)
Change-Id: I234742fc0ad1337e54b56fcb916f435d487da2c5
// EXTERNAL INCLUDES
#include <algorithm>
#include <cctype>
// EXTERNAL INCLUDES
#include <algorithm>
#include <cctype>
// INTERNAL INCLUDES
#include "dali-toolkit/devel-api/builder/tree-node.h"
// INTERNAL INCLUDES
#include "dali-toolkit/devel-api/builder/tree-node.h"
-bool CaseInsensitiveCharacterCompare(unsigned char a, unsigned char b)
-{
- // Converts to lower case in the current locale.
- return std::tolower(a) == std::tolower(b);
-}
/**
* return true if the lower cased ASCII strings are equal.
*/
/**
* return true if the lower cased ASCII strings are equal.
*/
-bool CaseInsensitiveStringCompare(const std::string& a, const std::string& b)
+bool CaseInsensitiveStringCompare(std::string_view a, std::string_view b)
- bool result = false;
- if(a.length() == b.length())
- {
- result = std::equal(a.begin(), a.end(), b.begin(), CaseInsensitiveCharacterCompare);
- }
- return result;
+ return (a.length() == b.length()) && std::equal(a.begin(), a.end(), b.begin(), [](auto x, auto y) {
+ return std::tolower(x) == std::tolower(y);
+ });
const TreeNode* p = mFirstChild;
while(p)
{
const TreeNode* p = mFirstChild;
while(p)
{
+ if(p->mName && CaseInsensitiveStringCompare(p->mName, childName))
- std::string nodeName(p->mName);
- if(CaseInsensitiveStringCompare(nodeName, childName))
- {
- return p;
- }
*/
#include <dali/public-api/common/vector-wrapper.h>
*/
#include <dali/public-api/common/vector-wrapper.h>
-extern bool CaseInsensitiveStringCompare( const std::string& a, const std::string& b );
+extern bool CaseInsensitiveStringCompare(std::string_view a, std::string_view b);