]> git.tdb.fi Git - libs/core.git/blob - source/io/asset.h
Move non-oneliner functions out of RefPtr class declaration
[libs/core.git] / source / io / asset.h
1 #ifndef MSP_IO_ASSET_H_
2 #define MSP_IO_ASSET_H_
3
4 #include "seekable.h"
5
6 namespace Msp {
7 namespace IO {
8
9 /**
10 Opens a file from the application's assets.  On Android, this means the assets
11 contained within the APK.  On other platfoms, assets are located in the
12 directory indicated by FS::get_sys_data_dir().  Assets are always read-only.
13 */
14 class Asset: public Seekable
15 {
16 private:
17         struct Private;
18
19         Private *priv;
20
21 public:
22         Asset(const std::string &);
23         ~Asset();
24
25         virtual void set_block(bool);
26         virtual void set_inherit(bool);
27
28 private:
29         virtual unsigned do_write(const char *, unsigned);
30         virtual unsigned do_read(char *, unsigned);
31
32 public:
33         virtual const Handle &get_handle(Mode);
34
35         virtual SeekOffset seek(SeekOffset, SeekType);
36         virtual SeekOffset tell() const;
37 };
38
39 } // namespace IO
40 } // namespace Msp
41
42 #endif