diff --git a/src/commands/Command.cpp b/src/commands/Command.cpp index e203dc542..4345d9d42 100644 --- a/src/commands/Command.cpp +++ b/src/commands/Command.cpp @@ -68,6 +68,12 @@ Command& Command::operator= (const Command& other) return *this; } +//////////////////////////////////////////////////////////////////////////////// +bool Command::read_only () const +{ + return false; +} + //////////////////////////////////////////////////////////////////////////////// bool Command::operator== (const Command& other) const { diff --git a/src/commands/Command.h b/src/commands/Command.h index c8247dfb4..d45a6f255 100644 --- a/src/commands/Command.h +++ b/src/commands/Command.h @@ -36,12 +36,13 @@ public: Command (const Command&); Command& operator= (const Command&); bool operator== (const Command&) const; // TODO Is this necessary? - ~Command (); + virtual ~Command (); static Command* factory (const std::string&); - bool implements (const std::string&) const; - std::string execute (const std::string&); + virtual bool read_only () const; + virtual bool implements (const std::string&) const = 0; + virtual std::string execute (const std::string&) = 0; private: }; diff --git a/src/commands/Install.cpp b/src/commands/Install.cpp index 2f8717acf..d99ea85db 100644 --- a/src/commands/Install.cpp +++ b/src/commands/Install.cpp @@ -33,6 +33,9 @@ extern Context context; //////////////////////////////////////////////////////////////////////////////// Install::Install () +/* +: _name ("") +*/ { } @@ -77,12 +80,23 @@ Install::~Install () } //////////////////////////////////////////////////////////////////////////////// -bool Install::implements (const std::string&) const +bool Install::read_only () const { return false; } //////////////////////////////////////////////////////////////////////////////// +bool Install::implements (const std::string& command_line) const +{ + return false; +} + +//////////////////////////////////////////////////////////////////////////////// +// Algorithm: +// Copy file rc.data.location/extensions +// Generate UUID +// Call the "install" function once, store results in rc: +// extension.= std::string Install::execute (const std::string&) { return "output"; diff --git a/src/commands/Install.h b/src/commands/Install.h index 19739539f..c440b7942 100644 --- a/src/commands/Install.h +++ b/src/commands/Install.h @@ -39,6 +39,7 @@ public: bool operator== (const Install&) const; // TODO Is this necessary? ~Install (); + bool read_only () const; bool implements (const std::string&) const; std::string execute (const std::string&);