Debian Codegraph @

include/control.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2002-2010 The DOSBox Team
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18
19 /* $Id: control.h,v 1.2 2009-05-27 09:15:40 qbix79 Exp $ */
20
21 #ifndef DOSBOX_CONTROL_H
22 #define DOSBOX_CONTROL_H
23
24 #ifdef _MSC_VER
25 #pragma warning ( disable : 4786 )
26 #pragma warning ( disable : 4290 )
27 #endif
28
29 #ifndef DOSBOX_PROGRAMS_H
30 #include "programs.h"
31 #endif
32 #ifndef DOSBOX_SETUP_H
33 #include "setup.h"
34 #endif
35
36 #ifndef CH_LIST
37 #define CH_LIST
38 #include <list>
39 #endif
40
41 #ifndef CH_VECTOR
42 #define CH_VECTOR
43 #include <vector>
44 #endif
45
46 #ifndef CH_STRING
47 #define CH_STRING
48 #include <string>
49 #endif
50
51
52
53
54 class Config{
55 public:
56 CommandLine * cmdline;
57 private:
58 std::list<Section*> sectionlist;
59 typedef std::list<Section*>::iterator it;
60 typedef std::list<Section*>::reverse_iterator reverse_it;
61 typedef std::list<Section*>::const_iterator const_it;
62 typedef std::list<Section*>::const_reverse_iterator const_reverse_it;
63 void (* _start_function)(void);
64 bool secure_mode; //Sandbox mode
65 public:
66 Config(CommandLine * cmd):cmdline(cmd),secure_mode(false){}
67 ~Config();
68
69 Section_line * AddSection_line(char const * const _name,void (*_initfunction)(Section*));
70 Section_prop * AddSection_prop(char const * const _name,void (*_initfunction)(Section*),bool canchange=false);
71
72 Section* GetSection(int index);
73 Section* GetSection(std::string const&_sectionname) const;
74 Section* GetSectionFromProperty(char const * const prop) const;
75
76 void SetStartUp(void (*_function)(void));
77 void Init();
78 void ShutDown();
79 void StartUp();
80 bool PrintConfig(char const * const configfilename) const;
81 bool ParseConfigFile(char const * const configfilename);
82 void ParseEnv(char ** envp);
83 bool SecureMode() const { return secure_mode; }
84 void SwitchToSecureMode() { secure_mode = true; }//can't be undone
85 };
86
87 #endif