V-Gears 0
Free Final Fantasy VII engine.
LzsFile.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 The V-Gears Team
3 *
4 * This file is part of V-Gears
5 *
6 * V-Gears is free software: you can redistribute it and/or modify it under
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, version 3.0 (GPLv3) of the License.
9 *
10 * V-Gears is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#pragma once
17
18#include <vector>
19#include "common/File.h"
20#include "common/TypeDefine.h"
21
28class LzsFile : public File{
29
30 public:
31
37 LzsFile(const Ogre::String& file);
38
44 LzsFile(File* file);
45
54 LzsFile(File* file, u32 offset, u32 length);
55
64 LzsFile(const u8* buffer, u32 offset, u32 length);
65
69 virtual ~LzsFile();
70
71 private:
72
76 void ExtractLzs();
77
78 friend class LzsBuffer;
79};
80
85
86 public:
87
91 LzsBuffer() = delete;
92
99 static std::vector<VGears::uint8> Decompress(
100 const std::vector<VGears::uint8>& buffer
101 );
102};
Ogre::uint32 u32
Definition: TypeDefine.h:23
Ogre::uint8 u8
Definition: TypeDefine.h:21
Represents a file.
Definition: File.h:24
A buffer forr the contents of a lzs file.
Definition: LzsFile.h:84
static std::vector< VGears::uint8 > Decompress(const std::vector< VGears::uint8 > &buffer)
Decompresses lzs data in a buffer.
Definition: LzsFile.cpp:99
LzsBuffer()=delete
No costructor.
Represents an LZS file.
Definition: LzsFile.h:28
void ExtractLzs()
Extracts the file contents to the buffer.
Definition: LzsFile.cpp:41
virtual ~LzsFile()
Destructor.
Definition: LzsFile.cpp:39
LzsFile(const Ogre::String &file)
Opens a lzs file and extracts it's contents.
Definition: LzsFile.cpp:19
Ogre::String String
Definition: TypeDefine.h:37