acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
file.h
1#pragma once
2
3
4
5
6
7class FileException;
8struct FileStatus;
9
10void CLASS_DECL_ACME vfxGetRoot(const wide_character * lpszPath, string& wstrRoot);
11void CLASS_DECL_ACME vfxGetRoot(wstring & wstrRoot, const wstring & wstrPath);
12
13
14
15
16namespace universal_windows
17{
18
20 // File - raw unbuffered disk file I/O
21
22 class CLASS_DECL_ACME file :
23 virtual public ::file::file
24 {
25 public:
26
27
28 enum Attribute
29 {
30 normal = 0x00,
31 readOnly = 0x01,
32 hidden = 0x02,
33 system = 0x04,
34 volume = 0x08,
35 directory = 0x10,
36 archive = 0x20
37 };
38
39
40 bool m_bCloseOnDelete;
41 hfile m_hfile;
42
43
44 file();
45 virtual ~file();
46
47
48 // void assert_ok() const override;
49 // virtual void dump(dump_context& dumpcontext) const override;
50
51
52 operator HANDLE() const;
53
54 virtual filesize get_position() const override;
55 virtual bool get_status(::file::file_status & rStatus) const override;
56 //virtual string GetFileName() const override;
57 //virtual string GetFileTitle() const override;
58 virtual ::file::path get_file_path() const override;
59 virtual void set_file_path(const ::file::path & path) override;
60
61 virtual ::extended::status open(const ::file::path & lpszFileName, ::file::e_open eopen) override;
62
63 //virtual bool GetStatus(const ::file::path & lpszFileName,::file::file_status& rStatus);
64
65 ::u64 ReadHuge(void * lpBuffer, ::u64 dwCount);
66 void WriteHuge(const void * lpBuffer, ::u64 dwCount);
67
68 //virtual ::pointer<::file::file>Duplicate() const;
69
70 virtual filesize seek(filesize lOff, ::enum_seek eseek) override;
71 virtual void set_size(filesize dwNewLen) override;
72 virtual filesize get_size() const override;
73
74 virtual memsize read(void * lpBuf, memsize nCount) override;
75 virtual void write(const void * lpBuf, memsize nCount) override;
76
77 virtual void lock(filesize dwPos, filesize dwCount) override;
78 virtual void unlock(filesize dwPos, filesize dwCount) override;
79
80 //virtual void Abort();
81 virtual void flush() override;
82 virtual void close() override;
83
84 virtual bool is_opened()const override;
85 //enum BufferCommand { bufferRead, bufferWrite, bufferCommit, bufferCheck };
86 //virtual ::u64 GetBufferPtr(::u32 nCommand, ::u64 nCount = 0,
87 // void ** ppBufStart = nullptr, void ** ppBufMax = nullptr);
88
89 };
90
91 //namespace WinFileException
92 //{
93
94 // void OsErrorToException(::i32 lOsError);
95 // void ErrnoToException(::i32 nErrno);
96 // void ThrowOsError(::particle * pparticle, ::i32 lOsError, const_char_pointer pszFileName = nullptr);
97 // void ThrowErrno(::particle * pparticle, ::i32 nErrno, const_char_pointer pszFileName = nullptr);
98
99 //}
100
101
102
103} // namespace universal_windows
virtual void flush() override
Definition aaa_want_to_remove_str_wstring.h:94
Definition filesystem.h:16
Definition status.h:12