Pol  Revision:3cfda13
Pol::Clib::FileContents Class Reference

#include <filecont.h>

Public Member Functions

 FileContents (const char *filname)
 
const char * contents () const
 
void set_contents (const std::string &str)
 

Private Attributes

std::string contents_
 

Detailed Description

Simple class to read a whole file as a char array

Definition at line 12 of file filecont.h.

Constructor & Destructor Documentation

Pol::Clib::FileContents::FileContents ( const char *  filename)

Creates the instance and reads the whole file content into it

Parameters
filenameFull path of the file to be read
Exceptions
std::runtime_errorWhen something goes wrong when reading the file

Definition at line 23 of file filecont.cpp.

References contents_, and ERROR_PRINT.

Member Function Documentation

const char * Pol::Clib::FileContents::contents ( ) const

Returns a pointer to the file content

Definition at line 46 of file filecont.cpp.

References contents_.

Referenced by Pol::Bscript::preprocess_web_script().

void Pol::Clib::FileContents::set_contents ( const std::string &  str)

Replaces the internal content with a copy of the given one

Definition at line 54 of file filecont.cpp.

References contents_.

Referenced by Pol::Bscript::preprocess_web_script().

Member Data Documentation

std::string Pol::Clib::FileContents::contents_
private

Definition at line 21 of file filecont.h.

Referenced by contents(), FileContents(), and set_contents().


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