Init basesystem source codes.
[staging/basesystem.git] / nsframework / framework_unified / client / include / native_service / ns_util_crc.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 ////////////////////////////////////////////////////////////////////////////////////////////////////
18 /// \ingroup  NS_UtilityCenter
19 /// \brief    This file contains declaration of APIs to calcuate 16-bit and 32-bit CRC checksum of file.
20 ///
21 ////////////////////////////////////////////////////////////////////////////////////////////////////
22
23 /**
24  * @file ns_util_crc.h
25  */
26
27 #ifndef NS_NS_UTILITYCENTER_INC_NS_UTIL_CRC_H_  // NOLINT  (build/header_guard)
28 #define NS_NS_UTILITYCENTER_INC_NS_UTIL_CRC_H_
29
30 #include <native_service/frameworkunified_types.h>
31
32 /** @addtogroup BaseSystem
33  *  @{
34  */
35 /** @addtogroup native_service
36  *  @ingroup BaseSystem
37  *  @{
38  */
39 /** @addtogroup framework_unified
40  *  @ingroup native_service
41  *  @{
42  */
43 /** @addtogroup utility
44  *  @ingroup framework_unified
45  *  @{
46  */
47
48 ////////////////////////////////////////////////////////////////////////////////////////////////
49 /// \ingroup NS_UtilityCenter
50 /// \~english @par Brief
51 ///       Calculate the CRC value of the file
52 /// \~english @param [in] f_c_file_name
53 ///       PCSTR - the file to be calculated
54 /// \~english @param [out] f_ui_check_sum
55 ///       UI_16 - the CRC value of the file
56 /// \~english @retval eFrameworkunifiedStatusOK : Success
57 /// \~english @retval eFrameworkunifiedStatusFileLoadError : File Load Error
58 /// \~english @retval eFrameworkunifiedStatusInvldParam : Invalid Param
59 ///
60 /// \~english @par Prerequisite
61 ///       - None
62 /// \~english @par Change of internal state
63 ///       - None
64 /// \~english @par Conditions of processing failure
65 ///       - Failed to open the file. [eFrameworkunifiedStatusFileLoadError]
66 ///       - The pointer f_c_file_name is NULL. [eFrameworkunifiedStatusInvldParam]
67 /// \~english @par Classification
68 ///       Public
69 /// \~english @par Type
70 ///       Sync Only
71 /// \~english @par Detail
72 ///       The function calculates the CRC value(16 bit) of the file f_c_file_name.
73 /// \~english @see
74 ////////////////////////////////////////////////////////////////////////////////////////////////
75 EFrameworkunifiedStatus CalculateCRC16(PCSTR f_c_file_name, UI_16 & f_ui_check_sum);  // NOLINT (readability/nolint)
76
77 ////////////////////////////////////////////////////////////////////////////////////////////////
78 /// \ingroup NS_UtilityCenter
79 /// \~english @par Brief
80 ///       Calculate the CRC value of the file
81 /// \~english @param [in] f_c_file_name
82 ///       PCSTR - the file to be calculated
83 /// \~english @param [out] f_ui_check_sum
84 ///       UI_32 - the CRC value of the file
85 /// \~english @retval eFrameworkunifiedStatusOK : Success
86 /// \~english @retval eFrameworkunifiedStatusFileLoadError : File Load Error
87 /// \~english @retval eFrameworkunifiedStatusInvldParam : Invalid Param
88 ///
89 /// \~english @par Prerequisite
90 ///       - None
91 /// \~english @par Change of internal state
92 ///       - None
93 /// \~english @par Conditions of processing failure
94 ///       - Failed to open the file. [eFrameworkunifiedStatusFileLoadError]
95 ///       - The pointer f_c_file_name is NULL. [eFrameworkunifiedStatusInvldParam]
96 /// \~english @par Classification
97 ///       Public
98 /// \~english @par Type
99 ///       Sync Only
100 /// \~english @par Detail
101 ///       The function calculates the CRC value(32 bit) of the file f_c_file_name.
102 /// \~english @see
103 ////////////////////////////////////////////////////////////////////////////////////////////////
104 EFrameworkunifiedStatus CalculateCRC32(PCSTR f_c_file_name, UI_32 & f_ui_check_sum);  // NOLINT (readability/nolint)
105
106 #endif  // NS_NS_UTILITYCENTER_INC_NS_UTIL_CRC_H_  // NOLINT  (build/header_guard)
107
108 /** @}*/  // end of utility
109 /** @}*/  // end of framework_unified
110 /** @}*/  // end of native_service
111 /** @}*/  // end of BaseSystem