# HG changeset patch # User David Demelier # Date 1461174300 -7200 # Node ID 1125d90b3b44690775d9fca826e9af55d0be6cc7 # Parent 339808b0c0070201f4c26c6f17532635da959ba7 Misc: switch to .hpp, #477 diff -r 339808b0c007 -r 1125d90b3b44 cmake/IrccdSystem.cmake --- a/cmake/IrccdSystem.cmake Tue Apr 19 10:17:52 2016 +0200 +++ b/cmake/IrccdSystem.cmake Wed Apr 20 19:45:00 2016 +0200 @@ -253,19 +253,19 @@ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/irccd) configure_file( - ${CMAKE_CURRENT_LIST_DIR}/internal/sysconfig.h.in - ${CMAKE_BINARY_DIR}/irccd/sysconfig.h + ${CMAKE_CURRENT_LIST_DIR}/internal/sysconfig.hpp.in + ${CMAKE_BINARY_DIR}/irccd/sysconfig.hpp ) install( - FILES ${CMAKE_BINARY_DIR}/irccd/sysconfig.h + FILES ${CMAKE_BINARY_DIR}/irccd/sysconfig.hpp DESTINATION include/irccd ) # Also copy to fakedir if possible if (IRCCD_RELOCATABLE) file( - COPY ${CMAKE_BINARY_DIR}/irccd/sysconfig.h + COPY ${CMAKE_BINARY_DIR}/irccd/sysconfig.hpp DESTINATION ${IRCCD_FAKEDIR}/include/irccd ) endif () diff -r 339808b0c007 -r 1125d90b3b44 cmake/internal/sysconfig.h.in --- a/cmake/internal/sysconfig.h.in Tue Apr 19 10:17:52 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -/* - * sysconfig.h -- configuration for irccd - * - * Copyright (c) 2013-2016 David Demelier - * - * 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 IRCCD_SYSCONFIG_H -#define IRCCD_SYSCONFIG_H - -/* - * Fix annoying "Please include winsock2.h before windows.h" - */ -#if defined(_WIN32) -# include -# include -#endif - -/* - * Auto generated from CMake. - * ------------------------------------------------------------------ - */ - -#define PREFIX "@CMAKE_INSTALL_PREFIX@" - -#define IRCCD_VERSION_MAJOR @IRCCD_VERSION_MAJOR@ -#define IRCCD_VERSION_MINOR @IRCCD_VERSION_MINOR@ -#define IRCCD_VERSION_PATCH @IRCCD_VERSION_PATCH@ - -#cmakedefine IRCCD_RELOCATABLE - -/* - * System identification. - * ------------------------------------------------------------------ - */ - -#cmakedefine IRCCD_SYSTEM_WINDOWS -#cmakedefine IRCCD_SYSTEM_MAC -#cmakedefine IRCCD_SYSTEM_FREEBSD -#cmakedefine IRCCD_SYSTEM_NETBSD -#cmakedefine IRCCD_SYSTEM_OPENBSD -#cmakedefine IRCCD_SYSTEM_LINUX -#cmakedefine IRCCD_SYSTEM_UNKNOWN - -/* - * User definable options. - * ------------------------------------------------------------------ - */ - -#define WITH_BINDIR "@WITH_BINDIR@" -#define WITH_DATADIR "@WITH_DATADIR@" -#define WITH_CONFDIR "@WITH_CONFDIR@" -#define WITH_PLUGINDIR "@WITH_PLUGINDIR@" -#define WITH_CACHEDIR "@WITH_CACHEDIR@" - -#cmakedefine WITH_JS -#cmakedefine WITH_SSL - -/* - * Platform checks. - * ------------------------------------------------------------------ - */ - -#cmakedefine HAVE_ACCESS -#cmakedefine HAVE_DAEMON -#cmakedefine HAVE_GETPID -#cmakedefine HAVE_POPEN -#cmakedefine HAVE_SETGID -#cmakedefine HAVE_SETPROGNAME -#cmakedefine HAVE_SETUID -#cmakedefine HAVE_STD_PUT_TIME -#cmakedefine HAVE_STAT -#cmakedefine HAVE_STAT_ST_ATIME -#cmakedefine HAVE_STAT_ST_BLKSIZE -#cmakedefine HAVE_STAT_ST_BLOCKS -#cmakedefine HAVE_STAT_ST_CTIME -#cmakedefine HAVE_STAT_ST_DEV -#cmakedefine HAVE_STAT_ST_GID -#cmakedefine HAVE_STAT_ST_INO -#cmakedefine HAVE_STAT_ST_MODE -#cmakedefine HAVE_STAT_ST_MTIME -#cmakedefine HAVE_STAT_ST_NLINK -#cmakedefine HAVE_STAT_ST_RDEV -#cmakedefine HAVE_STAT_ST_SIZE -#cmakedefine HAVE_STAT_ST_UID -#cmakedefine HAVE_SYSLOG - -#endif // !IRCCD_SYSCONFIG_H diff -r 339808b0c007 -r 1125d90b3b44 cmake/internal/sysconfig.hpp.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cmake/internal/sysconfig.hpp.in Wed Apr 20 19:45:00 2016 +0200 @@ -0,0 +1,99 @@ +/* + * sysconfig.h -- configuration for irccd + * + * Copyright (c) 2013-2016 David Demelier + * + * 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 IRCCD_SYSCONFIG_H +#define IRCCD_SYSCONFIG_H + +/* + * Fix annoying "Please include winsock2.h before windows.h" + */ +#if defined(_WIN32) +# include +# include +#endif + +/* + * Auto generated from CMake. + * ------------------------------------------------------------------ + */ + +#define PREFIX "@CMAKE_INSTALL_PREFIX@" + +#define IRCCD_VERSION_MAJOR @IRCCD_VERSION_MAJOR@ +#define IRCCD_VERSION_MINOR @IRCCD_VERSION_MINOR@ +#define IRCCD_VERSION_PATCH @IRCCD_VERSION_PATCH@ + +#cmakedefine IRCCD_RELOCATABLE + +/* + * System identification. + * ------------------------------------------------------------------ + */ + +#cmakedefine IRCCD_SYSTEM_WINDOWS +#cmakedefine IRCCD_SYSTEM_MAC +#cmakedefine IRCCD_SYSTEM_FREEBSD +#cmakedefine IRCCD_SYSTEM_NETBSD +#cmakedefine IRCCD_SYSTEM_OPENBSD +#cmakedefine IRCCD_SYSTEM_LINUX +#cmakedefine IRCCD_SYSTEM_UNKNOWN + +/* + * User definable options. + * ------------------------------------------------------------------ + */ + +#define WITH_BINDIR "@WITH_BINDIR@" +#define WITH_DATADIR "@WITH_DATADIR@" +#define WITH_CONFDIR "@WITH_CONFDIR@" +#define WITH_PLUGINDIR "@WITH_PLUGINDIR@" +#define WITH_CACHEDIR "@WITH_CACHEDIR@" + +#cmakedefine WITH_JS +#cmakedefine WITH_SSL + +/* + * Platform checks. + * ------------------------------------------------------------------ + */ + +#cmakedefine HAVE_ACCESS +#cmakedefine HAVE_DAEMON +#cmakedefine HAVE_GETPID +#cmakedefine HAVE_POPEN +#cmakedefine HAVE_SETGID +#cmakedefine HAVE_SETPROGNAME +#cmakedefine HAVE_SETUID +#cmakedefine HAVE_STD_PUT_TIME +#cmakedefine HAVE_STAT +#cmakedefine HAVE_STAT_ST_ATIME +#cmakedefine HAVE_STAT_ST_BLKSIZE +#cmakedefine HAVE_STAT_ST_BLOCKS +#cmakedefine HAVE_STAT_ST_CTIME +#cmakedefine HAVE_STAT_ST_DEV +#cmakedefine HAVE_STAT_ST_GID +#cmakedefine HAVE_STAT_ST_INO +#cmakedefine HAVE_STAT_ST_MODE +#cmakedefine HAVE_STAT_ST_MTIME +#cmakedefine HAVE_STAT_ST_NLINK +#cmakedefine HAVE_STAT_ST_RDEV +#cmakedefine HAVE_STAT_ST_SIZE +#cmakedefine HAVE_STAT_ST_UID +#cmakedefine HAVE_SYSLOG + +#endif // !IRCCD_SYSCONFIG_H diff -r 339808b0c007 -r 1125d90b3b44 doc/procs/60.new-command.md --- a/doc/procs/60.new-command.md Tue Apr 19 10:17:52 2016 +0200 +++ b/doc/procs/60.new-command.md Wed Apr 20 19:45:00 2016 +0200 @@ -30,7 +30,7 @@ Inherit from `TransportCommand` and override the `exec` function. - #include "transport-command.h" + #include "transport-command.hpp" namespace irccd { @@ -57,7 +57,7 @@ Inherit from `Command` and override both `usage` and `exec` functions. - #include "command.h" + #include "command.hpp" namespace irccd { diff -r 339808b0c007 -r 1125d90b3b44 irccd/main.cpp --- a/irccd/main.cpp Tue Apr 19 10:17:52 2016 +0200 +++ b/irccd/main.cpp Wed Apr 20 19:45:00 2016 +0200 @@ -18,15 +18,15 @@ #include -#include +#include -#include -#include -#include -#include +#include +#include +#include +#include -#include -#include +#include +#include using namespace irccd; diff -r 339808b0c007 -r 1125d90b3b44 irccdctl/main.cpp --- a/irccdctl/main.cpp Tue Apr 19 10:17:52 2016 +0200 +++ b/irccdctl/main.cpp Wed Apr 20 19:45:00 2016 +0200 @@ -16,9 +16,9 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include -#include -#include +#include +#include +#include using namespace irccd; diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/CMakeSources.cmake --- a/lib/irccd/CMakeSources.cmake Tue Apr 19 10:17:52 2016 +0200 +++ b/lib/irccd/CMakeSources.cmake Wed Apr 20 19:45:00 2016 +0200 @@ -3,68 +3,68 @@ ${COMMAND_HEADERS} ${JS_HEADERS} ${PRIVATE_HEADERS} - ${CMAKE_CURRENT_LIST_DIR}/alias.h - ${CMAKE_CURRENT_LIST_DIR}/application.h - ${CMAKE_CURRENT_LIST_DIR}/connection.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-help.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-plugin-info.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-plugin-list.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-plugin-load.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-plugin-reload.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-plugin-unload.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-server-cmode.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-server-cnotice.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-server-connect.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-server-disconnect.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-server-info.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-server-invite.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-server-join.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-server-kick.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-server-list.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-server-me.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-server-message.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-server-mode.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-server-nick.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-server-notice.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-server-part.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-server-reconnect.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-server-topic.h - ${CMAKE_CURRENT_LIST_DIR}/cmd-watch.h - ${CMAKE_CURRENT_LIST_DIR}/command.h - ${CMAKE_CURRENT_LIST_DIR}/config.h - ${CMAKE_CURRENT_LIST_DIR}/elapsed-timer.h - ${CMAKE_CURRENT_LIST_DIR}/fs.h - ${CMAKE_CURRENT_LIST_DIR}/ini.h - ${CMAKE_CURRENT_LIST_DIR}/irccd.h - ${CMAKE_CURRENT_LIST_DIR}/irccdctl.h - ${CMAKE_CURRENT_LIST_DIR}/js.h - ${CMAKE_CURRENT_LIST_DIR}/json.h - ${CMAKE_CURRENT_LIST_DIR}/js-directory.h - ${CMAKE_CURRENT_LIST_DIR}/js-elapsed-timer.h - ${CMAKE_CURRENT_LIST_DIR}/js-file.h - ${CMAKE_CURRENT_LIST_DIR}/js-irccd.h - ${CMAKE_CURRENT_LIST_DIR}/js-logger.h - ${CMAKE_CURRENT_LIST_DIR}/js-plugin.h - ${CMAKE_CURRENT_LIST_DIR}/js-server.h - ${CMAKE_CURRENT_LIST_DIR}/js-system.h - ${CMAKE_CURRENT_LIST_DIR}/js-timer.h - ${CMAKE_CURRENT_LIST_DIR}/js-unicode.h - ${CMAKE_CURRENT_LIST_DIR}/js-util.h - ${CMAKE_CURRENT_LIST_DIR}/logger.h - ${CMAKE_CURRENT_LIST_DIR}/options.h - ${CMAKE_CURRENT_LIST_DIR}/path.h - ${CMAKE_CURRENT_LIST_DIR}/plugin.h - ${CMAKE_CURRENT_LIST_DIR}/rule.h - ${CMAKE_CURRENT_LIST_DIR}/server.h - ${CMAKE_CURRENT_LIST_DIR}/server-private.h - ${CMAKE_CURRENT_LIST_DIR}/server-state.h - ${CMAKE_CURRENT_LIST_DIR}/sockets.h - ${CMAKE_CURRENT_LIST_DIR}/system.h - ${CMAKE_CURRENT_LIST_DIR}/timer.h - ${CMAKE_CURRENT_LIST_DIR}/transport-client.h - ${CMAKE_CURRENT_LIST_DIR}/transport-server.h - ${CMAKE_CURRENT_LIST_DIR}/unicode.h - ${CMAKE_CURRENT_LIST_DIR}/util.h + ${CMAKE_CURRENT_LIST_DIR}/alias.hpp + ${CMAKE_CURRENT_LIST_DIR}/application.hpp + ${CMAKE_CURRENT_LIST_DIR}/connection.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-help.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-plugin-info.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-plugin-list.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-plugin-load.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-plugin-reload.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-plugin-unload.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-server-cmode.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-server-cnotice.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-server-connect.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-server-disconnect.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-server-info.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-server-invite.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-server-join.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-server-kick.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-server-list.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-server-me.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-server-message.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-server-mode.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-server-nick.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-server-notice.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-server-part.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-server-reconnect.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-server-topic.hpp + ${CMAKE_CURRENT_LIST_DIR}/cmd-watch.hpp + ${CMAKE_CURRENT_LIST_DIR}/command.hpp + ${CMAKE_CURRENT_LIST_DIR}/config.hpp + ${CMAKE_CURRENT_LIST_DIR}/elapsed-timer.hpp + ${CMAKE_CURRENT_LIST_DIR}/fs.hpp + ${CMAKE_CURRENT_LIST_DIR}/ini.hpp + ${CMAKE_CURRENT_LIST_DIR}/irccd.hpp + ${CMAKE_CURRENT_LIST_DIR}/irccdctl.hpp + ${CMAKE_CURRENT_LIST_DIR}/js.hpp + ${CMAKE_CURRENT_LIST_DIR}/json.hpp + ${CMAKE_CURRENT_LIST_DIR}/js-directory.hpp + ${CMAKE_CURRENT_LIST_DIR}/js-elapsed-timer.hpp + ${CMAKE_CURRENT_LIST_DIR}/js-file.hpp + ${CMAKE_CURRENT_LIST_DIR}/js-irccd.hpp + ${CMAKE_CURRENT_LIST_DIR}/js-logger.hpp + ${CMAKE_CURRENT_LIST_DIR}/js-plugin.hpp + ${CMAKE_CURRENT_LIST_DIR}/js-server.hpp + ${CMAKE_CURRENT_LIST_DIR}/js-system.hpp + ${CMAKE_CURRENT_LIST_DIR}/js-timer.hpp + ${CMAKE_CURRENT_LIST_DIR}/js-unicode.hpp + ${CMAKE_CURRENT_LIST_DIR}/js-util.hpp + ${CMAKE_CURRENT_LIST_DIR}/logger.hpp + ${CMAKE_CURRENT_LIST_DIR}/options.hpp + ${CMAKE_CURRENT_LIST_DIR}/path.hpp + ${CMAKE_CURRENT_LIST_DIR}/plugin.hpp + ${CMAKE_CURRENT_LIST_DIR}/rule.hpp + ${CMAKE_CURRENT_LIST_DIR}/server.hpp + ${CMAKE_CURRENT_LIST_DIR}/server-private.hpp + ${CMAKE_CURRENT_LIST_DIR}/server-state.hpp + ${CMAKE_CURRENT_LIST_DIR}/sockets.hpp + ${CMAKE_CURRENT_LIST_DIR}/system.hpp + ${CMAKE_CURRENT_LIST_DIR}/timer.hpp + ${CMAKE_CURRENT_LIST_DIR}/transport-client.hpp + ${CMAKE_CURRENT_LIST_DIR}/transport-server.hpp + ${CMAKE_CURRENT_LIST_DIR}/unicode.hpp + ${CMAKE_CURRENT_LIST_DIR}/util.hpp ) set( @@ -132,6 +132,6 @@ ) if (NOT IRCCD_SYSTEM_WINDOWS) - list(APPEND HEADERS ${CMAKE_CURRENT_LIST_DIR}/xdg.h) + list(APPEND HEADERS ${CMAKE_CURRENT_LIST_DIR}/xdg.hpp) list(APPEND SOURCES ${CMAKE_CURRENT_LIST_DIR}/xdg.cpp) endif () diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/alias.cpp --- a/lib/irccd/alias.cpp Tue Apr 19 10:17:52 2016 +0200 +++ b/lib/irccd/alias.cpp Wed Apr 20 19:45:00 2016 +0200 @@ -19,7 +19,7 @@ #include #include -#include "alias.h" +#include "alias.hpp" namespace irccd { diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/alias.h --- a/lib/irccd/alias.h Tue Apr 19 10:17:52 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,171 +0,0 @@ -/* - * alias.h -- create irccdctl aliases - * - * Copyright (c) 2013-2016 David Demelier - * - * 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 IRCCD_ALIAS_H -#define IRCCD_ALIAS_H - -/** - * @file alias.h - * @brief Create irccdctl aliases. - */ - -#include -#include -#include - -namespace irccd { - -/** - * @class AliasArg - * @brief Describe an alias argument. - * - * When the user specify arguments, it can precise an applied argument or a placeholder that will be substituted - * during command line invocation. - * - * Placeholders are placed using %n where n is an integer starting from 0. - */ -class AliasArg { -private: - std::string m_value; - bool m_isPlaceholder; - -public: - /** - * Construct an argument. - * - * @pre value must not be empty - * @param value the value - */ - AliasArg(std::string value); - - /** - * Check if the argument is a placeholder. - * - * @return true if the argument is a placeholder - */ - inline bool isPlaceholder() const noexcept - { - return m_isPlaceholder; - } - - /** - * Get the placeholder index (e.g %0 returns 0) - * - * @pre isPlaceholder() must return true - * @return the position - */ - unsigned index() const noexcept; - - /** - * Get the real value. - * - * @pre isPlaceholder() must return false - * @return the value - */ - const std::string &value() const noexcept; - - /** - * Output the alias to the stream. - * - * @param out the output stream - * @return out - */ - friend std::ostream &operator<<(std::ostream &out, const AliasArg &); -}; - -/** - * @class AliasCommand - * @brief Describe a user-provided alias command. - * - * An alias command is just a command with a set of applied or placeholders arguments. - */ -class AliasCommand { -private: - std::string m_command; - std::vector m_args; - -public: - /** - * Create an alias command. - * - * @param command the command - * @param args the arguments - */ - inline AliasCommand(std::string command, std::vector args = {}) noexcept - : m_command(std::move(command)) - , m_args(std::move(args)) - { - } - - /** - * Get the command to execute. - * - * @return the command name - */ - inline const std::string &command() const noexcept - { - return m_command; - } - - /** - * Get the arguments. - * - * @return the arguments - */ - inline const std::vector &args() const noexcept - { - return m_args; - } -}; - -/** - * @class Alias - * @brief A set of commands to execute with their arguments. - * - * An alias is a composition of AliasCommand, typically, the user is able to set an alias that execute a list of - * specified commands in order they are defined. - */ -class Alias : public std::vector { -private: - std::string m_name; - -public: - /** - * Create an alias. - * - * @param name the alias name - */ - inline Alias(std::string name) noexcept - : m_name(std::move(name)) - { - } - - /** - * Get the alias name. - * - * @return the name - */ - inline const std::string &name() const noexcept - { - return m_name; - } -}; - -} // !irccd - -#endif // !IRCCD_ALIAS_H diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/alias.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/irccd/alias.hpp Wed Apr 20 19:45:00 2016 +0200 @@ -0,0 +1,171 @@ +/* + * alias.hpp -- create irccdctl aliases + * + * Copyright (c) 2013-2016 David Demelier + * + * 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 IRCCD_ALIAS_HPP +#define IRCCD_ALIAS_HPP + +/** + * @file alias.hpp + * @brief Create irccdctl aliases. + */ + +#include +#include +#include + +namespace irccd { + +/** + * @class AliasArg + * @brief Describe an alias argument. + * + * When the user specify arguments, it can precise an applied argument or a placeholder that will be substituted + * during command line invocation. + * + * Placeholders are placed using %n where n is an integer starting from 0. + */ +class AliasArg { +private: + std::string m_value; + bool m_isPlaceholder; + +public: + /** + * Construct an argument. + * + * @pre value must not be empty + * @param value the value + */ + AliasArg(std::string value); + + /** + * Check if the argument is a placeholder. + * + * @return true if the argument is a placeholder + */ + inline bool isPlaceholder() const noexcept + { + return m_isPlaceholder; + } + + /** + * Get the placeholder index (e.g %0 returns 0) + * + * @pre isPlaceholder() must return true + * @return the position + */ + unsigned index() const noexcept; + + /** + * Get the real value. + * + * @pre isPlaceholder() must return false + * @return the value + */ + const std::string &value() const noexcept; + + /** + * Output the alias to the stream. + * + * @param out the output stream + * @return out + */ + friend std::ostream &operator<<(std::ostream &out, const AliasArg &); +}; + +/** + * @class AliasCommand + * @brief Describe a user-provided alias command. + * + * An alias command is just a command with a set of applied or placeholders arguments. + */ +class AliasCommand { +private: + std::string m_command; + std::vector m_args; + +public: + /** + * Create an alias command. + * + * @param command the command + * @param args the arguments + */ + inline AliasCommand(std::string command, std::vector args = {}) noexcept + : m_command(std::move(command)) + , m_args(std::move(args)) + { + } + + /** + * Get the command to execute. + * + * @return the command name + */ + inline const std::string &command() const noexcept + { + return m_command; + } + + /** + * Get the arguments. + * + * @return the arguments + */ + inline const std::vector &args() const noexcept + { + return m_args; + } +}; + +/** + * @class Alias + * @brief A set of commands to execute with their arguments. + * + * An alias is a composition of AliasCommand, typically, the user is able to set an alias that execute a list of + * specified commands in order they are defined. + */ +class Alias : public std::vector { +private: + std::string m_name; + +public: + /** + * Create an alias. + * + * @param name the alias name + */ + inline Alias(std::string name) noexcept + : m_name(std::move(name)) + { + } + + /** + * Get the alias name. + * + * @return the name + */ + inline const std::string &name() const noexcept + { + return m_name; + } +}; + +} // !irccd + +#endif // !IRCCD_ALIAS_HPP diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/application.cpp --- a/lib/irccd/application.cpp Tue Apr 19 10:17:52 2016 +0200 +++ b/lib/irccd/application.cpp Wed Apr 20 19:45:00 2016 +0200 @@ -16,31 +16,31 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include "application.h" -#include "cmd-help.h" -#include "cmd-plugin-info.h" -#include "cmd-plugin-list.h" -#include "cmd-plugin-load.h" -#include "cmd-plugin-reload.h" -#include "cmd-plugin-unload.h" -#include "cmd-server-cmode.h" -#include "cmd-server-cnotice.h" -#include "cmd-server-connect.h" -#include "cmd-server-disconnect.h" -#include "cmd-server-info.h" -#include "cmd-server-invite.h" -#include "cmd-server-join.h" -#include "cmd-server-kick.h" -#include "cmd-server-list.h" -#include "cmd-server-me.h" -#include "cmd-server-message.h" -#include "cmd-server-mode.h" -#include "cmd-server-nick.h" -#include "cmd-server-notice.h" -#include "cmd-server-part.h" -#include "cmd-server-reconnect.h" -#include "cmd-server-topic.h" -#include "cmd-watch.h" +#include "application.hpp" +#include "cmd-help.hpp" +#include "cmd-plugin-info.hpp" +#include "cmd-plugin-list.hpp" +#include "cmd-plugin-load.hpp" +#include "cmd-plugin-reload.hpp" +#include "cmd-plugin-unload.hpp" +#include "cmd-server-cmode.hpp" +#include "cmd-server-cnotice.hpp" +#include "cmd-server-connect.hpp" +#include "cmd-server-disconnect.hpp" +#include "cmd-server-info.hpp" +#include "cmd-server-invite.hpp" +#include "cmd-server-join.hpp" +#include "cmd-server-kick.hpp" +#include "cmd-server-list.hpp" +#include "cmd-server-me.hpp" +#include "cmd-server-message.hpp" +#include "cmd-server-mode.hpp" +#include "cmd-server-nick.hpp" +#include "cmd-server-notice.hpp" +#include "cmd-server-part.hpp" +#include "cmd-server-reconnect.hpp" +#include "cmd-server-topic.hpp" +#include "cmd-watch.hpp" namespace irccd { diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/application.h --- a/lib/irccd/application.h Tue Apr 19 10:17:52 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -/* - * application.h -- super base class to create irccd front ends - * - * Copyright (c) 2013-2016 David Demelier - * - * 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 IRCCD_APPLICATION_H -#define IRCCD_APPLICATION_H - -/** - * @file application.h - * @brief Base class for irccd and irccdctl. - */ - -#include -#include -#include - -#include "command.h" - -namespace irccd { - -/** - * Map of commands. - */ -using RemoteCommands = std::unordered_map>; - -/** - * @brief Base class for creating irccd front ends. - */ -class Application { -protected: - /** - * Map of commands. - */ - RemoteCommands m_commands; - -public: - /** - * Create the application and fill the commands with predefined commands. - */ - Application(); - - /** - * Access the remote commands. - * - * @return the commands - */ - inline const RemoteCommands &commands() const noexcept - { - return m_commands; - } - - /** - * Add a new command. - * - * @pre command must not be null - * @pre the command must not exist - * @param command the command - */ - inline void addCommand(std::unique_ptr command) - { - assert(command); - assert(m_commands.count(command->name()) == 0); - - m_commands.emplace(command->name(), std::move(command)); - } -}; - -} // !irccd - -#endif // !_IRCCD_APPLICATION_H_ diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/application.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/irccd/application.hpp Wed Apr 20 19:45:00 2016 +0200 @@ -0,0 +1,84 @@ +/* + * application.hpp -- super base class to create irccd front ends + * + * Copyright (c) 2013-2016 David Demelier + * + * 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 IRCCD_APPLICATION_HPP +#define IRCCD_APPLICATION_HPP + +/** + * @file application.hpp + * @brief Base class for irccd and irccdctl. + */ + +#include +#include +#include + +#include "command.hpp" + +namespace irccd { + +/** + * Map of commands. + */ +using RemoteCommands = std::unordered_map>; + +/** + * @brief Base class for creating irccd front ends. + */ +class Application { +protected: + /** + * Map of commands. + */ + RemoteCommands m_commands; + +public: + /** + * Create the application and fill the commands with predefined commands. + */ + Application(); + + /** + * Access the remote commands. + * + * @return the commands + */ + inline const RemoteCommands &commands() const noexcept + { + return m_commands; + } + + /** + * Add a new command. + * + * @pre command must not be null + * @pre the command must not exist + * @param command the command + */ + inline void addCommand(std::unique_ptr command) + { + assert(command); + assert(m_commands.count(command->name()) == 0); + + m_commands.emplace(command->name(), std::move(command)); + } +}; + +} // !irccd + +#endif // !_IRCCD_APPLICATION_HPP_ diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-help.cpp --- a/lib/irccd/cmd-help.cpp Tue Apr 19 10:17:52 2016 +0200 +++ b/lib/irccd/cmd-help.cpp Wed Apr 20 19:45:00 2016 +0200 @@ -16,10 +16,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include -#include +#include +#include -#include "cmd-help.h" +#include "cmd-help.hpp" namespace irccd { diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-help.h --- a/lib/irccd/cmd-help.h Tue Apr 19 10:17:52 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ -/* - * cmd-help.h -- implementation of irccdctl help - * - * Copyright (c) 2013-2016 David Demelier - * - * 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 IRCCD_CMD_HELP_H -#define IRCCD_CMD_HELP_H - -/** - * @file cmd-help.h - * @brief Implementation of irccdctl help. - */ - -#include "command.h" - -namespace irccd { - -namespace command { - -/** - * @class Help - * @brief Implementation of irccdctl help. - */ -class Help : public RemoteCommand { -public: - Help(); - - std::vector args() const override; - - /** - * @copydoc RemoteCommand::help - */ - std::string help() const override; - - /** - * @copydoc RemoteCommand::request - */ - json::Value request(Irccdctl &irccdctl, const RemoteCommandRequest &args) const override; -}; - -} // !command - -} // !irccd - -#endif // !IRCCD_CMD_HELP_H diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-help.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/irccd/cmd-help.hpp Wed Apr 20 19:45:00 2016 +0200 @@ -0,0 +1,58 @@ +/* + * cmd-help.hpp -- implementation of irccdctl help + * + * Copyright (c) 2013-2016 David Demelier + * + * 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 IRCCD_CMD_HPPELP_HPP +#define IRCCD_CMD_HPPELP_HPP + +/** + * @file cmd-help.hpp + * @brief Implementation of irccdctl help. + */ + +#include "command.hpp" + +namespace irccd { + +namespace command { + +/** + * @class Help + * @brief Implementation of irccdctl help. + */ +class Help : public RemoteCommand { +public: + Help(); + + std::vector args() const override; + + /** + * @copydoc RemoteCommand::help + */ + std::string help() const override; + + /** + * @copydoc RemoteCommand::request + */ + json::Value request(Irccdctl &irccdctl, const RemoteCommandRequest &args) const override; +}; + +} // !command + +} // !irccd + +#endif // !IRCCD_CMD_HPPELP_HPP diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-plugin-info.cpp --- a/lib/irccd/cmd-plugin-info.cpp Tue Apr 19 10:17:52 2016 +0200 +++ b/lib/irccd/cmd-plugin-info.cpp Wed Apr 20 19:45:00 2016 +0200 @@ -18,10 +18,10 @@ #include -#include +#include -#include "cmd-plugin-info.h" -#include "irccd.h" +#include "cmd-plugin-info.hpp" +#include "irccd.hpp" namespace irccd { diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-plugin-info.h --- a/lib/irccd/cmd-plugin-info.h Tue Apr 19 10:17:52 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,74 +0,0 @@ -/* - * cmd-plugin-info.h -- implementation of plugin-info command - * - * Copyright (c) 2013-2016 David Demelier - * - * 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 IRCCD_CMD_PLUGIN_INFO_H -#define IRCCD_CMD_PLUGIN_INFO_H - -/** - * @file cmd-plugin-info.h - * @brief Implementation of plugin-info transport command. - */ - -#include "command.h" - -namespace irccd { - -namespace command { - -/** - * @class PluginInfo - * @brief Implementation of plugin-info transport command. - */ -class PluginInfo : public RemoteCommand { -public: - /** - * Constructor. - */ - PluginInfo(); - - /** - * @copydoc RemoteCommand::help - */ - std::string help() const override; - - /** - * @copydoc RemoteCommand::args - */ - std::vector args() const override; - - /** - * @copydoc RemoteCommand::request - */ - json::Value request(Irccdctl &irccdctl, const RemoteCommandRequest &args) const override; - - /** - * @copydoc RemoteCommand::exec - */ - json::Value exec(Irccd &irccd, const json::Value &request) const override; - - /** - * @copydoc RemoteCommand::result - */ - void result(Irccdctl &irccdctl, const json::Value &response) const override; -}; - -} // !command - -} // !irccd - -#endif // !IRCCD_CMD_PLUGIN_INFO_H diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-plugin-info.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/irccd/cmd-plugin-info.hpp Wed Apr 20 19:45:00 2016 +0200 @@ -0,0 +1,74 @@ +/* + * cmd-plugin-info.hpp -- implementation of plugin-info command + * + * Copyright (c) 2013-2016 David Demelier + * + * 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 IRCCD_CMD_PLUGIN_INFO_HPP +#define IRCCD_CMD_PLUGIN_INFO_HPP + +/** + * @file cmd-plugin-info.hpp + * @brief Implementation of plugin-info transport command. + */ + +#include "command.hpp" + +namespace irccd { + +namespace command { + +/** + * @class PluginInfo + * @brief Implementation of plugin-info transport command. + */ +class PluginInfo : public RemoteCommand { +public: + /** + * Constructor. + */ + PluginInfo(); + + /** + * @copydoc RemoteCommand::help + */ + std::string help() const override; + + /** + * @copydoc RemoteCommand::args + */ + std::vector args() const override; + + /** + * @copydoc RemoteCommand::request + */ + json::Value request(Irccdctl &irccdctl, const RemoteCommandRequest &args) const override; + + /** + * @copydoc RemoteCommand::exec + */ + json::Value exec(Irccd &irccd, const json::Value &request) const override; + + /** + * @copydoc RemoteCommand::result + */ + void result(Irccdctl &irccdctl, const json::Value &response) const override; +}; + +} // !command + +} // !irccd + +#endif // !IRCCD_CMD_PLUGIN_INFO_HPP diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-plugin-list.cpp --- a/lib/irccd/cmd-plugin-list.cpp Tue Apr 19 10:17:52 2016 +0200 +++ b/lib/irccd/cmd-plugin-list.cpp Wed Apr 20 19:45:00 2016 +0200 @@ -18,10 +18,10 @@ #include -#include +#include -#include "cmd-plugin-list.h" -#include "irccd.h" +#include "cmd-plugin-list.hpp" +#include "irccd.hpp" namespace irccd { diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-plugin-list.h --- a/lib/irccd/cmd-plugin-list.h Tue Apr 19 10:17:52 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* - * cmd-plugin-list.h -- implementation of plugin-list transport command - * - * Copyright (c) 2013-2016 David Demelier - * - * 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 IRCCD_CMD_PLUGIN_LIST_H -#define IRCCD_CMD_PLUGIN_LIST_H - -/** - * @file cmd-plugin-list.h - * @brief Implementation of plugin-list transport command. - */ - -#include "command.h" - -namespace irccd { - -namespace command { - -/** - * @class PluginList - * @brief Implementation of plugin-list transport command. - */ -class PluginList : public RemoteCommand { -public: - /** - * Constructor. - */ - PluginList(); - - /** - * @copydoc RemoteCommand::help - */ - std::string help() const override; - - /** - * @copydoc RemoteCommand::exec - */ - json::Value exec(Irccd &irccd, const json::Value &request) const override; - - /** - * @copydoc RemoteCommand::result - */ - void result(Irccdctl &irccdctl, const json::Value &response) const override; -}; - -} // !command - -} // !irccd - -#endif // !IRCCD_CMD_PLUGIN_LIST_H diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-plugin-list.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/irccd/cmd-plugin-list.hpp Wed Apr 20 19:45:00 2016 +0200 @@ -0,0 +1,64 @@ +/* + * cmd-plugin-list.hpp -- implementation of plugin-list transport command + * + * Copyright (c) 2013-2016 David Demelier + * + * 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 IRCCD_CMD_PLUGIN_LIST_HPP +#define IRCCD_CMD_PLUGIN_LIST_HPP + +/** + * @file cmd-plugin-list.hpp + * @brief Implementation of plugin-list transport command. + */ + +#include "command.hpp" + +namespace irccd { + +namespace command { + +/** + * @class PluginList + * @brief Implementation of plugin-list transport command. + */ +class PluginList : public RemoteCommand { +public: + /** + * Constructor. + */ + PluginList(); + + /** + * @copydoc RemoteCommand::help + */ + std::string help() const override; + + /** + * @copydoc RemoteCommand::exec + */ + json::Value exec(Irccd &irccd, const json::Value &request) const override; + + /** + * @copydoc RemoteCommand::result + */ + void result(Irccdctl &irccdctl, const json::Value &response) const override; +}; + +} // !command + +} // !irccd + +#endif // !IRCCD_CMD_PLUGIN_LIST_HPP diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-plugin-load.cpp --- a/lib/irccd/cmd-plugin-load.cpp Tue Apr 19 10:17:52 2016 +0200 +++ b/lib/irccd/cmd-plugin-load.cpp Wed Apr 20 19:45:00 2016 +0200 @@ -16,10 +16,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include -#include "cmd-plugin-load.h" -#include "irccd.h" +#include "cmd-plugin-load.hpp" +#include "irccd.hpp" namespace irccd { diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-plugin-load.h --- a/lib/irccd/cmd-plugin-load.h Tue Apr 19 10:17:52 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* - * cmd-plugin-load.h -- implementation of plugin-load transport command - * - * Copyright (c) 2013-2016 David Demelier - * - * 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 IRCCD_CMD_PLUGIN_LOAD_H -#define IRCCD_CMD_PLUGIN_LOAD_H - -/** - * @file cmd-plugin-load.h - * @brief Implementation of plugin-load transport command. - */ - -#include "command.h" - -namespace irccd { - -namespace command { - -/** - * @class PluginLoad - * @brief Implementation of plugin-load transport command. - */ -class PluginLoad : public RemoteCommand { -public: - /** - * Constructor. - */ - PluginLoad(); - - /** - * @copydoc RemoteCommand::help - */ - std::string help() const override; - - /** - * @copydoc RemoteCommand::args - */ - std::vector args() const override; - - /** - * @copydoc RemoteCommand::exec - */ - json::Value exec(Irccd &irccd, const json::Value &request) const override; -}; - -} // !command - -} // !irccd - -#endif // !IRCCD_CMD_PLUGIN_LOAD_H diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-plugin-load.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/irccd/cmd-plugin-load.hpp Wed Apr 20 19:45:00 2016 +0200 @@ -0,0 +1,64 @@ +/* + * cmd-plugin-load.hpp -- implementation of plugin-load transport command + * + * Copyright (c) 2013-2016 David Demelier + * + * 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 IRCCD_CMD_PLUGIN_LOAD_HPP +#define IRCCD_CMD_PLUGIN_LOAD_HPP + +/** + * @file cmd-plugin-load.hpp + * @brief Implementation of plugin-load transport command. + */ + +#include "command.hpp" + +namespace irccd { + +namespace command { + +/** + * @class PluginLoad + * @brief Implementation of plugin-load transport command. + */ +class PluginLoad : public RemoteCommand { +public: + /** + * Constructor. + */ + PluginLoad(); + + /** + * @copydoc RemoteCommand::help + */ + std::string help() const override; + + /** + * @copydoc RemoteCommand::args + */ + std::vector args() const override; + + /** + * @copydoc RemoteCommand::exec + */ + json::Value exec(Irccd &irccd, const json::Value &request) const override; +}; + +} // !command + +} // !irccd + +#endif // !IRCCD_CMD_PLUGIN_LOAD_HPP diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-plugin-reload.cpp --- a/lib/irccd/cmd-plugin-reload.cpp Tue Apr 19 10:17:52 2016 +0200 +++ b/lib/irccd/cmd-plugin-reload.cpp Wed Apr 20 19:45:00 2016 +0200 @@ -16,10 +16,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include -#include "cmd-plugin-reload.h" -#include "irccd.h" +#include "cmd-plugin-reload.hpp" +#include "irccd.hpp" namespace irccd { diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-plugin-reload.h --- a/lib/irccd/cmd-plugin-reload.h Tue Apr 19 10:17:52 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* - * cmd-plugin-reload.h -- implementation of plugin-reload transport command - * - * Copyright (c) 2013-2016 David Demelier - * - * 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 IRCCD_CMD_PLUGIN_RELOAD_H -#define IRCCD_CMD_PLUGIN_RELOAD_H - -/** - * @file cmd-plugin-reload.h - * @brief Implementation of plugin-reload transport command. - */ - -#include "command.h" - -namespace irccd { - -namespace command { - -/** - * @class PluginReload - * @brief Implementation of plugin-reload transport command. - */ -class PluginReload : public RemoteCommand { -public: - /** - * Constructor. - */ - PluginReload(); - - /** - * @copydoc RemoteCommand::help - */ - std::string help() const override; - - /** - * @copydoc RemoteCommand::args - */ - std::vector args() const override; - - /** - * @copydoc RemoteCommand::exec - */ - json::Value exec(Irccd &irccd, const json::Value &request) const override; -}; - -} // !command - -} // !irccd - -#endif // !IRCCD_CMD_PLUGIN_RELOAD_H diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-plugin-reload.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/irccd/cmd-plugin-reload.hpp Wed Apr 20 19:45:00 2016 +0200 @@ -0,0 +1,64 @@ +/* + * cmd-plugin-reload.hpp -- implementation of plugin-reload transport command + * + * Copyright (c) 2013-2016 David Demelier + * + * 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 IRCCD_CMD_PLUGIN_RELOAD_HPP +#define IRCCD_CMD_PLUGIN_RELOAD_HPP + +/** + * @file cmd-plugin-reload.hpp + * @brief Implementation of plugin-reload transport command. + */ + +#include "command.hpp" + +namespace irccd { + +namespace command { + +/** + * @class PluginReload + * @brief Implementation of plugin-reload transport command. + */ +class PluginReload : public RemoteCommand { +public: + /** + * Constructor. + */ + PluginReload(); + + /** + * @copydoc RemoteCommand::help + */ + std::string help() const override; + + /** + * @copydoc RemoteCommand::args + */ + std::vector args() const override; + + /** + * @copydoc RemoteCommand::exec + */ + json::Value exec(Irccd &irccd, const json::Value &request) const override; +}; + +} // !command + +} // !irccd + +#endif // !IRCCD_CMD_PLUGIN_RELOAD_HPP diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-plugin-unload.cpp --- a/lib/irccd/cmd-plugin-unload.cpp Tue Apr 19 10:17:52 2016 +0200 +++ b/lib/irccd/cmd-plugin-unload.cpp Wed Apr 20 19:45:00 2016 +0200 @@ -16,10 +16,10 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include +#include -#include "cmd-plugin-unload.h" -#include "irccd.h" +#include "cmd-plugin-unload.hpp" +#include "irccd.hpp" namespace irccd { diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-plugin-unload.h --- a/lib/irccd/cmd-plugin-unload.h Tue Apr 19 10:17:52 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* - * cmd-plugin-unload.h -- implementation of plugin-unload transport command - * - * Copyright (c) 2013-2016 David Demelier - * - * 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 IRCCD_CMD_PLUGIN_UNLOAD_H -#define IRCCD_CMD_PLUGIN_UNLOAD_H - -/** - * @file cmd-plugin-unload.h - * @brief Implementation of plugin-unload transport command. - */ - -#include "command.h" - -namespace irccd { - -namespace command { - -/** - * @class PluginUnload - * @brief Implementation of plugin-unload transport command. - */ -class PluginUnload : public RemoteCommand { -public: - /** - * Constructor. - */ - PluginUnload(); - - /** - * @copydoc RemoteCommand::help - */ - std::string help() const override; - - /** - * @copydoc RemoteCommand::args - */ - std::vector args() const override; - - /** - * @copydoc RemoteCommand::exec - */ - json::Value exec(Irccd &irccd, const json::Value &request) const override; -}; - -} // !command - -} // !irccd - -#endif // !IRCCD_CMD_PLUGIN_UNLOAD_H diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-plugin-unload.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/irccd/cmd-plugin-unload.hpp Wed Apr 20 19:45:00 2016 +0200 @@ -0,0 +1,64 @@ +/* + * cmd-plugin-unload.hpp -- implementation of plugin-unload transport command + * + * Copyright (c) 2013-2016 David Demelier + * + * 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 IRCCD_CMD_PLUGIN_UNLOAD_HPP +#define IRCCD_CMD_PLUGIN_UNLOAD_HPP + +/** + * @file cmd-plugin-unload.hpp + * @brief Implementation of plugin-unload transport command. + */ + +#include "command.hpp" + +namespace irccd { + +namespace command { + +/** + * @class PluginUnload + * @brief Implementation of plugin-unload transport command. + */ +class PluginUnload : public RemoteCommand { +public: + /** + * Constructor. + */ + PluginUnload(); + + /** + * @copydoc RemoteCommand::help + */ + std::string help() const override; + + /** + * @copydoc RemoteCommand::args + */ + std::vector args() const override; + + /** + * @copydoc RemoteCommand::exec + */ + json::Value exec(Irccd &irccd, const json::Value &request) const override; +}; + +} // !command + +} // !irccd + +#endif // !IRCCD_CMD_PLUGIN_UNLOAD_HPP diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-server-cmode.cpp --- a/lib/irccd/cmd-server-cmode.cpp Tue Apr 19 10:17:52 2016 +0200 +++ b/lib/irccd/cmd-server-cmode.cpp Wed Apr 20 19:45:00 2016 +0200 @@ -16,8 +16,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include "cmd-server-cmode.h" -#include "irccd.h" +#include "cmd-server-cmode.hpp" +#include "irccd.hpp" namespace irccd { diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-server-cmode.h --- a/lib/irccd/cmd-server-cmode.h Tue Apr 19 10:17:52 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,64 +0,0 @@ -/* - * cmd-server-cmode.h -- implementation of server-cmode transport command - * - * Copyright (c) 2013-2016 David Demelier - * - * 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 IRCCD_CMD_SERVER_CMODE_H -#define IRCCD_CMD_SERVER_CMODE_H - -/** - * @file cmd-server-cmode.h - * @brief Implementation of server-cmode transport command. - */ - -#include "command.h" - -namespace irccd { - -namespace command { - -/** - * @class ServerChannelMode - * @brief Implementation of server-cmode transport command. - */ -class ServerChannelMode : public RemoteCommand { -public: - /** - * Constructor. - */ - ServerChannelMode(); - - /** - * @copydoc RemoteCommand::help - */ - std::string help() const override; - - /** - * @copydoc RemoteCommand::args - */ - std::vector args() const override; - - /** - * @copydoc RemoteCommand::exec - */ - json::Value exec(Irccd &irccd, const json::Value &request) const override; -}; - -} // !command - -} // !irccd - -#endif // !IRCCD_CMD_SERVER_CMODE_H diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-server-cmode.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/irccd/cmd-server-cmode.hpp Wed Apr 20 19:45:00 2016 +0200 @@ -0,0 +1,64 @@ +/* + * cmd-server-cmode.hpp -- implementation of server-cmode transport command + * + * Copyright (c) 2013-2016 David Demelier + * + * 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 IRCCD_CMD_SERVER_CMODE_HPP +#define IRCCD_CMD_SERVER_CMODE_HPP + +/** + * @file cmd-server-cmode.hpp + * @brief Implementation of server-cmode transport command. + */ + +#include "command.hpp" + +namespace irccd { + +namespace command { + +/** + * @class ServerChannelMode + * @brief Implementation of server-cmode transport command. + */ +class ServerChannelMode : public RemoteCommand { +public: + /** + * Constructor. + */ + ServerChannelMode(); + + /** + * @copydoc RemoteCommand::help + */ + std::string help() const override; + + /** + * @copydoc RemoteCommand::args + */ + std::vector args() const override; + + /** + * @copydoc RemoteCommand::exec + */ + json::Value exec(Irccd &irccd, const json::Value &request) const override; +}; + +} // !command + +} // !irccd + +#endif // !IRCCD_CMD_SERVER_CMODE_HPP diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-server-cnotice.cpp --- a/lib/irccd/cmd-server-cnotice.cpp Tue Apr 19 10:17:52 2016 +0200 +++ b/lib/irccd/cmd-server-cnotice.cpp Wed Apr 20 19:45:00 2016 +0200 @@ -16,8 +16,8 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include "cmd-server-cnotice.h" -#include "irccd.h" +#include "cmd-server-cnotice.hpp" +#include "irccd.hpp" namespace irccd { diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-server-cnotice.h --- a/lib/irccd/cmd-server-cnotice.h Tue Apr 19 10:17:52 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -/* - * cmd-server-cnotice.h -- implementation of server-cnotice transport command - * - * Copyright (c) 2013-2016 David Demelier - * - * 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 IRCCD_CMD_SERVER_CNOTICE_H -#define IRCCD_CMD_SERVER_CNOTICE_H - -/** - * @file cmd-server-cnotice.h - * @brief Implementation of server-cnotice transport command. - */ - -#include "command.h" - -namespace irccd { - -namespace command { - -/** - * @class ServerChannelNotice - * @brief Implementation of server-cnotice transport command. - * - * Send a channel notice to the specified channel. - * - * { - * "command": "server-cnotice", - * "server": "the server name", - * "channel": "name", - * "message": "the message" - * } - */ -class ServerChannelNotice : public RemoteCommand { -public: - /** - * Constructor. - */ - ServerChannelNotice(); - - /** - * @copydoc RemoteCommand::help - */ - std::string help() const override; - - /** - * @copydoc RemoteCommand::args - */ - std::vector args() const override; - - /** - * @copydoc RemoteCommand::exec - */ - json::Value exec(Irccd &irccd, const json::Value &request) const override; -}; - -} // !command - -} // !irccd - -#endif // !IRCCD_CMD_SERVER_CNOTICE_H diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-server-cnotice.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/lib/irccd/cmd-server-cnotice.hpp Wed Apr 20 19:45:00 2016 +0200 @@ -0,0 +1,73 @@ +/* + * cmd-server-cnotice.hpp -- implementation of server-cnotice transport command + * + * Copyright (c) 2013-2016 David Demelier + * + * 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 IRCCD_CMD_SERVER_CNOTICE_HPP +#define IRCCD_CMD_SERVER_CNOTICE_HPP + +/** + * @file cmd-server-cnotice.hpp + * @brief Implementation of server-cnotice transport command. + */ + +#include "command.hpp" + +namespace irccd { + +namespace command { + +/** + * @class ServerChannelNotice + * @brief Implementation of server-cnotice transport command. + * + * Send a channel notice to the specified channel. + * + * { + * "command": "server-cnotice", + * "server": "the server name", + * "channel": "name", + * "message": "the message" + * } + */ +class ServerChannelNotice : public RemoteCommand { +public: + /** + * Constructor. + */ + ServerChannelNotice(); + + /** + * @copydoc RemoteCommand::help + */ + std::string help() const override; + + /** + * @copydoc RemoteCommand::args + */ + std::vector args() const override; + + /** + * @copydoc RemoteCommand::exec + */ + json::Value exec(Irccd &irccd, const json::Value &request) const override; +}; + +} // !command + +} // !irccd + +#endif // !IRCCD_CMD_SERVER_CNOTICE_HPP diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-server-connect.cpp --- a/lib/irccd/cmd-server-connect.cpp Tue Apr 19 10:17:52 2016 +0200 +++ b/lib/irccd/cmd-server-connect.cpp Wed Apr 20 19:45:00 2016 +0200 @@ -18,10 +18,10 @@ #include -#include "cmd-server-connect.h" -#include "irccd.h" -#include "server.h" -#include "util.h" +#include "cmd-server-connect.hpp" +#include "irccd.hpp" +#include "server.hpp" +#include "util.hpp" namespace irccd { diff -r 339808b0c007 -r 1125d90b3b44 lib/irccd/cmd-server-connect.h --- a/lib/irccd/cmd-server-connect.h Tue Apr 19 10:17:52 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ -/* - * cmd-server-connect.h -- implementation of server-connect transport command - * - * Copyright (c) 2013-2016 David Demelier - * - * 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 IRCCD_CMD_SERVER_CONNECT_H -#define IRCCD_CMD_SERVER_CONNECT_H - -/** - * @file cmd-server-connect.h - * @brief Implementation of server-connect transport command. - */ - -#include "command.h" - -namespace irccd { - -namespace command { - -/** - * @class ServerConnect - * @brief Implementation of server-connect transport command. - */ -class ServerConnect : public RemoteCommand { -public: - /** - * Constructor. - */ - ServerConnect(); - - /** - * @copydoc RemoteCommand::help - */ - std::string help() const override; - - /** - * @copydoc RemoteCommand::options - */ - std::vector