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 ()
 
 ~UT_FileBuf () override
 
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

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

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.

UT_FileBuf::~UT_FileBuf ( )
inlineoverride

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 52 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 SYSfopen 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 SYSfopen 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 64 of file UT_FileBuf.h.

FILE* UT_FileBuf::openTmpFile ( )

Create filebuf from UTgetTmpFile() for read/write.

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

Definition at line 145 of file UT_FileBuf.h.

int_type UT_FileBuf::pbackfail ( int_type  ch = traits_type::eof())
inlineoverrideprotected

Definition at line 190 of file UT_FileBuf.h.

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

Definition at line 97 of file UT_FileBuf.h.

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

Definition at line 122 of file UT_FileBuf.h.

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

Definition at line 87 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.
int UT_FileBuf::sync ( )
inlineoverrideprotected

Definition at line 133 of file UT_FileBuf.h.

int_type UT_FileBuf::uflow ( )
inlineoverrideprotected

Definition at line 181 of file UT_FileBuf.h.

int_type UT_FileBuf::underflow ( )
inlineoverrideprotected

Definition at line 169 of file UT_FileBuf.h.

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

Definition at line 162 of file UT_FileBuf.h.

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

Definition at line 154 of file UT_FileBuf.h.


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