comparison src/Support/Parameters.h @ 8:fcbf85ce59fb

- Lots of changes to make cpplint happy. It still complains about header guards, but that's pretty much it now.
author tomwalters
date Thu, 18 Feb 2010 21:12:41 +0000
parents bc394a985042
children bd370910aa05
comparison
equal deleted inserted replaced
7:1a1988ec40e7 8:fcbf85ce59fb
1 // Copyright 2006-2010, Willem van Engen 1 // Copyright 2006-2010, Willem van Engen, Thomas Walters
2 // 2 //
3 // AIM-C: A C++ implementation of the Auditory Image Model 3 // AIM-C: A C++ implementation of the Auditory Image Model
4 // http://www.acousticscale.org/AIMC 4 // http://www.acousticscale.org/AIMC
5 // 5 //
6 // This program is free software: you can redistribute it and/or modify 6 // This program is free software: you can redistribute it and/or modify
14 // GNU General Public License for more details. 14 // GNU General Public License for more details.
15 // 15 //
16 // You should have received a copy of the GNU General Public License 16 // You should have received a copy of the GNU General Public License
17 // along with this program. If not, see <http://www.gnu.org/licenses/>. 17 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 18
19 //! 19 /*!
20 //! \file 20 * \file
21 //! \brief Main parameters store 21 * \brief Main parameters store
22 //! 22 *
23 //! \author Willem van Engen <cnbh@willem.engen.nl> 23 * \author Willem van Engen <cnbh@willem.engen.nl>
24 //! \date created 2006/09/21 24 * \author Thomas Walters <tom@acousticscale.org>
25 //! \version \$Id: Parameters.h 4 2010-02-03 18:44:58Z tcw $ 25 * \date created 2006/09/21
26 * \version \$Id: Parameters.h 4 2010-02-03 18:44:58Z tcw $
27 */
26 28
27 #ifndef _AIMC_SUPPORT_PARAMETERS_H_ 29 #ifndef _AIMC_SUPPORT_PARAMETERS_H_
28 #define _AIMC_SUPPORT_PARAMETERS_H_ 30 #define _AIMC_SUPPORT_PARAMETERS_H_
29 31
30 #include <string> 32 #include <string>
31 33
32 // If not _WINDOWS, please compile in Support/ConvertUTF.c
33 #ifdef _UNICODE
34 // Here we want to use the ANSI version of all the non wxWidgets stuff, but
35 // convert stribngs to Unicode when used in wxWidgets. This allows all the
36 // string handling in the non-GUI version to use ANSI text only, but to pass
37 // unicode text to the GUI
38 #undef _UNICODE
39 #include "Support/SimpleIni.h" 34 #include "Support/SimpleIni.h"
40 #define _UNICODE
41 #else
42 #include "Support/SimpleIni.h"
43 #endif
44 35
45 namespace aimc { 36 namespace aimc {
46 /*! 37 /*!
47 * \class Parameters "Support/Parameters.h" 38 * \class Parameters "Support/Parameters.h"
48 * \brief Main parameter store for parameters 39 * \brief Main parameter store for parameters
49 */ 40 */
50 class Parameters { 41 class Parameters {
51 public: 42 public:
52 Parameters(); 43 Parameters();
53 ~Parameters(); 44 ~Parameters();
54 45
55 /*! 46 /*!
56 * \brief Load parameter file 47 * \brief Load parameter file
174 165
175 /*! \brief Append parameters to a string 166 /*! \brief Append parameters to a string
176 * \param sName pointer to a string 167 * \param sName pointer to a string
177 * \return true on success 168 * \return true on success
178 */ 169 */
179 std::string WriteString(); 170 std::string WriteString();
180 171
181 //! \brief Maximum length of a parameter name in characters 172 /*! \brief Maximum length of a parameter name in characters
173 */
182 static const unsigned int MaxParamNameLength = 128; 174 static const unsigned int MaxParamNameLength = 128;
183 175
184 protected: 176 protected:
185 /*! 177 /*!
186 * \brief Load parameter file 178 * \brief Load parameter file
187 * \param sParamFilename Filename of parameter file to read 179 * \param sParamFilename Filename of parameter file to read
188 * \return true on succes, false on error 180 * \return true on succes, false on error
189 */ 181 */
201 * Since SimpleIni is an ini-parser but we don't want the sections, 193 * Since SimpleIni is an ini-parser but we don't want the sections,
202 * we use the empty section. This gives use the behaviour desired. 194 * we use the empty section. This gives use the behaviour desired.
203 */ 195 */
204 static const char *m_SDefaultIniSection; 196 static const char *m_SDefaultIniSection;
205 197
206 //! \brief Parameter file object 198 /*! \brief Parameter file object
199 */
207 CSimpleIniCase *m_pIni; 200 CSimpleIniCase *m_pIni;
208 //! \brief \c preset.include nesting counter to avoid loops 201 /*! \brief \c preset.include nesting counter to avoid loops
202 */
209 unsigned int m_iNestCount; 203 unsigned int m_iNestCount;
210 //! \brief maximum value m_iNestCount may reach 204 /*! \brief maximum value m_iNestCount may reach
205 */
211 static const unsigned int m_iNestCountMaximum = 16; 206 static const unsigned int m_iNestCountMaximum = 16;
212 }; 207 };
213 } 208 }
214 209
215 #endif // _AIMC_SUPPORT_PARAMETERS_H_ 210 #endif // _AIMC_SUPPORT_PARAMETERS_H_