source: trunk/src/lol/sys/file.h @ 2358

Last change on this file since 2358 was 2358, checked in by sam, 7 years ago

sys: create an empty File class.

File size: 952 bytes
Line 
1//
2// Lol Engine
3//
4// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
5//   This program is free software; you can redistribute it and/or
6//   modify it under the terms of the Do What The Fuck You Want To
7//   Public License, Version 2, as published by Sam Hocevar. See
8//   http://www.wtfpl.net/ for more details.
9//
10
11//
12// File and buffer reading
13// -----------------------
14//
15
16#if !defined __LOL_SYS_FILE_H__
17#define __LOL_SYS_FILE_H__
18
19#include <stdint.h>
20
21namespace lol
22{
23
24struct FileAccess
25{
26    enum Value
27    {
28        Read = 0,
29        Write,
30    }
31    m_value;
32
33    inline FileAccess(Value v) : m_value(v) {}
34    inline operator Value() { return m_value; }
35};
36
37class File
38{
39public:
40    inline File() : m_data(0) {}
41    inline ~File() {}
42
43    void Open(String const &file, FileAccess mode);
44    String const &ReadString();
45    void Close();
46
47private:
48    class FileData *m_data;
49};
50
51} /* namespace lol */
52
53#endif // __LOL_SYS_FILE_H__
54
Note: See TracBrowser for help on using the repository browser.