Mercurial > irccd
view irccdctl/command.h @ 48:ce3e96deb9e4
Plugin roulette: document missing keywords and fix count, #392
author | David Demelier <markand@malikania.fr> |
---|---|
date | Mon, 29 Feb 2016 13:13:56 +0100 |
parents | 1158cffe5a5e |
children |
line wrap: on
line source
/* * command.h -- irccdctl command * * Copyright (c) 2013-2016 David Demelier <markand@malikania.fr> * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef _IRCCDCTL_COMMAND_H_ #define _IRCCDCTL_COMMAND_H_ /** * @file command.h * @brief Irccdctl base command class. */ #include <vector> #include <sstream> #include <string> #include <logger.h> #include <system.h> #include "irccdctl.h" namespace irccd { class Irccdctl; /** * @class Command * @brief Irccdctl base command class. */ class Command { public: /** * Virtual destructor defaulted. */ virtual ~Command() = default; /** * Show the command line help. * * @param irccdctl the irccdctl instance */ virtual void usage(Irccdctl &irccdctl) const = 0; /** * Execute the function with the command line given arguments. * * The function can throw anything. * * @param irccdctl the irccdctl instance * @param args the command line arguments */ virtual void exec(Irccdctl &irccdctl, const std::vector<std::string> &args) const = 0; }; } // !irccd #endif // !_IRCCDCTL_COMMAND_H_