24 virtual std::string
getName()
const = 0;
26 virtual void saveCopyTo(
const std::string& directoryPath) = 0;
27 virtual void saveCopyTo(
const std::string& directoryPath,
28 const std::string& name) = 0;
31 const std::string& content,
const std::string& name);
32 static std::unique_ptr<File>
fromFilesystem(
const std::string& path);
34 const std::string& path,
const std::string& name);
54 using Container = std::vector<std::unique_ptr<File>>;
81 bool empty() const noexcept;
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:49
virtual std::string getName() const =0
Returns the name of the file.
Container::value_type value_type
Definition: file.h:58
virtual std::string getContent()=0
Returns the content of the file.
Base class and factory for files.
Definition: file.h:20
static std::unique_ptr< File > fromFilesystem(const std::string &path)
Returns a file from the given path.
Definition: file.cpp:61
Container::size_type size_type
Definition: file.h:57
The namespace of the library.
Definition: doxygen.h:8
virtual void saveCopyTo(const std::string &directoryPath)=0
Stores a copy of the file into the given directory.
Container::iterator iterator
Definition: file.h:60
Container::reference reference
Definition: file.h:59
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:74
A vector-like container storing files.
Definition: file.h:51
File & operator=(const File &)=delete