SMESH_File Class Reference

High level util for effective file reading and other file operations. More...

#include <SMESH_File.hxx>

Public Member Functions

void close ()
 Close the file. More...
 
const char * end () const
 
bool eof () const
 
const std::string & error () const
 
bool exists ()
 Check existence. More...
 
bool getInts (std::vector< int > &ids)
 Fill vector by reading out integers from file. Vector size gives number of integers to read. More...
 
std::string getLine ()
 Skip till current line end and return the skipped string. More...
 
std::string getName () const
 
const char * getPos () const
 
bool isDirectory ()
 Check existence. More...
 
bool open ()
 Open file for reading. Return true if there is something to read. More...
 
bool openForWriting ()
 Open for binary writing only. More...
 
 operator const char * () const
 
bool operator++ ()
 
void operator+= (int posDelta)
 
bool remove ()
 Remove the file. More...
 
void rewind ()
 Move cursor to the file beginning. More...
 
void setPos (const char *pos)
 Set cursor to the given position. More...
 
long size ()
 Return file size. More...
 
 SMESH_File (const std::string &name, bool openForReading=true)
 Creator opening the file for reading by default. More...
 
template<typename T >
bool write (const T &value)
 
template<typename T >
bool write (const T *values, size_t nbTValues)
 
bool writeRaw (const void *data, size_t size)
 Write binary data. More...
 
 ~SMESH_File ()
 Destructor closing the file. More...
 

Detailed Description

High level util for effective file reading and other file operations.

Constructor & Destructor Documentation

◆ SMESH_File()

SMESH_File::SMESH_File ( const std::string &  name,
bool  openForReading = true 
)

Creator opening the file for reading by default.

References open().

◆ ~SMESH_File()

SMESH_File::~SMESH_File ( )

Destructor closing the file.

References close().

Member Function Documentation

◆ close()

void SMESH_File::close ( )

Close the file.

References close().

Referenced by close(), open(), femexamples.examplesgui.FemExamples::reject(), remove(), and ~SMESH_File().

◆ end()

◆ eof()

bool SMESH_File::eof ( ) const

Referenced by getInts(), and getLine().

◆ error()

◆ exists()

bool SMESH_File::exists ( )

Check existence.

◆ getInts()

bool SMESH_File::getInts ( std::vector< int > &  ids)

Fill vector by reading out integers from file. Vector size gives number of integers to read.

References eof().

◆ getLine()

std::string SMESH_File::getLine ( )

Skip till current line end and return the skipped string.

References eof().

◆ getName()

std::string SMESH_File::getName ( ) const

◆ getPos()

const char * SMESH_File::getPos ( ) const

◆ isDirectory()

bool SMESH_File::isDirectory ( )

Check existence.

◆ open()

bool SMESH_File::open ( )

Open file for reading. Return true if there is something to read.

References close(), open(), and size().

Referenced by open(), openForWriting(), and SMESH_File().

◆ openForWriting()

bool SMESH_File::openForWriting ( )

Open for binary writing only.

References open().

◆ operator const char *()

SMESH_File::operator const char * ( ) const

◆ operator++()

bool SMESH_File::operator++ ( )

◆ operator+=()

void SMESH_File::operator+= ( int  posDelta)

◆ remove()

bool SMESH_File::remove ( )

Remove the file.

References close().

Referenced by NETGENPlugin_Mesher::RemoveTmpFiles().

◆ rewind()

void SMESH_File::rewind ( )

Move cursor to the file beginning.

Referenced by gzip_utf8.GzipFile::seek().

◆ setPos()

void SMESH_File::setPos ( const char *  pos)

Set cursor to the given position.

◆ size()

◆ write() [1/2]

template<typename T >
bool SMESH_File::write ( const T &  value)

◆ write() [2/2]

template<typename T >
bool SMESH_File::write ( const T *  values,
size_t  nbTValues 
)

◆ writeRaw()

bool SMESH_File::writeRaw ( const void *  data,
size_t  size 
)

Write binary data.

References write().


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