Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/libraries/core/config/ConfigFileEntry.h @ 10291

Last change on this file since 10291 was 9559, checked in by landauf, 12 years ago

split ConfigFileManager.h/cc into multiple files, one for each class. why did I ever put them all into the same file?

  • Property svn:eol-style set to native
File size: 2.4 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Fabian 'x3n' Landau
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29/**
30    @file
31    @ingroup Config ConfigFile
32*/
33
34#ifndef _ConfigFileEntry_H__
35#define _ConfigFileEntry_H__
36
37#include "core/CorePrereqs.h"
38
39namespace orxonox
40{
41    /////////////////////
42    // ConfigFileEntry //
43    /////////////////////
44    /**
45        @brief This class represents an entry in the config file.
46
47        This class is pure virtual. Use one of the derived classes to define the type of the entry.
48    */
49    class _CoreExport ConfigFileEntry
50    {
51        public:
52            /// Destructor
53            virtual ~ConfigFileEntry() {};
54
55            /// Changes the value of the entry.
56            virtual void setValue(const std::string& value) = 0;
57            /// Returns the value of the entry.
58            virtual const std::string& getValue() const = 0;
59
60            /// Returns the name of the entry
61            virtual const std::string& getName() const = 0;
62
63            /// Changes the comment of the entry (will be placed after the value)
64            virtual void setComment(const std::string& comment) = 0;
65
66            /// Returns the index of the entry in a vector (used only if it is a vector)
67            virtual unsigned int getIndex() const { return 0; }
68
69            /// Defines if this entry is treated as string which means some special treatment of special characters.
70            virtual void setString(bool bString) = 0;
71
72            /// Returns the line as it will be stored in the config file.
73            virtual const std::string& getFileEntry() const = 0;
74    };
75}
76
77#endif /* _ConfigFileEntry_H__ */
Note: See TracBrowser for help on using the repository browser.