Web framework C++  2.0.0
Simple web framework on c++ designed to easily create web pages, etc
Public Member Functions | List of all members
FsFile Class Reference

Representation of file in filesystem. More...

#include <fs_file.h>

Inheritance diagram for FsFile:
Inheritance graph
Collaboration diagram for FsFile:
Collaboration graph

Public Member Functions

 FsFile (std::string &name, std::string &fullPath)
 
std::string getName () override
 
std::string getFileContent () override
 
std::string findFileAndGetContent (std::string &filePath) override
 
void add (FsComponent *component) override
 
void remove (FsComponent *component) override
 
bool isComposite () override
 
- Public Member Functions inherited from FsComponent
virtual ~FsComponent ()=default
 

Detailed Description

Representation of file in filesystem.

This class is intended to represent a file in filesystem hierarchy

Constructor & Destructor Documentation

FsFile::FsFile ( std::string &  name,
std::string &  fullPath 
)

Create a FsFile object with specified name and full path

Parameters
namefile name
fullPathfull path to file

Member Function Documentation

void FsFile::add ( FsComponent component)
overridevirtual
Exceptions
RuntimeException,becauseit's not a folder

Implements FsComponent.

std::string FsFile::findFileAndGetContent ( std::string &  filePath)
overridevirtual
Exceptions
RuntimeException,becauseit's not a folder

Implements FsComponent.

std::string FsFile::getFileContent ( )
overridevirtual

returns a content, stored in this file.

Returns
content, that was read from file

Implements FsComponent.

std::string FsFile::getName ( )
overridevirtual

get name of current file

Returns
name of file as string

Implements FsComponent.

bool FsFile::isComposite ( )
overridevirtual

Check, if current entity is composite and have children

Returns
false, because it's not a folder

Implements FsComponent.

void FsFile::remove ( FsComponent component)
overridevirtual
Exceptions
RuntimeException,becauseit's not a folder

Implements FsComponent.


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