חזור לתיקייה: actions

WriteAction

חיפוש בתיקיה
Ctrl K
לחץ כאן או הקש Ctrl K כדי לחפש בכל התיקיה

    WriteAction

    02340124

    מבוא לתכנות מערכות

    רשימות הרצאה לקריאה בשבת

    WriteAction

    הופק מתוך תקיית התואר של שקד

    uni-folder.vercel.app

    writeaction.h

    הערה (קובץ קוד)

    קובץ זה הוא קובץ קוד מסוג C.

    #pragma once
    
    #include <vector>
    
    #include "Action.h"
    #include "TextFile.h"
    
    /**
     * @class WriteAction
     * A subclass of Action, it allows the user to write to files, create or delete files and folders
     * and also, import files from the host system(writes from the host system to the file)
     * (yes, it's really confusing that read exports and write imports)
     */
    class WriteAction : public Action {
    public:
        virtual ~WriteAction() = default;
    
        /**
         * Creates the action with the necessary ingredients to write, delete, create or import.
         * @param file the file to be written to.
         * @param writeFrom the list(vector) of lines to write in it.
         */
        WriteAction(TextFile& file, const std::vector<std::string>& writeFrom);
    
        /**
         * @brief Executes the action
         */
        virtual void execute() const override;
    
    private:
        TextFile& file;
        const std::vector<std::string> from;
    };