Last change
on this file since 395 was
395,
checked in by epyon, 10 years ago
|
- bulk update
copyright update
include guards cleanup
core/common.hh -> common.hh
minor cleanups
|
File size:
1.1 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>
|
---|
[124] | 17 | #include <nv/interface/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 );
|
---|
[279] | 32 | virtual size_t write( const void* buffer, size_t size, size_t count );
|
---|
[198] | 33 | virtual bool seek( long offset, origin orig );
|
---|
[124] | 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 |
|
---|
[395] | 45 | #endif // NV_IO_C_STREAM_HH
|
---|
Note: See
TracBrowser
for help on using the repository browser.