2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
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.
17 ////////////////////////////////////////////////////////////////////////////////////////////////////
18 /// \ingroup tag_NS_ConfigParser
19 /// \brief This file contains declaration of class IConfigReader.
21 ////////////////////////////////////////////////////////////////////////////////////////////////////
25 * @brief \~english This file contains declaration of class IConfigReader.
27 /** @addtogroup BaseSystem
30 /** @addtogroup native_service
34 /** @addtogroup framework_unified
35 * @ingroup native_service
39 #ifndef __FRAMEWORKUNIFIED_NATIVESERVICES_NSCONFIGPARSER_INC_CONFIG_READER_H__ // NOLINT (build/header_guard)
40 #define __FRAMEWORKUNIFIED_NATIVESERVICES_NSCONFIGPARSER_INC_CONFIG_READER_H__ // NOLINT(build/header_guard)
42 ////////////////////////////////////////////////////////////////////////////////////////////////////
44 ////////////////////////////////////////////////////////////////////////////////////////////////////
45 #include <native_service/frameworkunified_types.h> // NOLINT(build/header_guard)
49 * IConfigReader is an abstract class which is inherited by different type configuration file
53 * @class IConfigReader
54 * \~english @brief IConfigReader
55 * \~english @par Brief Introduction
56 * Class to provide class of parse config file.
60 /////////////////////////////////////////////////////////////////////////////////////
61 /// \ingroup IConfigReader
62 /// \~english @par Summary
63 /// Constructor of IConfigReader class.
64 /// \~english @param none
65 /// \~english @retval None
66 /// \~english @par Preconditions
68 /// \~english @par Change of the internal state
69 /// - Change of internal state according to the API does not occur.
70 /// \~english @par Causes of failures
72 /// \~english @par Classification
74 /// \~english @par Type
76 /// \~english @par Detail
77 /// Constructor of IConfigReader class.
78 /// \~english @see ~IConfigReader
79 ////////////////////////////////////////////////////////////////////////////////////
82 /////////////////////////////////////////////////////////////////////////////////////
83 /// \ingroup IConfigReader
84 /// \~english @par Summary
85 /// Destructor of IConfigReader class.
86 /// \~english @param None
87 /// \~english @retval None
88 /// \~english @par Preconditions
90 /// \~english @par Change of the internal state
91 /// - Change of internal state according to the API does not occur.
92 /// \~english @par Causes of failures
94 /// \~english @par Classification
96 /// \~english @par Type
98 /// \~english @par Detail
99 /// To delete a IConfigReader class.
100 /// \~english @see IConfigReader
101 ////////////////////////////////////////////////////////////////////////////////////
102 virtual ~IConfigReader();
104 /////////////////////////////////////////////////////////////////////////////////////
105 /// \ingroup IConfigReader
106 /// \~english @par Summary
107 /// This function is used to parse the file.
108 /// \~english @param [IN] f_c_filepath
109 /// const std::string - path of file to parse.
110 /// \~english @retval EFrameworkunifiedStatus
111 /// \~english @par Preconditions
113 /// \~english @par Change of the internal state
114 /// - Change of internal state according to the API does not occur.
115 /// \~english @par Causes of failures
117 /// \~english @par Classification
119 /// \~english @par Type
121 /// \~english @par Detail
122 /// This function is used to parse the file.\n
123 /// This is abstract function.
124 /// \~english @see IConfigReader
125 ////////////////////////////////////////////////////////////////////////////////////
126 virtual EFrameworkunifiedStatus ParseFile(const std::string &f_c_filepath) = 0;
128 /////////////////////////////////////////////////////////////////////////////////////
129 /// \ingroup IConfigReader
130 /// \~english @par Summary
131 /// This function is used to get the value associated with the key.
132 /// \~english @param [IN] f_c_key
133 /// const std::string - key to search.
134 /// \~english @retval l_cValue value for key
135 /// \~english @par Preconditions
137 /// \~english @par Change of the internal state
138 /// - Change of internal state according to the API does not occur.
139 /// \~english @par Causes of failures
141 /// \~english @par Classification
143 /// \~english @par Type
145 /// \~english @par Detail
146 /// This function is used to get the value associated with the key.\n
147 /// This is abstract function.
148 /// \~english @see IConfigReader
149 ////////////////////////////////////////////////////////////////////////////////////
150 virtual std::string GetValue(const std::string &f_c_key) = 0;
152 /////////////////////////////////////////////////////////////////////////////////////
153 /// \ingroup IConfigReader
154 /// \~english @par Summary
155 /// This function is used to get the value associated with the key.
156 /// \~english @param [IN] f_c_key
157 /// const std::string - key to search.
158 /// \~english @param [OUT] f_c_value
159 /// const std::string - value for key.
160 /// \~english @retval EFrameworkunifiedStatus error error if key not found else eFrameworkunifiedStatusOK
161 /// \~english @par Preconditions
163 /// \~english @par Change of the internal state
164 /// - Change of internal state according to the API does not occur.
165 /// \~english @par Causes of failures
167 /// \~english @par Classification
169 /// \~english @par Type
171 /// \~english @par Detail
172 /// This function is used to get the value associated with the key.\n
173 /// This is abstract function.
174 /// \~english @see IConfigReader
175 ////////////////////////////////////////////////////////////////////////////////////
176 virtual EFrameworkunifiedStatus GetValue(const std::string &f_c_key, std::string &f_c_value) = 0; // NOLINT (readability/nolint)
178 /////////////////////////////////////////////////////////////////////////////////////
179 /// \ingroup IConfigReader
180 /// \~english @par Summary
181 /// This function is used to get the data pointer.
182 /// \~english @param none.
183 /// \~english @retval PVOID - pointer of data structure
184 /// \~english @par Preconditions
186 /// \~english @par Change of the internal state
187 /// - Change of internal state according to the API does not occur.
188 /// \~english @par Causes of failures
190 /// \~english @par Classification
192 /// \~english @par Type
194 /// \~english @par Detail
195 /// This function is used to get the data pointer. This pointer is then set in config writer.\n
196 /// This is needed to avoid recreation of same data structure object in both reader and writer.\n
197 /// when we create object of NSConfigParser.
198 /// This is abstract function.
199 /// \~english @see IConfigReader
200 ////////////////////////////////////////////////////////////////////////////////////
201 virtual PVOID GetDataPtr() = 0;
204 #endif /* __FRAMEWORKUNIFIED_NATIVESERVICES_NSCONFIGPARSER_INC_CONFIG_READER_H__ */ // NOLINT (build/header_guard)
205 /** @}*/ // end of framework_unified
206 /** @}*/ // end of native_service
207 /** @}*/ // end of BaseSystem