-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathfs_file_system.hpp
More file actions
40 lines (26 loc) · 917 Bytes
/
fs_file_system.hpp
File metadata and controls
40 lines (26 loc) · 917 Bytes
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
#pragma once
#include <stdfwd.hpp>
//------------------------------------------------------------------------------
namespace fs {
class File;
enum class ItemType;
//------------------------------------------------------------------------------
class FileSystem
{
public:
using Path = stdfs::path;
using FilePtr = stdfwd::shared_ptr< File >;
using ItemCallback = std::function< void ( const Path &, ItemType ) >;
virtual ~FileSystem() = default;
virtual FilePtr openFile( const Path & _path ) const = 0;
virtual FilePtr createFile( const Path & _path ) = 0;
virtual bool isExistFile( const Path & _path ) const = 0;
virtual Path getCurrentPath() const = 0;
virtual Path toAbsolute( const Path & _path ) const = 0;
virtual void forEachItem(
const Path & _dirPath,
ItemCallback _callback
) const = 0;
};
//------------------------------------------------------------------------------
}