C# Класс FiftyOne.Foundation.Mobile.Detection.TrieProvider

Decision trie data structure provider.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Copyright string

Защищенные свойства (Protected)

Свойство Тип Описание
_properties byte[]
_propertyHttpHeaders List
_propertyIndex int>.Dictionary
_propertyNames List

Открытые методы

Метод Описание
Dispose ( ) : void

Disposes of all the resources used by the provider.

GetDeviceId ( int deviceIndex ) : string

Returns the device id matching the device index.

GetDeviceIndex ( string userAgent ) : int

Returns the index of the device associated with the given User-Agent. The index returned may vary across different versions of the source data file and should not be stored. The "Id" property will remain unique.

GetDeviceIndexes ( NameValueCollection headers ) : int>.IDictionary

Returns a collection of device indexes for each of the relevent HTTP headers provided. Those headers which are unrelated to device detection are ignored.

GetPropertyValue ( int>.IDictionary deviceIndexes, int propertyIndex ) : string

Returns the value of the property index provided from the device indexes provided. Matches the Http header to the property index.

GetPropertyValue ( int>.IDictionary deviceIndexes, string property ) : string

Returns the property value based on the device indexes provided.

GetPropertyValue ( NameValueCollection headers, string propertyName ) : string

Returns the value of the property for the User-Agent provided.

GetPropertyValue ( int deviceIndex, int propertyIndex ) : string

Returns the value of the property index provided for the device index provided.

GetPropertyValue ( int deviceIndex, string property ) : string

Returns the property value based on the device index provided.

GetPropertyValue ( string userAgent, string propertyName ) : string

Returns the value of the property for the User-Agent provided.

GetUserAgent ( string userAgent ) : string

Returns the User-Agent matched against the one provided.

SizeOfOffsets ( OffsetType offsetType ) : int

The number of bytes each offset takes.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Disposes of all the resources used by the provider.

GetStringValue ( int offset ) : string

Returns the string at the offset provided.

Приватные методы

Метод Описание
GetChild ( int lookupOffset, byte value ) : byte

Returns the offset in the node for the current character.

GetDeviceIndex ( BinaryReader reader, byte userAgent, int index, int parentDeviceIndex ) : int

Returns the offset in the device byte array to the device matching the useragent provided.

GetDeviceIndex ( BinaryReader reader, byte userAgent, int index, int parentDeviceIndex, StringBuilder matchedUserAgent ) : int

Returns the offset in the device byte array to the device matching the useragent provided.

GetUserAgentByteArray ( string userAgent ) : byte[]

Converts a User-Agent in to a null terminated byte array.

SetNextNodePosition ( BinaryReader reader, byte childIndex, byte numberOfChildren, OffsetType offsetType ) : void

Returns the position in the nodes stream of the next node.

TrieProvider ( string copyright, byte strings, byte properties, byte devices, byte lookupList, long nodesLength, long nodesOffset, Pool pool ) : System

Constructs a new instance of a tree provider.

Описание методов

Dispose() публичный Метод

Disposes of all the resources used by the provider.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Disposes of all the resources used by the provider.
protected Dispose ( bool disposing ) : void
disposing bool True if the calling method is Dispose, false for the finaliser.
Результат void

GetDeviceId() публичный Метод

Returns the device id matching the device index.
public GetDeviceId ( int deviceIndex ) : string
deviceIndex int Index of the device whose Id should be returned
Результат string

GetDeviceIndex() публичный Метод

Returns the index of the device associated with the given User-Agent. The index returned may vary across different versions of the source data file and should not be stored. The "Id" property will remain unique.
public GetDeviceIndex ( string userAgent ) : int
userAgent string
Результат int

GetDeviceIndexes() публичный Метод

Returns a collection of device indexes for each of the relevent HTTP headers provided. Those headers which are unrelated to device detection are ignored.
public GetDeviceIndexes ( NameValueCollection headers ) : int>.IDictionary
headers System.Collections.Specialized.NameValueCollection Collection of HTTP headers and values
Результат int>.IDictionary

GetPropertyValue() публичный Метод

Returns the value of the property index provided from the device indexes provided. Matches the Http header to the property index.
public GetPropertyValue ( int>.IDictionary deviceIndexes, int propertyIndex ) : string
deviceIndexes int>.IDictionary _indexes for the device.
propertyIndex int Index of the property required.
Результат string

GetPropertyValue() публичный Метод

Returns the property value based on the device indexes provided.
public GetPropertyValue ( int>.IDictionary deviceIndexes, string property ) : string
deviceIndexes int>.IDictionary Http headers and their device index.
property string The name of the property required.
Результат string

GetPropertyValue() публичный Метод

Returns the value of the property for the User-Agent provided.
public GetPropertyValue ( NameValueCollection headers, string propertyName ) : string
headers System.Collections.Specialized.NameValueCollection Collection of HTTP headers and values
propertyName string Name of the property required
Результат string

GetPropertyValue() публичный Метод

Returns the value of the property index provided for the device index provided.
public GetPropertyValue ( int deviceIndex, int propertyIndex ) : string
deviceIndex int Index for the device.
propertyIndex int Index of the property required.
Результат string

GetPropertyValue() публичный Метод

Returns the property value based on the device index provided.
public GetPropertyValue ( int deviceIndex, string property ) : string
deviceIndex int The index of the device whose property should be returned.
property string The name of the property required.
Результат string

GetPropertyValue() публичный Метод

Returns the value of the property for the User-Agent provided.
public GetPropertyValue ( string userAgent, string propertyName ) : string
userAgent string User agent of the request
propertyName string Name of the property required
Результат string

GetStringValue() защищенный Метод

Returns the string at the offset provided.
protected GetStringValue ( int offset ) : string
offset int
Результат string

GetUserAgent() публичный Метод

Returns the User-Agent matched against the one provided.
public GetUserAgent ( string userAgent ) : string
userAgent string
Результат string

SizeOfOffsets() публичный статический Метод

The number of bytes each offset takes.
public static SizeOfOffsets ( OffsetType offsetType ) : int
offsetType OffsetType
Результат int

Описание свойств

Copyright публичное свойство

The copy right notice associated with the data file.
public string Copyright
Результат string

_properties защищенное свойство

Byte array of the available properties.
protected byte[] _properties
Результат byte[]

_propertyHttpHeaders защищенное свойство

List of Http headers for each property index.
protected List _propertyHttpHeaders
Результат List

_propertyIndex защищенное свойство

Dictionary of property names to indexes.
protected Dictionary _propertyIndex
Результат int>.Dictionary

_propertyNames защищенное свойство

List of the available property names.
protected List _propertyNames
Результат List