DNSNameSet objects

A DNSNameSet object is a set of DNSName objects. Based on std::unordered_set (hash table). Creating a DNSName is done with the newDNSNameSet():

myset = newDNSNameSet()

The set can be filled by func:DNSNameSet:add:

myset:add(newDNSName("domain1.tld"))
myset:add(newDNSName("domain2.tld"))

Functions and methods of a DNSNameSet

newDNSNameSet() → DNSNameSet

Returns the DNSNameSet.

class DNSNameSet

A DNSNameSet object is a set of DNSName objects.

:add(name)

Adds the name to the set.

Parameters:name (DNSName) – The name to add.
:empty() → bool

Returns true is the DNSNameSet is empty.

:clear()

Clean up the set.

:toString() → string

Returns a human-readable form of the DNSNameSet.

:size() → int

Returns the number of names in the set.

:delete(name) → int

Removes the name from the set. Returns the number of deleted elements.

Parameters:name (DNSName) – The name to remove.
:check(name) → bool

Returns true if the set contains the name.

Parameters:name (DNSName) – The name to check.