// =============================================================================
// Zboard Config Utility
// Copyright (C) 2007  Matt Razza

// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.

// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
// -------------------------------------------------------------------------------
// This file manages settings files
// ===============================================================================

#pragma once
#include "zboard-inc.h"

class settingMan
{
	public:
		settingMan(std::string file); //Constructor
		~settingMan(void); //Destructor
		
		// ===================================================
		// General Functions
		// ===================================================
		std::string getSetting(std::string setting); //Returns the value of a given setting
		std::string getSettingNameByID(unsigned int id); //Returns the name of a setting by it's ID
		
	private:
		// ===================================================
		// Private Functions
		// ===================================================.
		std::string splitName(std::string sFull); //Gets the name of a given setting
		std::string splitValue(std::string sFull); //Gets the value of a given setting
		std::string getSubStr(std::string base, int start, int len); //Gets text from start to end of string base
		int getPosOf(std::string base, std::string what); //Gets the first occorence of "what" in "base"
		
		std::string sFile;
};
