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
Inherited Members
Namespace: Fiddler
Assembly: FiddlerCore.dll
Syntax
public class HostList
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.String
sInitialList
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.String
sIn
List of hostnames, including leading wildcards, and optional port specifier. Special tokens are *, <local>, <nonlocal>, and <loopback>. |
Returns
System.Boolean
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.String
sIn
List of hostnames, including leading wildcards, and optional port specifier. Special tokens are *, <local>, <nonlocal>, and <loopback>. |
System.String
sErrors
Outparam string containing list of parsing errors |
Returns
System.Boolean
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.String
sHost
A Host string, potentially including a port |
Returns
System.Boolean
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.String
sHostname
A hostname, NOT including the port |
System.Int32
iPort
The port |
Returns
System.Boolean
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.String
sHostname
A hostname, NOT including a port |
Returns
System.Boolean
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
String containing current rules, using "; " as a delimiter between entries |