common_library: gettid is multiple declaration in cl_error
[staging/basesystem.git] / video_in_hal / nsframework / framework_unified / client / NS_ConfigParser / include / ns_cfg_reader.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  tag_NS_ConfigParser
19 /// \brief    This file contains declaration of class CCFGReader.
20 ///
21 ////////////////////////////////////////////////////////////////////////////////////////////////////
22
23 #ifndef FRAMEWORK_UNIFIED_CLIENT_NS_CONFIGPARSER_INCLUDE_NS_CFG_READER_H_
24 #define FRAMEWORK_UNIFIED_CLIENT_NS_CONFIGPARSER_INCLUDE_NS_CFG_READER_H_
25
26 ////////////////////////////////////////////////////////////////////////////////////////////////////
27 // Include Files
28 ////////////////////////////////////////////////////////////////////////////////////////////////////
29 #include <native_service/ns_reader.h>
30 #include <string>
31
32 class CCFGParser;
33
34 /*
35  * This class provides functionalities to read from CFG config file
36  */
37 class CCFGReader: public IConfigReader {
38  public:
39   ////////////////////////////////////////////////////////////////////////////////////////////////
40   /// CCFGReader
41   /// Constructor of CCFGReader class
42   ///
43   /// \param
44   ///
45   /// \return
46   ///
47   ////////////////////////////////////////////////////////////////////////////////////////////////
48   CCFGReader();
49
50   ////////////////////////////////////////////////////////////////////////////////////////////////
51   /// CCFGReader
52   /// Constructor of CCFGReader class
53   ///
54   /// \param  [IN] f_c_filepath
55   ///     std::string - Full path of the configuration file
56   ///
57   /// \return
58   ///
59   ////////////////////////////////////////////////////////////////////////////////////////////////
60   explicit CCFGReader(const std::string &f_c_filepath);
61
62   ////////////////////////////////////////////////////////////////////////////////////////////////
63   /// ~CCFGReader
64   /// Destructor of CCFGReader class
65   ///
66   /// \param
67   ///
68   /// \return
69   ///
70   ////////////////////////////////////////////////////////////////////////////////////////////////
71   ~CCFGReader();
72
73   ////////////////////////////////////////////////////////////////////////////////////////////////
74   /// ParseFile
75   /// This function is used to parse the file
76   ///
77   /// \param  [IN] f_c_filepath
78   ///     std::string - path of file to parse
79   ///
80   /// \return EFrameworkunifiedStatus - success or failure
81   ///
82   ////////////////////////////////////////////////////////////////////////////////////////////////
83   EFrameworkunifiedStatus ParseFile(const std::string &f_c_filepath);
84
85   ////////////////////////////////////////////////////////////////////////////////////////////////
86   /// GetString
87   /// This function is used to get the value associated with the key
88   ///
89   /// \param  [IN] f_c_key
90   ///     std::string - key to search
91   ///
92   /// \return std::string - value for key
93   ///
94   ////////////////////////////////////////////////////////////////////////////////////////////////
95   std::string GetValue(const std::string &f_c_key);
96
97   ////////////////////////////////////////////////////////////////////////////////////////////////
98   /// GetString
99   /// This function is used to get the value associated with the key
100   ///
101   /// \param  [IN] f_c_key
102   ///     std::string - key to search
103   /// \param  [REF] f_c_value
104   ///     std::string - Value of key
105   ///
106   /// \return EFrameworkunifiedStatus
107   ///     EFrameworkunifiedStatus - error if key not found else eFrameworkunifiedStatusOK
108   ///
109   ////////////////////////////////////////////////////////////////////////////////////////////////
110   EFrameworkunifiedStatus GetValue(const std::string &f_c_key, std::string &f_c_value);  // NOLINT (readability/nolint)
111
112   ////////////////////////////////////////////////////////////////////////////////////////////////
113   /// GetDataPtr
114   /// This function is used to get the data pointer. This pointer is then set in config writer.
115   /// This is needed to avoid recreation of same data structure object in both reader and writer
116   /// when we create object of NSConfigParser.
117   ///
118   /// \param
119   ///
120   /// \return PVOID - pointer of data structure
121   ///
122   ////////////////////////////////////////////////////////////////////////////////////////////////
123   PVOID GetDataPtr();
124
125  private:
126   // path of config file
127   std::string m_cFilePath;
128
129   // CFG file parser object
130   CCFGParser *m_pCFGParser;
131 };
132
133 #endif  // FRAMEWORK_UNIFIED_CLIENT_NS_CONFIGPARSER_INCLUDE_NS_CFG_READER_H_