Last change
on this file since 319 was
319,
checked in by epyon, 11 years ago
|
- created core module and moved all free source files there
- took the opportunity to update all copyright lines and minor cleanup
- minor fixes
- not all examples are up to date
|
File size:
1.1 KB
|
Line | |
---|
1 | // Copyright (C) 2012-2014 ChaosForge Ltd
|
---|
2 | // http://chaosforge.org/
|
---|
3 | //
|
---|
4 | // This file is part of NV Libraries.
|
---|
5 | // For conditions of distribution and use, see copyright notice in nv.hh
|
---|
6 | /**
|
---|
7 | * @file c_stream.hh
|
---|
8 | * @author Kornel Kisielewicz epyon@chaosforge.org
|
---|
9 | * @brief stream implementation via c f* functions
|
---|
10 | */
|
---|
11 |
|
---|
12 | #ifndef NV_C_STREAM_HH
|
---|
13 | #define NV_C_STREAM_HH
|
---|
14 |
|
---|
15 | #include <nv/core/common.hh>
|
---|
16 | #include <nv/interface/stream.hh>
|
---|
17 |
|
---|
18 | namespace nv
|
---|
19 | {
|
---|
20 | class c_file_system;
|
---|
21 |
|
---|
22 | class c_stream : public stream
|
---|
23 | {
|
---|
24 | friend class c_file_system;
|
---|
25 | protected:
|
---|
26 | c_stream();
|
---|
27 | c_stream( void* pfile, const char* filename );
|
---|
28 | public:
|
---|
29 | virtual ~c_stream();
|
---|
30 | virtual size_t read( void* buffer, size_t size, size_t count );
|
---|
31 | virtual size_t write( const void* buffer, size_t size, size_t count );
|
---|
32 | virtual bool seek( long offset, origin orig );
|
---|
33 | virtual size_t tell();
|
---|
34 | virtual size_t size();
|
---|
35 | virtual void flush();
|
---|
36 | private:
|
---|
37 | void* m_file; //!< FILE* structure, masked
|
---|
38 | const char* m_file_name; //!< File name
|
---|
39 | size_t m_file_size; //!< Cached file size
|
---|
40 | };
|
---|
41 |
|
---|
42 | } // namespace nv
|
---|
43 |
|
---|
44 | #endif // NV_C_STREAM_HH
|
---|
Note: See
TracBrowser
for help on using the repository browser.