HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_FileBuf Class Reference

#include <UT_FileBuf.h>

+ Inheritance diagram for UT_FileBuf:

Public Types

typedef std::streambuf SUPER_CLASS
 
typedef std::ios_base IOS_BASE
 
typedef std::ios_base::openmode OPEN_MODE
 
typedef traits_type::int_type int_type
 
typedef traits_type::pos_type pos_type
 
typedef traits_type::off_type off_type
 

Public Member Functions

 UT_FileBuf ()
 
virtual ~UT_FileBuf ()
 
bool is_open () const
 Test if there exists an opened file. More...
 
FILE * openTmpFile ()
 Create filebuf from UTgetTmpFile() for read/write. More...
 
UT_FileBufclose ()
 Close the currently opened file (if any) More...
 
bool setFileAsSparse ()
 Attempt to set the opened (writable) file as sparse. The exact behaviour is platform-specific depending on the underlying file system. So this function provides a hint at best. More...
 
FILE * open (const char *filename, OPEN_MODE mode, UT_IOS_TYPE mode_type=UT_IOS_BINARY)
 
FILE * open (const std::string &filename, OPEN_MODE mode, UT_IOS_TYPE mode_type=UT_IOS_BINARY)
 

Protected Member Functions

virtual SUPER_CLASSsetbuf (char *buf, std::streamsize n)
 
virtual pos_type seekoff (off_type off, IOS_BASE::seekdir way, OPEN_MODE=IOS_BASE::in|IOS_BASE::out)
 
virtual pos_type seekpos (pos_type off, OPEN_MODE=IOS_BASE::in|IOS_BASE::out)
 
virtual int sync ()
 
virtual int_type overflow (int_type ch=traits_type::eof())
 
virtual std::streamsize xsputn (const char *buf, std::streamsize n)
 
virtual std::streamsize xsgetn (char *buf, std::streamsize n)
 
virtual int_type underflow ()
 
virtual int_type uflow ()
 
virtual int_type pbackfail (int_type ch=traits_type::eof())
 

Detailed Description

Definition at line 27 of file UT_FileBuf.h.

Member Typedef Documentation

typedef traits_type::int_type UT_FileBuf::int_type

Definition at line 33 of file UT_FileBuf.h.

typedef std::ios_base UT_FileBuf::IOS_BASE

Definition at line 31 of file UT_FileBuf.h.

typedef traits_type::off_type UT_FileBuf::off_type

Definition at line 35 of file UT_FileBuf.h.

typedef std::ios_base::openmode UT_FileBuf::OPEN_MODE

Definition at line 32 of file UT_FileBuf.h.

typedef traits_type::pos_type UT_FileBuf::pos_type

Definition at line 34 of file UT_FileBuf.h.

typedef std::streambuf UT_FileBuf::SUPER_CLASS

Definition at line 30 of file UT_FileBuf.h.

Constructor & Destructor Documentation

UT_FileBuf::UT_FileBuf ( )
inline

Definition at line 38 of file UT_FileBuf.h.

virtual UT_FileBuf::~UT_FileBuf ( )
inlinevirtual

Definition at line 43 of file UT_FileBuf.h.

Member Function Documentation

UT_FileBuf* UT_FileBuf::close ( )

Close the currently opened file (if any)

bool UT_FileBuf::is_open ( ) const
inline

Test if there exists an opened file.

Definition at line 50 of file UT_FileBuf.h.

FILE* UT_FileBuf::open ( const char *  filename,
OPEN_MODE  mode,
UT_IOS_TYPE  mode_type = UT_IOS_BINARY 
)

Open the given file with fopen and return a pointer to result. The returned pointer is valid until the next open operation, the next close operation, or this object destructs.

FILE* UT_FileBuf::open ( const std::string filename,
OPEN_MODE  mode,
UT_IOS_TYPE  mode_type = UT_IOS_BINARY 
)
inline

Open the given file with fopen and return a pointer to result. The returned pointer is valid until the next open operation, the next close operation, or this object destructs.

Definition at line 62 of file UT_FileBuf.h.

FILE* UT_FileBuf::openTmpFile ( )

Create filebuf from UTgetTmpFile() for read/write.

Note
This is a SESI-specific extension.
virtual int_type UT_FileBuf::overflow ( int_type  ch = traits_type::eof())
inlineprotectedvirtual

Definition at line 141 of file UT_FileBuf.h.

virtual int_type UT_FileBuf::pbackfail ( int_type  ch = traits_type::eof())
inlineprotectedvirtual

Definition at line 186 of file UT_FileBuf.h.

virtual pos_type UT_FileBuf::seekoff ( off_type  off,
IOS_BASE::seekdir  way,
OPEN_MODE  = IOS_BASE::in | IOS_BASE::out 
)
inlineprotectedvirtual

Definition at line 95 of file UT_FileBuf.h.

virtual pos_type UT_FileBuf::seekpos ( pos_type  off,
OPEN_MODE  = IOS_BASE::in | IOS_BASE::out 
)
inlineprotectedvirtual

Definition at line 120 of file UT_FileBuf.h.

virtual SUPER_CLASS* UT_FileBuf::setbuf ( char *  buf,
std::streamsize  n 
)
inlineprotectedvirtual

Definition at line 85 of file UT_FileBuf.h.

bool UT_FileBuf::setFileAsSparse ( )

Attempt to set the opened (writable) file as sparse. The exact behaviour is platform-specific depending on the underlying file system. So this function provides a hint at best.

Note
This is a SESI-specific extension. This works on most filesystems on Linux, Windows and OSX post-Sierra.
virtual int UT_FileBuf::sync ( )
inlineprotectedvirtual

Definition at line 130 of file UT_FileBuf.h.

virtual int_type UT_FileBuf::uflow ( )
inlineprotectedvirtual

Definition at line 177 of file UT_FileBuf.h.

virtual int_type UT_FileBuf::underflow ( )
inlineprotectedvirtual

Definition at line 165 of file UT_FileBuf.h.

virtual std::streamsize UT_FileBuf::xsgetn ( char *  buf,
std::streamsize  n 
)
inlineprotectedvirtual

Definition at line 158 of file UT_FileBuf.h.

virtual std::streamsize UT_FileBuf::xsputn ( const char *  buf,
std::streamsize  n 
)
inlineprotectedvirtual

Definition at line 150 of file UT_FileBuf.h.


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