X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Finspircd.h;h=f5c7dbafba02ca2f31981aa9e40b4111a583b1bf;hb=0a229e70a5839b30d87f3585429d542db37c4cfd;hp=90ee6ca8d93b45d372b13345b98d32d5859246f4;hpb=b2ac8cc0a6405946a388b80df3be21bc276a61f3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/inspircd.h b/include/inspircd.h index 90ee6ca8d..f5c7dbafb 100644 --- a/include/inspircd.h +++ b/include/inspircd.h @@ -284,7 +284,7 @@ class CoreExport InspIRCd */ TimerManager Timers; - /** X-Line manager. Handles G/K/Q/E line setting, removal and matching + /** X-line manager. Handles G/K/Q/E-line setting, removal and matching */ XLineManager* XLines; @@ -348,9 +348,9 @@ class CoreExport InspIRCd static void DefaultGenRandom(char* output, size_t max); /** Bind to a specific port from a config tag. - * @param Tag the tag that contains bind information. + * @param tag the tag that contains bind information. * @param sa The endpoint to listen on. - * @params old_ports Previously listening ports that may be on the same endpoint. + * @param old_ports Previously listening ports that may be on the same endpoint. */ bool BindPort(ConfigTag* tag, const irc::sockets::sockaddrs& sa, std::vector& old_ports); @@ -502,6 +502,20 @@ class CoreExport InspIRCd */ static unsigned long Duration(const std::string& str); + /** Calculate a duration in seconds from a string in the form 1y2w3d4h6m5s + * @param str A string containing a time in the form 1y2w3d4h6m5s + * (one year, two weeks, three days, four hours, six minutes and five seconds) + * @param duration The location to place the parsed duration valur + * @return Whether the duration was a valid format or not + */ + static bool Duration(const std::string& str, unsigned long& duration); + + /** Determines whether a string contains a valid duration. + * @param str A string containing a time in the form 1y2w3d4h6m5s + * @return True if the string is a valid duration; otherwise, false. + */ + static bool IsValidDuration(const std::string& str); + /** Attempt to compare a password to a string from the config file. * This will be passed to handling modules which will compare the data * against possible hashed equivalents in the input string. @@ -574,21 +588,6 @@ class CoreExport InspIRCd ENTRYPOINT; -template -class CommandModule : public Module -{ - Cmd cmd; - public: - CommandModule() : cmd(this) - { - } - - Version GetVersion() CXX11_OVERRIDE - { - return Version(cmd.name, VF_VENDOR|VF_CORE); - } -}; - inline void stdalgo::culldeleter::operator()(classbase* item) { if (item)