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

resourcetype_integer.cpp

Go to the documentation of this file.
00001 /*
00002         $Id: resourcetype_integer.cpp,v 1.1.1.1 2000/04/09 12:18:01 mbn 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         File purpose:
00015                 Integer resource type
00016 
00017 */
00018 
00019 #include "Core/precomp.h"
00020 #include <API/Core/Resources/resourcetype_integer.h>
00021 
00022 CL_Res_Integer::CL_Res_Integer() : CL_ResourceType("integer")
00023 {
00024 }
00025 
00026 CL_Resource *CL_Res_Integer::create_from_location(
00027         std::string name,
00028         std::string location,
00029         CL_ResourceOptions *options,
00030         CL_ResourceManager *parent)
00031 {
00032         return new CL_IntegerResource(name, location, options, parent);
00033 }
00034 
00035 CL_Resource *CL_Res_Integer::create_from_serialization(
00036         std::string name,
00037         CL_ResourceManager *parent)
00038 {
00039         return new CL_IntegerResource(name, parent);
00040 }
00041 
00042 int CL_Res_Integer::load(
00043         std::string name,
00044         CL_ResourceManager *manager,
00045         int _default)
00046 {
00047         try
00048         {
00049                 CL_IntegerResource *res = (CL_IntegerResource *) manager->get_resource(name);
00050                 return res->get_value();
00051         }
00052         catch (CL_Error err)
00053         {
00054                 return _default;
00055         }
00056 }
00057 
00058 int CL_Res_Integer::load(
00059         std::string name,
00060         CL_ResourceManager *manager)
00061 {
00062         CL_IntegerResource *res = (CL_IntegerResource *) manager->get_resource(name);
00063         return res->get_value();
00064 }

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