Go to the documentation of this file.
   38                 mode = std::ios_base::out | std::ios_base::trunc;
 
   40                 mode = std::ios_base::app | std::ios_base::out;
 
   47         m_f.open(fileName.c_str(), 
mode);
 
   49                 throw std::runtime_error(
 
   50                         std::string(
"CFileStream: Error creating/opening: ") + fileName);
 
   62                 mode = std::ios_base::out | std::ios_base::trunc;
 
   64                 mode = std::ios_base::app | std::ios_base::out;
 
   70         if (
m_f.is_open()) 
m_f.close();
 
   72         m_f.open(fileName.c_str(), ios_base::binary | 
mode);
 
   90         if (!
m_f.is_open()) 
return 0;
 
   91         m_f.read(
static_cast<char*
>(Buffer), Count);
 
   92         return m_f.fail() ? 0 : Count;
 
  101         if (!
m_f.is_open()) 
return 0;
 
  103         m_f.write(
static_cast<const char*
>(Buffer), Count);
 
  104         return m_f.fail() ? 0 : Count;
 
  114         if (!
m_f.is_open()) 
return 0;
 
  116         fstream::off_type 
offset = Offset;
 
  117         fstream::seekdir way;
 
  131                         throw std::runtime_error(
 
  132                                 "[CFileStream::Seek] Invalid value for 'Origin'");
 
  145         auto& f = 
const_cast<std::fstream&
>(
m_f);
 
  147         const uint64_t previousPos = f.tellg();
 
  150         f.seekg(previousPos, ios_base::beg);
 
  156         auto& f = 
const_cast<std::fstream&
>(
m_f);
 
  195         if (!
m_f.is_open()) 
return false;
 
  197         std::getline(
m_f, str);
 
  198         return !
m_f.fail() && !
m_f.eof();
 
  206         if (!
m_f.is_open()) 
return true;
 
  212         if (
m_f.is_open()) 
m_f.clear();
 
  
bool readLine(std::string &str)
Reads one string line from the file (until a new-line character)
 
TSeekOrigin
Used in CStream::Seek.
 
virtual ~CFileStream()
Destructor.
 
uint64_t Seek(int64_t off, CStream::TSeekOrigin org=sFromBeginning) override
Introduces a pure virtual method for moving to a specified position in the streamed resource.
 
uint64_t getPositionI()
The current Input cursor position, where 0 is the first byte.
 
void close()
Closes the file.
 
uint64_t getTotalBytesCount() const override
Returns the total amount of bytes in the stream.
 
bool fileOpenCorrectly() const
Returns true if the file was open without errors.
 
uint64_t getPosition() const override
Method for getting the current cursor position, where 0 is the first byte and TotalBytesCount-1 the l...
 
bool checkEOF()
Will be true if EOF has been already reached.
 
size_t Read(void *Buffer, size_t Count) override
Introduces a pure virtual method responsible for reading from the stream.
 
uint64_t getPositionO()
The current Input cursor position, where 0 is the first byte.
 
int TFileOpenModes
File open modes are used in CFileStream Posible values are:
 
std::fstream m_f
The actual input file stream.
 
size_t Write(const void *Buffer, size_t Count) override
Introduces a pure virtual method responsible for writing to the stream.
 
unsigned __int64 uint64_t
 
bool open(const std::string &fileName, TFileOpenModes mode=fomRead|fomWrite)
Opens the file, returning true on success.
 
CFileStream()
Constructor.
 
GLsizei const GLfloat * value
 
void clearError()
Resets stream error status bits (e.g.
 
GLsizei const GLchar ** string
 
   |  Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST |   |