X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Finspircd.h;h=f5c7dbafba02ca2f31981aa9e40b4111a583b1bf;hb=f2e3fd5952b23209b084bde4f464e6643c8a00ff;hp=a563edc7f89cbded8dcb00a53204b977d395b6bf;hpb=cc5aff3e5a7d83eb0154faf1540fc74959a6f0e5;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/include/inspircd.h b/include/inspircd.h index a563edc7f..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; @@ -502,6 +502,14 @@ 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.