-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathfs_memory_file.cpp
More file actions
52 lines (37 loc) · 1.13 KB
/
fs_memory_file.cpp
File metadata and controls
52 lines (37 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "fs/impl/memory/fs_memory_file.hpp"
#include <sstream>
#include <string_view>
//------------------------------------------------------------------------------
namespace fs::memory
{
//------------------------------------------------------------------------------
MemoryFile::MemoryFile()
{
m_buf.unsetf( std::ios_base::skipws );
}
//------------------------------------------------------------------------------
bool MemoryFile::eof() const
{
return m_buf.eof();
}
//------------------------------------------------------------------------------
std::string MemoryFile::getLine() const
{
std::string result;
getline( m_buf, result );
return result;
}
//------------------------------------------------------------------------------
std::istream & MemoryFile::toInputStream()
{
return m_buf;
}
//------------------------------------------------------------------------------
File & MemoryFile::operator<<( std::string_view _str )
{
m_buf << _str;
return *this;
}
//------------------------------------------------------------------------------
}
//------------------------------------------------------------------------------