2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/public-api/object/property-key.h>
25 Property::Key::Key( const std::string& key )
27 indexKey( Property::INVALID_INDEX ),
32 Property::Key::Key( Property::Index key )
38 bool Property::Key::operator== (const std::string& rhs)
41 if(type == Key::STRING)
43 result = (stringKey == rhs);
48 bool Property::Key::operator== (Property::Index rhs)
51 if(type == Key::INDEX)
53 result = (indexKey == rhs);
58 bool Property::Key::operator== (const Key& rhs)
61 if(type == Key::STRING && rhs.type == Key::STRING )
63 result = (stringKey == rhs.stringKey);
65 else if( type == Key::INDEX && rhs.type == Key::INDEX )
67 result = (indexKey == rhs.indexKey);
72 bool Property::Key::operator!= (const std::string& rhs)
74 return !operator==(rhs);
77 bool Property::Key::operator!= (Property::Index rhs)
79 return !operator==(rhs);
82 bool Property::Key::operator!= (const Key& rhs)
84 return !operator==(rhs);
87 std::ostream& operator<<( std::ostream& stream, const Property::Key& key )
89 if( key.type == Property::Key::INDEX )
91 stream << key.indexKey;
95 stream << key.stringKey;