Purge underscored header file barriers
[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) 2019 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
30 enum
31 {
32   INITIAL_HASH_VALUE = 5381
33 };
34
35 /**
36  * @brief Create a hash code for a string
37  * @param toHash string to hash
38  * @return hash code
39  */
40 DALI_CORE_API std::size_t CalculateHash( const std::string& toHash );
41
42 /**
43  * @brief Create a hash code for 2 strings combined.
44  * Allows a hash to be calculated without concatenating the strings and allocating any memory.
45  * @param string1 first string
46  * @param string2 second string
47  * @return hash code
48  */
49 DALI_CORE_API std::size_t CalculateHash( const std::string& string1, const std::string& string2 );
50
51 } // namespace Dali
52
53 #endif // DALI_HASH