Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

resourceoptions.cpp

Go to the documentation of this file.
00001 /*
00002         $Id: resourceoptions.cpp,v 1.2 2000/11/21 15:06:00 sphair Exp $
00003 
00004         ------------------------------------------------------------------------
00005         ClanLib, the platform independent game SDK.
00006 
00007         This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00008         version 2. See COPYING for details.
00009 
00010         For a total list of contributers see CREDITS.
00011 
00012         ------------------------------------------------------------------------
00013 */
00014 
00015 #include "Core/precomp.h"
00016 
00017 #include <API/Core/Resources/resource_manager.h>
00018 #include <API/Core/Resources/resourceoption.h>
00019 #include <API/Core/Resources/resourceoptions.h>
00020 
00021 CL_ResourceOptions::CL_ResourceOptions(CL_ResourceManager *_parent)
00022 {
00023         parent = _parent;
00024 }
00025 
00026 CL_ResourceOptions::~CL_ResourceOptions()
00027 {
00028         for (
00029                 std::list<CL_ResourceOption*>::iterator it = options.begin();
00030                 it != options.end();
00031                 it++)
00032         {
00033                 delete (*it);
00034         }
00035 }
00036 
00037 void CL_ResourceOptions::add(CL_ResourceOption *option)
00038 {
00039         options.push_back(option);
00040 }
00041 
00042 bool CL_ResourceOptions::exists(std::string option)
00043 {
00044 //      option.to_lower();
00045 
00046         for (
00047                 std::list<CL_ResourceOption*>::iterator it = options.begin();
00048                 it != options.end();
00049                 it++)
00050         {
00051                 if ((*it)->get_name() == option) return true;
00052         }
00053         return false;
00054 }
00055 
00056 std::string CL_ResourceOptions::get_value(std::string option)
00057 {
00058 //      option.to_lower();
00059 
00060         for (
00061                 std::list<CL_ResourceOption*>::iterator it = options.begin();
00062                 it != options.end();
00063                 it++)
00064         {
00065                 if ((*it)->get_name() == option) return (*it)->get_value();
00066         }
00067         return "";
00068 }
00069 
00070 CL_ResourceOption *CL_ResourceOptions::get_option(std::string option)
00071 {
00072 //      option.to_lower();
00073 
00074         for (
00075                 std::list<CL_ResourceOption*>::iterator it = options.begin();
00076                 it != options.end();
00077                 it++)
00078         {
00079                 if ((*it)->get_name() == option) return (*it);
00080         }
00081         return NULL;
00082 }
00083 
00084 std::list<CL_ResourceOption*> *CL_ResourceOptions::get_options() 
00085 {
00086         return &options;
00087 }

Generated at Wed Apr 4 19:54:03 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001