1
0

Plugins can now be enabled and disabled through WebAdmin

WebPlugins can now have spaces in their tab names

git-svn-id: http://mc-server.googlecode.com/svn/trunk@204 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
faketruth
2012-02-01 00:02:48 +00:00
parent 968f41ba51
commit 28bc14e267
9 changed files with 92 additions and 42 deletions

View File

@@ -342,6 +342,20 @@ unsigned cIniFile::GetValueV( const string & keyname, const string & valuename,
return nVals;
}
bool cIniFile::DeleteValueByID( const unsigned keyID, const unsigned valueID )
{
if ( keyID < keys.size() && valueID < keys[keyID].names.size())
{
// This looks strange, but is neccessary.
vector<string>::iterator npos = keys[keyID].names.begin() + valueID;
vector<string>::iterator vpos = keys[keyID].values.begin() + valueID;
keys[keyID].names.erase( npos, npos + 1);
keys[keyID].values.erase( vpos, vpos + 1);
return true;
}
return false;
}
bool cIniFile::DeleteValue( const string & keyname, const string & valuename)
{
long keyID = FindKey( keyname);
@@ -352,13 +366,7 @@ bool cIniFile::DeleteValue( const string & keyname, const string & valuename)
if ( valueID == noID)
return false;
// This looks strange, but is neccessary.
vector<string>::iterator npos = keys[keyID].names.begin() + valueID;
vector<string>::iterator vpos = keys[keyID].values.begin() + valueID;
keys[keyID].names.erase( npos, npos + 1);
keys[keyID].values.erase( vpos, vpos + 1);
return true;
return DeleteValueByID( keyID, valueID );
}
bool cIniFile::DeleteKey( const string & keyname)