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 IConfigWriter.
21 ////////////////////////////////////////////////////////////////////////////////////////////////////
25 * @brief \~english This file contains declaration of class IConfigWriter.
27 /** @addtogroup BaseSystem
30 /** @addtogroup native_service
34 /** @addtogroup framework_unified
35 * @ingroup native_service
39 #ifndef __FRAMEWORKUNIFIED_NATIVESERVICES_NSCONFIGPARSER_INC_CONFIG_WRITER_H__ // NOLINT (build/header_guard)
40 #define __FRAMEWORKUNIFIED_NATIVESERVICES_NSCONFIGPARSER_INC_CONFIG_WRITER_H__ // NOLINT(build/header_guard)
42 ////////////////////////////////////////////////////////////////////////////////////////////////////
44 ////////////////////////////////////////////////////////////////////////////////////////////////////
45 #include <native_service/frameworkunified_types.h> // NOLINT(build/header_guard)
50 * @class IConfigWriter
51 * \~english @brief Config writer abstract class.
52 * \~english @par Brief Introduction
53 * IConfigWriter is an abstract class which is inherited by\n
54 * different type configuration file writer class.
59 /////////////////////////////////////////////////////////////////////////////////////
60 /// \ingroup IConfigWriter
61 /// \~english @par Brief
62 /// Constructor of IConfigWriter class
63 /// \~english @param None
64 /// \~english @retval none
65 /// \~english @par Preconditons
67 /// \~english @par Change of internal status
69 /// \~english @par Conditions of processing failure
71 /// \~english @par Detail
72 /// - To get a instance of this class.
73 /// \~english @par Classification
75 /// \~english @par Type
77 /// \~english @see ~IConfigWriter
78 ////////////////////////////////////////////////////////////////////////////////////
81 /////////////////////////////////////////////////////////////////////////////////////
82 /// \ingroup ~IConfigWriter
83 /// \~english @par Brief
84 /// Destructor of IConfigWriter class
85 /// \~english @param None
86 /// \~english @retval none
87 /// \~english @par Preconditons
88 /// - Calls constructor to successfully create object.
89 /// \~english @par Change of internal status
91 /// \~english @par Conditions of processing failure
93 /// \~english @par Detail
94 /// - Destruct the object of this class.
95 /// \~english @par Classification
97 /// \~english @par Type
99 /// \~english @see IConfigWriter
100 ////////////////////////////////////////////////////////////////////////////////////
101 virtual ~IConfigWriter();
103 /////////////////////////////////////////////////////////////////////////////////////
104 /// \ingroup IConfigWriter
105 /// \~english @par Brief
106 /// This function is used to parse the file.
107 /// \~english @param [in] f_c_filepath
108 /// std::string - path of file to parse
109 /// \~english @retval EFrameworkunifiedStatus - success or failure
110 /// \~english @par Preconditons
111 /// - Calls constructor to successfully create object.
112 /// \~english @par Change of internal status
114 /// \~english @par Conditions of processing failure
116 /// \~english @par Detail
117 /// This function is used to parse the file.
118 /// \~english @par Classification
120 /// \~english @par Type
122 /// \~english @see None
123 ////////////////////////////////////////////////////////////////////////////////////
124 virtual EFrameworkunifiedStatus ParseFile(const std::string &f_c_filepath) = 0;
126 /////////////////////////////////////////////////////////////////////////////////////
127 /// \ingroup IConfigWriter
128 /// \~english @par Brief
129 /// This function is used to set the value for the key
130 /// \~english @param [in] f_c_key
131 /// std::string - key to search
132 /// \~english @param [in] f_c_value
133 /// std::string - value to set
134 /// \~english @retval EFrameworkunifiedStatus - error if key not found else eFrameworkunifiedStatusOK
135 /// \~english @par Preconditons
136 /// - Calls constructor to successfully create object.
137 /// \~english @par Change of internal status
139 /// \~english @par Conditions of processing failure
141 /// \~english @par Detail
142 /// This function is used to set the value for the key
143 /// \~english @par Classification
145 /// \~english @par Type
147 /// \~english @see None
148 ////////////////////////////////////////////////////////////////////////////////////
149 virtual EFrameworkunifiedStatus SetValue(const std::string &f_c_key, std::string f_c_value) = 0;
151 /////////////////////////////////////////////////////////////////////////////////////
152 /// \ingroup IConfigWriter
153 /// \~english @par Brief
154 /// This function is used to save the changed value permanently to the config source
155 /// \~english @param None
156 /// \~english @retval none
157 /// \~english @par Preconditons
159 /// \~english @par Change of internal status
161 /// \~english @par Conditions of processing failure
163 /// \~english @par Detail
164 /// This function is used to save the changed value permanently to the config source
165 /// \~english @par Classification
167 /// \~english @par Type
169 /// \~english @see None
170 ////////////////////////////////////////////////////////////////////////////////////
171 virtual EFrameworkunifiedStatus SaveData() = 0;
173 /////////////////////////////////////////////////////////////////////////////////////
174 /// \ingroup IConfigWriter
175 /// \~english @par Brief
176 /// This function is used to set the config file path
177 /// \~english @param [in] f_cpath
178 /// std::string - Path of file
179 /// \~english @retval EFrameworkunifiedStatus - success or failure
180 /// \~english @par Preconditons
182 /// \~english @par Change of internal status
184 /// \~english @par Conditions of processing failure
186 /// \~english @par Detail
187 /// This function is used to set the config file path
188 /// \~english @par Classification
190 /// \~english @par Type
192 /// \~english @see None
193 ////////////////////////////////////////////////////////////////////////////////////
194 virtual EFrameworkunifiedStatus SetPath(const std::string &f_cpath) = 0;
196 /////////////////////////////////////////////////////////////////////////////////////
197 /// \ingroup IConfigWriter
198 /// \~english @par Brief
199 /// This function is used to set the data pointer in config writer class with data pointer\n
200 /// created in config reader class.\n
201 /// This is needed to avoid recreation of same data structure object in both reader and writer\n
202 /// when we create object of NSConfigParser.\n
203 /// \~english @param [in] f_pdata
204 /// PVOID - Pointer to data structure
205 /// \~english @retval None
206 /// \~english @par Preconditons
208 /// \~english @par Change of internal status
210 /// \~english @par Conditions of processing failure
212 /// \~english @par Detail
213 /// This function is used to set the data pointer in config writer class with data pointer\n
214 /// created in config reader class.\n
215 /// This is needed to avoid recreation of same data structure object in both reader and writer\n
216 /// when we create object of NSConfigParser.\n
217 /// \~english @par Classification
219 /// \~english @par Type
221 /// \~english @see None
222 ////////////////////////////////////////////////////////////////////////////////////
223 virtual VOID SetDataPtr(PVOID f_pdata) = 0;
226 #endif /* __FRAMEWORKUNIFIED_NATIVESERVICES_NSCONFIGPARSER_INC_CONFIG_WRITER_H__ */ // NOLINT (build/header_guard)
227 /** @}*/ // end of framework_unified
228 /** @}*/ // end of native_service
229 /** @}*/ // end of BaseSystem