mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-23 02:07:45 +00:00

- Refactored datReader and several other files for code cleanliness - Enhanced runtime performance by optimizing select functions, utilizing std::string_view in place of std::string where appropriate - Removed deprecated filesystem implementation - Introduced Link Time Optimization (LTO) support for Linux builds - Enabled parallel builds for GCC/Clang compilers - Expanded and improved comments for various functions - Replaced version check failure with warning, allowing for continued use with a cautionary message Tested on MSVC/Windows and Clang/Ubuntu
52 lines
1.1 KiB
C++
52 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <vector>
|
|
|
|
#include <filesystem>
|
|
#include <stdint.h>
|
|
#include "bparse.h"
|
|
|
|
namespace xiv::dat
|
|
{
|
|
enum class FileType :
|
|
uint32_t
|
|
{
|
|
empty = 1,
|
|
standard = 2,
|
|
model = 3,
|
|
texture = 4,
|
|
};
|
|
|
|
class Dat;
|
|
|
|
// Basic file from the dats
|
|
class File
|
|
{
|
|
friend class Dat;
|
|
|
|
public:
|
|
File();
|
|
|
|
~File() = default;
|
|
|
|
// Returns the file type of the File object
|
|
FileType get_type() const;
|
|
|
|
// Returns a const reference to the data sections in the File object
|
|
const std::vector< std::vector< char > >& get_data_sections() const;
|
|
|
|
// Returns a reference to the data sections in the File object
|
|
std::vector< std::vector< char > >& access_data_sections();
|
|
|
|
// Exports the content of the File object to a file on disk at the given path
|
|
void exportToFile( const std::filesystem::path& i_path ) const;
|
|
|
|
protected:
|
|
// Stores the file type of the File object
|
|
FileType _type;
|
|
|
|
// Stores the data sections of the File object as a vector of vectors of chars
|
|
std::vector< std::vector< char > > _data_sections;
|
|
};
|
|
}// namespace xiv::dat
|
|
|