Add support to create Property::Map with initializer_list
[platform/core/uifw/dali-core.git] / dali / public-api / object / property-key.cpp
index 78e42bf..1d309d0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -23,18 +23,25 @@ namespace Dali
 {
 
 Property::Key::Key( const std::string& key )
-: type(Key::STRING),
+: type( Key::STRING ),
   indexKey( Property::INVALID_INDEX ),
   stringKey( key )
 {
 }
 
 Property::Key::Key( Property::Index key )
-: type(Key::INDEX),
+: type( Key::INDEX ),
   indexKey( key )
 {
 }
 
+Property::Key::Key( const char * key )
+: type( Key::STRING ),
+  indexKey( Property::INVALID_INDEX ),
+  stringKey( key )
+{
+}
+
 bool Property::Key::operator== (const std::string& rhs)
 {
   bool result=false;
@@ -45,6 +52,11 @@ bool Property::Key::operator== (const std::string& rhs)
   return result;
 }
 
+bool Property::Key::operator== ( const char* rhs )
+{
+  return operator==( std::string( rhs ) );
+}
+
 bool Property::Key::operator== (Property::Index rhs)
 {
   bool result=false;
@@ -74,6 +86,11 @@ bool Property::Key::operator!= (const std::string& rhs)
   return !operator==(rhs);
 }
 
+bool Property::Key::operator!= ( const char* rhs )
+{
+  return !operator==(rhs);
+}
+
 bool Property::Key::operator!= (Property::Index rhs)
 {
   return !operator==(rhs);