pion  5.0.6
Public Member Functions | Protected Attributes | List of all members
pion::plugins::DiskFile Class Reference

#include <FileService.hpp>

Public Member Functions

 DiskFile (void)
 default constructor
 
 DiskFile (const boost::filesystem::path &path, char *content, unsigned long size, std::time_t modified, const std::string &mime)
 used to construct new disk file objects
 
 DiskFile (const DiskFile &f)
 copy constructor
 
void update (void)
 updates the file_size and last_modified timestamp to disk
 
void read (void)
 reads content from disk into file_content buffer (may throw)
 
bool checkUpdated (void)
 
const boost::filesystem::path & getFilePath (void) const
 return path to the cached file
 
char * getFileContent (void)
 returns content of the cached file
 
bool hasFileContent (void) const
 returns true if there is cached file content
 
unsigned long getFileSize (void) const
 returns size of the file's content
 
std::time_t getLastModified (void) const
 returns timestamp that the cached file was last modified (0 = cache disabled)
 
const std::string & getLastModifiedString (void) const
 returns timestamp that the cached file was last modified (string format)
 
const std::string & getMimeType (void) const
 returns mime type for the cached file
 
void setFilePath (const boost::filesystem::path &p)
 sets the path to the cached file
 
void appendFilePath (const std::string &p)
 appends to the path of the cached file
 
void setMimeType (const std::string &t)
 sets the mime type for the cached file
 
void resetFileContent (unsigned long n=0)
 resets the size of the file content buffer
 

Protected Attributes

boost::filesystem::path m_file_path
 path to the cached file
 
boost::shared_array< char > m_file_content
 content of the cached file
 
std::streamsize m_file_size
 size of the file's content
 
std::time_t m_last_modified
 timestamp that the cached file was last modified (0 = cache disabled)
 
std::string m_last_modified_string
 timestamp that the cached file was last modified (string format)
 
std::string m_mime_type
 mime type for the cached file
 

Detailed Description

DiskFile: class used to represent files stored on disk

Definition at line 37 of file FileService.hpp.

Member Function Documentation

§ checkUpdated()

bool pion::plugins::DiskFile::checkUpdated ( void  )

checks if the file has been updated and updates vars if it has (may throw)

Returns
true if the file was updated

Definition at line 787 of file FileService.cpp.

References pion::http::types::get_date_string().

Referenced by DiskFile().


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