Add function to list all configuration details. (moe)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3024
This commit is contained in:
parent
de72a62e4a
commit
2f33a0fd24
2 changed files with 18 additions and 2 deletions
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: setup.h,v 1.27 2007-06-14 08:23:46 qbix79 Exp $ */
|
||||
/* $Id: setup.h,v 1.28 2007-10-21 08:43:24 qbix79 Exp $ */
|
||||
|
||||
#ifndef DOSBOX_SETUP_H
|
||||
#define DOSBOX_SETUP_H
|
||||
|
@ -168,6 +168,7 @@ public:
|
|||
void Add_hex(char const * const _propname, int _value=0);
|
||||
void Add_float(char const * const _propname, float _value=0.0);
|
||||
|
||||
Property* Get_prop(int index);
|
||||
int Get_int(char const * const _propname) const;
|
||||
const char* Get_string(char const * const _propname) const;
|
||||
bool Get_bool(char const * const _propname) const;
|
||||
|
@ -207,6 +208,7 @@ public:
|
|||
Section_line * AddSection_line(char const * const _name,void (*_initfunction)(Section*));
|
||||
Section_prop * AddSection_prop(char const * const _name,void (*_initfunction)(Section*),bool canchange=false);
|
||||
|
||||
Section* GetSection(int index);
|
||||
Section* GetSection(char const* const _sectionname) const;
|
||||
Section* GetSectionFromProperty(char const * const prop) const;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: setup.cpp,v 1.40 2007-06-27 14:51:30 qbix79 Exp $ */
|
||||
/* $Id: setup.cpp,v 1.41 2007-10-21 08:43:24 qbix79 Exp $ */
|
||||
|
||||
#include "dosbox.h"
|
||||
#include "cross.h"
|
||||
|
@ -129,6 +129,13 @@ float Section_prop::Get_float(char const * const _propname) const {
|
|||
return false;
|
||||
}
|
||||
|
||||
Property* Section_prop::Get_prop(int index){
|
||||
for(it tel=properties.begin();tel!=properties.end();tel++){
|
||||
if(!index--) return (*tel);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char* Section_prop::Get_string(char const * const _propname) const {
|
||||
for(const_it tel=properties.begin();tel!=properties.end();tel++){
|
||||
if((*tel)->propname==_propname){
|
||||
|
@ -290,6 +297,13 @@ Config::~Config() {
|
|||
}
|
||||
}
|
||||
|
||||
Section* Config::GetSection(int index){
|
||||
for (it tel=sectionlist.begin(); tel!=sectionlist.end(); tel++){
|
||||
if (!index--) return (*tel);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Section* Config::GetSection(char const * const _sectionname) const{
|
||||
for (const_it tel=sectionlist.begin(); tel!=sectionlist.end(); tel++){
|
||||
if (!strcasecmp((*tel)->GetName(),_sectionname)) return (*tel);
|
||||
|
|
Loading…
Add table
Reference in a new issue