23 virtual std::string
getName()
const = 0;
25 virtual void saveCopyTo(
const std::string &directoryPath) = 0;
26 virtual void saveCopyTo(
const std::string &directoryPath,
27 const std::string &name) = 0;
30 const std::string &content,
const std::string &name);
31 static std::unique_ptr<File>
fromFilesystem(
const std::string &path);
33 const std::string &path,
const std::string &name);
virtual ~File()=0
Destructs the file.
The namespace of the library.
Definition: doxygen.h:8
static std::unique_ptr< File > fromContentWithName(const std::string &content, const std::string &name)
Returns a file containing the given content with the given name.
Definition: file.cpp:57
virtual void saveCopyTo(const std::string &directoryPath)=0
Stores a copy of the file into the given directory.
virtual std::string getContent()=0
Returns the content of the file.
static std::unique_ptr< File > fromFilesystemWithOtherName(const std::string &path, const std::string &name)
Returns a file from the given path, but with a custom name.
Definition: file.cpp:82
virtual std::string getName() const =0
Returns the name of the file.
File & operator=(const File &)=delete
Base class and factory for files.
Definition: file.h:19
static std::unique_ptr< File > fromFilesystem(const std::string &path)
Returns a file from the given path.
Definition: file.cpp:69