TrinityCore
Loading...
Searching...
No Matches
cascfile.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 MPQ_H
19
#define MPQ_H
20
21
#include "
CascHandles.h
"
22
#include <memory>
23
#include <string>
24
25
class
CASCFile
26
{
27
bool
eof
;
28
char
*
buffer
;
29
size_t
pointer
,
size
;
30
31
// disable copying
32
CASCFile
(
const
CASCFile
&f) =
delete
;
33
CASCFile
&
operator=
(
const
CASCFile
&f) =
delete
;
34
35
public
:
36
CASCFile
(std::shared_ptr<CASC::Storage const> casc,
const
char
* filename,
bool
warnNoExist =
true
);
// filenames are not case sensitive
37
CASCFile
(std::shared_ptr<CASC::Storage const> casc,
uint32
fileDataId, std::string
const
& description,
bool
warnNoExist =
true
);
38
~CASCFile
() {
close
(); }
39
void
init
(
CASC::File
* file,
const
char
* description);
40
size_t
read
(
void
* dest,
size_t
bytes);
41
size_t
getSize
() {
return
size
; }
42
size_t
getPos
() {
return
pointer
; }
43
char
*
getBuffer
() {
return
buffer
; }
44
char
*
getPointer
() {
return
buffer
+
pointer
; }
45
bool
isEof
() {
return
eof
; }
46
void
seek
(
int
offset);
47
void
seekRelative
(
int
offset);
48
void
close
();
49
};
50
51
#endif
CascHandles.h
uint32
uint32_t uint32
Definition
Define.h:154
CASCFile
Definition
cascfile.h:26
CASCFile::buffer
char * buffer
Definition
cascfile.h:28
CASCFile::~CASCFile
~CASCFile()
Definition
cascfile.h:38
CASCFile::eof
bool eof
Definition
cascfile.h:27
CASCFile::seekRelative
void seekRelative(int offset)
Definition
cascfile.cpp:105
CASCFile::isEof
bool isEof()
Definition
cascfile.h:45
CASCFile::CASCFile
CASCFile(const CASCFile &f)=delete
CASCFile::getPointer
char * getPointer()
Definition
cascfile.h:44
CASCFile::seek
void seek(int offset)
Definition
cascfile.cpp:99
CASCFile::size
size_t size
Definition
cascfile.h:29
CASCFile::read
size_t read(void *dest, size_t bytes)
Definition
cascfile.cpp:80
CASCFile::pointer
size_t pointer
Definition
cascfile.h:29
CASCFile::getPos
size_t getPos()
Definition
cascfile.h:42
CASCFile::getBuffer
char * getBuffer()
Definition
cascfile.h:43
CASCFile::operator=
CASCFile & operator=(const CASCFile &f)=delete
CASCFile::getSize
size_t getSize()
Definition
cascfile.h:41
CASCFile::init
void init(CASC::File *file, const char *description)
Definition
cascfile.cpp:58
CASCFile::close
void close()
Definition
cascfile.cpp:111
CASC::File
Definition
CascHandles.h:62
tools
vmap4_extractor
cascfile.h
Generated on Sun May 10 2026 02:09:16 for TrinityCore by
1.9.8