Class HostList
The HostList allows fast determination of whether a given host is in the list. It supports leading wildcards (e.g. .foo.com), and the special tokens <local> <nonlocal> and <loopback>. Note: List is *not threadsafe; instead of updating it, construct a new one.
Inheritance
Namespace: Fiddler
Assembly: FiddlerCore.dll
Syntax
public class HostList : Object
Constructors
HostList()
Generate an empty HostList
Declaration
public HostList()
HostList(String)
Create a hostlist and assign it an initial set of sites
Declaration
public HostList(string sInitialList)
Parameters
System. List of hostnames, including leading wildcards, and optional port specifier. Special tokens are *, <local>, <nonlocal>, and <loopback>. |
Methods
AssignFromString(String)
Clear the List and assign the new string as the contents of the list.
Declaration
public bool AssignFromString(string sIn)
Parameters
System. List of hostnames, including leading wildcards, and optional port specifier. Special tokens are *, <local>, <nonlocal>, and <loopback>. |
Returns
System. TRUE if the list was constructed without errors |
AssignFromString(String, out String)
Clear the list and assign the new string as the contents of the list.
Declaration
public bool AssignFromString(string sIn, out string sErrors)
Parameters
System. List of hostnames, including leading wildcards, and optional port specifier. Special tokens are *, <local>, <nonlocal>, and <loopback>. |
System. Outparam string containing list of parsing errors |
Returns
System. TRUE if the list was constructed without errors |
Clear()
Clear the HostList
Declaration
public void Clear()
ContainsHost(String)
Determine if a given Host is in the list
Declaration
public bool ContainsHost(string sHost)
Parameters
System. A Host string, potentially including a port |
Returns
System. TRUE if the Host's hostname matches a rule in the list |
ContainsHost(String, Int32)
Determine if a given Host:Port pair matches an entry in the list
Declaration
public bool ContainsHost(string sHostname, int iPort)
Parameters
System. A hostname, NOT including the port |
System. The port |
Returns
System. TRUE if the hostname matches a rule in the list |
ContainsHostname(String)
Determine if a given Hostname is in the list
Declaration
public bool ContainsHostname(string sHostname)
Parameters
System. A hostname, NOT including a port |
Returns
System. TRUE if the hostname matches a rule in the list |
ToString()
Return the current list of rules as a string
Declaration
public override string ToString()
Returns
System. String containing current rules, using "; " as a delimiter between entries |