-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathfs_physical_file.cpp
More file actions
51 lines (37 loc) · 1.13 KB
/
Copy pathfs_physical_file.cpp
File metadata and controls
51 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
#include "fs/impl/physical/fs_physical_file.hpp"
#include <string>
#include <string_view>
//------------------------------------------------------------------------------
namespace fs::physical
{
//------------------------------------------------------------------------------
PhysicalFile::PhysicalFile( std::fstream && _file )
: m_file{ std::move( _file ) }
{
m_file.unsetf( std::ios_base::skipws );
}
//------------------------------------------------------------------------------
bool PhysicalFile::eof() const
{
return m_file.eof();
}
//------------------------------------------------------------------------------
std::string PhysicalFile::getLine() const
{
std::string line;
std::getline( m_file, line );
return line;
}
//------------------------------------------------------------------------------
std::istream & PhysicalFile::toInputStream()
{
return m_file;
}
//------------------------------------------------------------------------------
File & PhysicalFile::operator<<( std::string_view _str )
{
m_file << _str;
return *this;
}
//------------------------------------------------------------------------------
}