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
18 lines
470 B
C++
18 lines
470 B
C++
#pragma once
|
|
|
|
#include <memory>
|
|
#include <iostream>
|
|
#include <vector>
|
|
|
|
namespace xiv::utils::stream
|
|
{
|
|
template< typename CharT, typename TraitsT = std::char_traits< CharT > >
|
|
class vectorwrapbuf : public std::basic_streambuf< CharT, TraitsT >
|
|
{
|
|
public:
|
|
vectorwrapbuf( std::vector< CharT >& vec ) : std::basic_streambuf< CharT, TraitsT >()
|
|
{
|
|
this->setg( vec.data(), vec.data(), vec.data() + vec.size() );
|
|
}
|
|
};
|
|
}// namespace xiv::utils::stream
|