powerd++  0.4.4
Public Member Functions | List of all members
sys::io::file_feature< FileT, seek, Tail ... > Class Template Reference

Implement seek support for file types. More...

#include <io.hpp>

Inheritance diagram for sys::io::file_feature< FileT, seek, Tail ... >:
[legend]
Collaboration diagram for sys::io::file_feature< FileT, seek, Tail ... >:
[legend]

Public Member Functions

FileT & seek (long int const offset, int const origin)
 Seek file position. More...
 
FileT & rewind ()
 Reset file position to the beginning of the file. More...
 
long int tell ()
 Retrieve the current file position. More...
 
- Public Member Functions inherited from sys::io::file_feature< FileT, Tail ... >
 operator bool () const
 Cast to boolean. More...
 
bool eof () const
 Return whether the file instance is in EOF state. More...
 
bool error () const
 Return whether the file instance is in an error state. More...
 

Additional Inherited Members

- Protected Member Functions inherited from sys::io::file_feature< FileT, Tail ... >
 operator FileT & ()
 Implicit cast up to inheriting file access type.
 
 file_feature (FILE *const handle)
 Construct from a FILE object pointer. More...
 
- Protected Attributes inherited from sys::io::file_feature< FileT, Tail ... >
FILE * handle
 A pointer to the underlying FILE object.
 

Detailed Description

template<class FileT, feature ... Tail>
class sys::io::file_feature< FileT, seek, Tail ... >

Implement seek support for file types.

Template Parameters
FileTThe file access type inheriting the feature
TailThe remaining features

Member Function Documentation

◆ rewind()

template<class FileT , feature ... Tail>
FileT& sys::io::file_feature< FileT, seek, Tail ... >::rewind ( )
inline

Reset file position to the beginning of the file.

See also
frewind()
Returns
A self reference

◆ seek()

template<class FileT , feature ... Tail>
FileT& sys::io::file_feature< FileT, seek, Tail ... >::seek ( long int const  offset,
int const  origin 
)
inline

Seek file position.

See also
fseek()
Parameters
offsetThe origin relative file position for binary files or an absolute position returned by tell() for text files
originOne of SEEK_SET, SEEK_CUR, SEEK_END
Returns
A self reference

◆ tell()

template<class FileT , feature ... Tail>
long int sys::io::file_feature< FileT, seek, Tail ... >::tell ( )
inline

Retrieve the current file position.

See also
ftell()
Returns
The current file offset

The documentation for this class was generated from the following file: