Last change
on this file since 422 was
422,
checked in by epyon, 10 years ago
|
- stream and file_system moved to stl
- hash literal operator
- string table rewrite
|
File size:
1.1 KB
|
Line | |
---|
1 | // Copyright (C) 2012-2015 ChaosForge Ltd
|
---|
2 | // http://chaosforge.org/
|
---|
3 | //
|
---|
4 | // This file is part of Nova libraries.
|
---|
5 | // For conditions of distribution and use, see copying.txt file in root folder.
|
---|
6 |
|
---|
7 | /**
|
---|
8 | * @file c_stream.hh
|
---|
9 | * @author Kornel Kisielewicz epyon@chaosforge.org
|
---|
10 | * @brief stream implementation via c f* functions
|
---|
11 | */
|
---|
12 |
|
---|
13 | #ifndef NV_IO_C_STREAM_HH
|
---|
14 | #define NV_IO_C_STREAM_HH
|
---|
15 |
|
---|
16 | #include <nv/common.hh>
|
---|
17 | #include <nv/stl/stream.hh>
|
---|
18 |
|
---|
19 | namespace nv
|
---|
20 | {
|
---|
21 | class c_file_system;
|
---|
22 |
|
---|
23 | class c_stream : public stream
|
---|
24 | {
|
---|
25 | friend class c_file_system;
|
---|
26 | protected:
|
---|
27 | c_stream();
|
---|
28 | c_stream( void* pfile, const char* filename );
|
---|
29 | public:
|
---|
30 | virtual ~c_stream();
|
---|
31 | virtual size_t read( void* buffer, size_t size, size_t count );
|
---|
32 | virtual size_t write( const void* buffer, size_t size, size_t count );
|
---|
33 | virtual bool seek( long offset, origin orig );
|
---|
34 | virtual size_t tell();
|
---|
35 | virtual size_t size();
|
---|
36 | virtual void flush();
|
---|
37 | private:
|
---|
38 | void* m_file; //!< FILE* structure, masked
|
---|
39 | const char* m_file_name; //!< File name
|
---|
40 | size_t m_file_size; //!< Cached file size
|
---|
41 | };
|
---|
42 |
|
---|
43 | } // namespace nv
|
---|
44 |
|
---|
45 | #endif // NV_IO_C_STREAM_HH
|
---|
Note: See
TracBrowser
for help on using the repository browser.