InspIRCd  3.0
Public Member Functions | List of all members
irc::portparser Class Reference

#include <hashcomp.h>

Public Member Functions

 portparser (const std::string &source, bool allow_overlapped=true)
long GetToken ()

Detailed Description

The portparser class seperates out a port range into integers. A port range may be specified in the input string in the form "6660,6661,6662-6669,7020". The end of the stream is indicated by a return value of 0 from portparser::GetToken(). If you attempt to specify an illegal range (e.g. one where start >= end, or start or end < 0) then GetToken() will return the first element of the pair of numbers.

Constructor & Destructor Documentation

◆ portparser()

irc::portparser::portparser ( const std::string &  source,
bool  allow_overlapped = true 

Create a portparser and fill it with the provided data

sourceThe source text to parse from
allow_overlappedAllow overlapped ranges

Member Function Documentation

◆ GetToken()

long irc::portparser::GetToken ( )

Fetch the next token from the stream

The next port number is returned, or 0 if none remain

The documentation for this class was generated from the following files: