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

Implements the base functionality of all file access types. More...

#include <io.hpp>

Public Member Functions

 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...
 

Protected Member Functions

 operator FileT & ()
 Implicit cast up to inheriting file access type.
 
 file_feature (FILE *const handle)
 Construct from a FILE object pointer. More...
 

Protected Attributes

FILE * handle
 A pointer to the underlying FILE object.
 

Detailed Description

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

Implements the base functionality of all file access types.

Template Parameters
FileTThe file access type inheriting the feature
See also
file_feature<FileT, read, Tail ...>
file_feature<FileT, write, Tail ...>
file_feature<FileT, seek, Tail ...>

Constructor & Destructor Documentation

◆ file_feature()

template<class FileT , feature ... >
sys::io::file_feature< FileT,... >::file_feature ( FILE *const  handle)
inlineprotected

Construct from a FILE object pointer.

Parameters
handleA pointer to the object keeping file descriptor state

Member Function Documentation

◆ eof()

template<class FileT , feature ... >
bool sys::io::file_feature< FileT,... >::eof ( ) const
inline

Return whether the file instance is in EOF state.

See also
feof()
Returns
Whether the file instance points to a FILE object and is in EOF state

◆ error()

template<class FileT , feature ... >
bool sys::io::file_feature< FileT,... >::error ( ) const
inline

Return whether the file instance is in an error state.

See also
ferror()
Returns
Whether the file instance points to a FILE object and is in an error state

◆ operator bool()

template<class FileT , feature ... >
sys::io::file_feature< FileT,... >::operator bool ( ) const
inlineexplicit

Cast to boolean.

See also
feof()
ferror()
Return values
trueThe file instance point to a FILE object, which is not in EOF or error state
falseThe file instance does not point to a FILE object, or the FILE object is in EOF or error state

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