FIFE 2008.0
dat1.h
00001 /***************************************************************************
00002  *   Copyright (C) 2005-2008 by the FIFE team                              *
00003  *   http://www.fifengine.de                                               *
00004  *   This file is part of FIFE.                                            *
00005  *                                                                         *
00006  *   FIFE is free software; you can redistribute it and/or                 *
00007  *   modify it under the terms of the GNU Lesser General Public            *
00008  *   License as published by the Free Software Foundation; either          *
00009  *   version 2.1 of the License, or (at your option) any later version.    *
00010  *                                                                         *
00011  *   This library is distributed in the hope that it will be useful,       *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00014  *   Lesser General Public License for more details.                       *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Lesser General Public      *
00017  *   License along with this library; if not, write to the                 *
00018  *   Free Software Foundation, Inc.,                                       *
00019  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
00020  ***************************************************************************/
00021 
00022 #ifndef FIFE_MAP_LOADERS_FALLOUT_DAT1_H
00023 #define FIFE_MAP_LOADERS_FALLOUT_DAT1_H
00024 
00025 // Standard C++ library includes
00026 #include <map>
00027 #include <boost/scoped_ptr.hpp>
00028 
00029 // 3rd party library includes
00030 
00031 // FIFE includes
00032 // These includes are split up in two parts, separated by one empty line
00033 // First block: files included from the FIFE root src directory
00034 // Second block: files included from the same folder
00035 #include "vfs/vfs.h"
00036 #include "vfs/vfssource.h"
00037 
00038 #include "rawdatadat1.h"
00039 
00040 namespace FIFE {
00041 
00044     class DAT1 : public VFSSource {
00045         public:
00050             DAT1(VFS* vfs, const std::string& file);
00051 
00052             bool fileExists(const std::string& name) const;
00053             RawData* open(const std::string& file) const;
00054 
00064             const RawDataDAT1::s_info& getInfo(const std::string& name) const;
00065 
00066             std::set<std::string> listFiles(const std::string& pathstr) const;
00067             std::set<std::string> listDirectories(const std::string& pathstr) const;
00068 
00069         private:
00070             std::string m_datpath;
00071             boost::scoped_ptr<RawData> m_data;
00072             typedef std::map<std::string, RawDataDAT1::s_info> type_filelist;
00073             type_filelist m_filelist;
00074 
00075             std::set<std::string> list(const std::string& pathstr, bool dirs) const;
00076             std::string readString();
00077 
00078             void loadFileList(const std::string& dirname);
00079 
00080             // Not copyable
00081             DAT1(const DAT1&);
00082             DAT1& operator=(const DAT1&);
00083     };
00084 
00085 } // FIFE
00086 
00087 #endif
 All Classes Namespaces Functions Variables Enumerations Enumerator