TrinityCore
Loading...
Searching...
No Matches
loadlib.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef LOAD_LIB_H
19#define LOAD_LIB_H
20
21#include "Define.h"
22
23#define FILE_FORMAT_VERSION 18
24
25#pragma pack(push, 1)
26
27//
28// File version chunk
29//
30struct file_MVER
31{
32 union{
33 uint32 fcc;
34 char fcc_txt[4];
35 };
37 uint32 ver;
38};
39
40class FileLoader{
41 uint8 *data;
43public:
44 virtual bool prepareLoadedData();
45 uint8 *GetData() {return data;}
47
51 bool loadFile(char *filename, bool log = true);
52 virtual void free();
53};
54
55#pragma pack(pop)
56
57#endif
uint8_t uint8
Definition Define.h:135
uint32_t uint32
Definition Define.h:133
uint32 GetDataSize()
Definition loadlib.h:46
uint32 data_size
Definition loadlib.h:50
file_MVER * version
Definition loadlib.h:56
virtual bool prepareLoadedData()
bool loadFile(char *filename, bool log=true)
uint8 * GetData()
Definition loadlib.h:45
virtual void free()
uint8 * data
Definition loadlib.h:49
uint32 size
Definition loadlib.h:44
char fcc_txt[4]
Definition loadlib.h:42
uint32 ver
Definition loadlib.h:45
uint32 fcc
Definition loadlib.h:41