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

resourcetype_string.cpp

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