Last change
on this file since 484 was
484,
checked in by epyon, 10 years ago
|
- resource manager updates
- nv-image added
- missing stl memory added
- several other missing files
|
File size:
1.3 KB
|
Rev | Line | |
---|
[395] | 1 | // Copyright (C) 2012-2015 ChaosForge Ltd
|
---|
[124] | 2 | // http://chaosforge.org/
|
---|
| 3 | //
|
---|
[395] | 4 | // This file is part of Nova libraries.
|
---|
| 5 | // For conditions of distribution and use, see copying.txt file in root folder.
|
---|
| 6 |
|
---|
[124] | 7 | /**
|
---|
| 8 | * @file c_stream.hh
|
---|
| 9 | * @author Kornel Kisielewicz epyon@chaosforge.org
|
---|
| 10 | * @brief stream implementation via c f* functions
|
---|
| 11 | */
|
---|
| 12 |
|
---|
[395] | 13 | #ifndef NV_IO_C_STREAM_HH
|
---|
| 14 | #define NV_IO_C_STREAM_HH
|
---|
[124] | 15 |
|
---|
[395] | 16 | #include <nv/common.hh>
|
---|
[422] | 17 | #include <nv/stl/stream.hh>
|
---|
[124] | 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();
|
---|
[438] | 28 | // TODO: const char* is prone to deletion - don't store it, or store differently!
|
---|
[124] | 29 | c_stream( void* pfile, const char* filename );
|
---|
| 30 | public:
|
---|
| 31 | virtual ~c_stream();
|
---|
| 32 | virtual size_t read( void* buffer, size_t size, size_t count );
|
---|
[279] | 33 | virtual size_t write( const void* buffer, size_t size, size_t count );
|
---|
[442] | 34 | virtual bool gets( char* buffer, size_t max_count );
|
---|
[198] | 35 | virtual bool seek( long offset, origin orig );
|
---|
[484] | 36 | virtual bool eof();
|
---|
[124] | 37 | virtual size_t tell();
|
---|
| 38 | virtual size_t size();
|
---|
| 39 | virtual void flush();
|
---|
| 40 | private:
|
---|
| 41 | void* m_file; //!< FILE* structure, masked
|
---|
| 42 | const char* m_file_name; //!< File name
|
---|
| 43 | size_t m_file_size; //!< Cached file size
|
---|
| 44 | };
|
---|
| 45 |
|
---|
| 46 | } // namespace nv
|
---|
| 47 |
|
---|
[395] | 48 | #endif // NV_IO_C_STREAM_HH
|
---|
Note: See
TracBrowser
for help on using the repository browser.