2 * \file NeLResourceProvider.h
4 * \author Matt Raykowski
8 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
9 // Copyright (C) 2010 Winch Gate Property Limited
11 // This program is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU Affero General Public License as
13 // published by the Free Software Foundation, either version 3 of the
14 // License, or (at your option) any later version.
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU Affero General Public License for more details.
21 // You should have received a copy of the GNU Affero General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
25 /************************************************************************
26 purpose: Interface for main Nevrax Engine GUI renderer class
28 For use with GUI Library:
29 Crazy Eddie's GUI System (http://crayzedsgui.sourceforge.net)
30 Copyright (C)2004 Paul D Turner (crayzed@users.sourceforge.net)
32 This file contains code that is specific to NeL (http://www.nevrax.org)
33 *************************************************************************/
45 #include <nel/cegui/nelresourceprovider.h>
46 #include "CEGUIExceptions.h"
47 #include "CEGUILogger.h"
51 #include <nel/misc/file.h>
52 #include <nel/misc/path.h>
53 #include <nel/misc/debug.h>
54 #include <nel/misc/mem_stream.h>
56 // Start of CEGUI namespace section
59 NeLResourceProvider::NeLResourceProvider()
61 ; // nothing to be done here.
64 NeLResourceProvider::~NeLResourceProvider()
66 ; // nothing to be done here.
69 void NeLResourceProvider::loadRawDataContainer(const String
&filename
, RawDataContainer
&output
, const String
& resourceGroup
)
71 if(!NLMISC::CPath::exists(filename
.c_str()))
73 nlinfo("Scheme::Scheme - Filename supplied for Scheme loading must be valid [%s]",filename
.c_str());
74 String sMsg
=(utf8
*)"Scheme::Scheme - Filename supplied for Scheme loading must be valid";
75 sMsg
+=(utf8
*)" ["+filename
+(utf8
*)"]";
76 throw InvalidRequestException(sMsg
);
80 std::string fname
=NLMISC::CPath::lookup(filename
.c_str());
81 NLMISC::CIFile
f(NLMISC::CPath::lookup(filename
.c_str()));
83 // get the size of the file and create a temp container.
84 input_size
=f
.getFileSize();
85 uint8
*input
=new uint8
[input_size
+1];
87 f
.serialBuffer(input
,input_size
);
90 output
.setData(input
);
91 output
.setSize(input_size
);
93 }; // end namespace CEGUI