הערה (קובץ קוד)
קובץ זה הוא קובץ קוד מסוג C.
#pragma once
#include <fstream>
#include <vector>
#include "Action.h"
#include "Directory.h"
/**
* @class CreateAction
* A subtype of Action, it creates a file in a specific place in the system.
*/
class CreateAction : public Action {
public:
/**
* Creates a CreateAction with the necessary ingredients to create a file. (yes, it's a soup)
* @param name the name of the file that is going to be created.
* @param type the type of the file(textfile, symlink, directory)
* @param pathVector if it's a symlink, than that's the path from root the the file it links to.
* @param directory the parent folder of the file in the system.
*/
CreateAction(const std::string& name, const std::string& type,
const std::vector<std::string>& pathVector, Directory& directory);
virtual ~CreateAction() = default;
/**
* @brief Executes the action
*/
virtual void execute() const override;
private:
const std::string name;
const std::string type;
const std::vector<std::string> pathVector;
Directory& parent;
};