Revert "[Tizen] Revert "Use touch consumed return to set whether we process a gesture...
[platform/core/uifw/dali-core.git] / dali / devel-api / common / hash.h
1 #ifndef DALI_HASH
2 #define DALI_HASH
3
4 /*
5  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <string>
23
24 //INTERNAL INCLUDES
25 #include <dali/public-api/common/dali-common.h>
26
27 namespace Dali
28 {
29 enum
30 {
31   INITIAL_HASH_VALUE = 5381
32 };
33
34 /**
35  * @brief Create a hash code for a string
36  * @param toHash string to hash
37  * @return hash code
38  */
39 DALI_CORE_API std::size_t CalculateHash(const std::string& toHash);
40
41 /**
42  * @brief Create a hash code for 2 strings combined.
43  * Allows a hash to be calculated without concatenating the strings and allocating any memory.
44  * @param string1 first string
45  * @param string2 second string
46  * @return hash code
47  */
48 DALI_CORE_API std::size_t CalculateHash(const std::string& string1, const std::string& string2);
49
50 /**
51  * @brief Create a hash code for a string
52  * @param toHash string to hash
53  * @param terminator character terminating the hashing
54  * @return hash code
55  */
56 DALI_CORE_API std::size_t CalculateHash(const std::string& toHash, char terminator);
57
58 } // namespace Dali
59
60 #endif // DALI_HASH