mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-04-23 21:27:45 +00:00
28 lines
480 B
C
28 lines
480 B
C
![]() |
#ifndef XIV_UTILS_STREAM_H
|
||
|
#define XIV_UTILS_STREAM_H
|
||
|
|
||
|
#include <memory>
|
||
|
#include <iostream>
|
||
|
#include <vector>
|
||
|
|
||
|
namespace xiv
|
||
|
{
|
||
|
namespace utils
|
||
|
{
|
||
|
namespace stream
|
||
|
{
|
||
|
template<typename CharT, typename TraitsT = std::char_traits<CharT> >
|
||
|
class vectorwrapbuf : public std::basic_streambuf<CharT, TraitsT>
|
||
|
{
|
||
|
public:
|
||
|
vectorwrapbuf(std::vector<CharT> &vec)
|
||
|
{
|
||
|
this->setg(vec.data(), vec.data(), vec.data() + vec.size());
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
#endif // XIV_UTILS_STREAM_H
|