51Degrees Device Detection C/C++  4.1

A device detection library that is used natively or by 51Degrees products

FiftyoneDegrees::DeviceDetection::ConfigDeviceDetection Class Reference

Detailed Description

C++ class wrapper for the fiftyoneDegreesConfigDeviceDetection configuration structure.

See config-dd.h.

This extends the ConfigBase class to add device detection specific configuration options.

Configuration options are set using setter methods and fetched using corresponding getter methods. The names are self explanatory.

Usage Example

using namespace FiftyoneDegrees::Common;
// Construct a new configuration
// Configure the engine to return the matched substrings of a
User-Agent in the results up to a maximum of 500 characters
// Use the configuration when constructing an engine
config,
properties);

Inheritance diagram for FiftyoneDegrees::DeviceDetection::ConfigDeviceDetection:

[legend]

Collaboration diagram for FiftyoneDegrees::DeviceDetection::ConfigDeviceDetection:

[legend]

Public Member Functions

Constructors

 ConfigDeviceDetection (fiftyoneDegreesConfigDeviceDetection *config)
Constructs a new instance of the configuration with a reference to the C configuration provided. More...

Setters

void  setUpdateMatchedUserAgent (bool update)
Set whether or not the matched User-Agent should be constructed. More...
void  setMaxMatchedUserAgentLength (int length)
Set the maximum length string to be allocated to the matched User-Agent. More...
void  setAllowUnmatched (bool allow)
Set whether there should be at least one matched hash node (or substring) in order for the results to be considered valid. More...
bool  getUpdateMatchedUserAgent ()
Gets whether the characters matched during processing should be stored in results. More...
int  getMaxMatchedUserAgentLength ()
If the matched User-Agent characters should be stored the maximum number which should be available. More...
bool  getAllowUnmatched ()
Get whether there should be at least one matched hash node (or substring) in order for the results to be considered valid. More...

Public Member Functions inherited from FiftyoneDegrees::Common::ConfigBase

 ConfigBase (fiftyoneDegreesConfigBase *config)
Constructs a new instance of the configuration with a reference to the C configuration provided. More...
virtual  ~ConfigBase ()
Free any memory associated with temporary directories.
void  setUseUpperPrefixHeaders (bool use)
Set whether or not the HTTP header field might be prefixed with 'HTTP_'. More...
void  setUseTempFile (bool use)
Set whether or not a temporary file should be created from the original data file and used to initialise the data set. More...
void  setReuseTempFile (bool reuse)
Set whether or not a temporary file that already exists for a master file should be reused by another process. More...
void  setTempDirectories (vector< string > tempDirs)
Sets a collection of temporary directories to use if temporary file operation is required in the order in which the directories should be used. More...
bool  getUseUpperPrefixHeaders ()
Get whether or not an HTTP_ upper case prefixes should be considered when evaluating HTTP headers. More...
bool  getUseTempFile ()
Get whether or not a temporary file should be created from the original data file and used to initialise the data set. More...
bool  getReuseTempFile ()
Get whether temporary files can be reused across multiple processes. More...
vector< string >  getTempDirectories ()
Gets a vector of temporary directory strings which should be used to store temporary files. More...
virtual uint16_t  getConcurrency ()
Get the expected number of concurrent accessors of the data set. More...

Constructor & Destructor Documentation

◆ ConfigDeviceDetection()

FiftyoneDegrees::DeviceDetection::ConfigDeviceDetection::ConfigDeviceDetection ( fiftyoneDegreesConfigDeviceDetection *   config )

Constructs a new instance of the configuration with a reference to the C configuration provided.

Parameters
config - pointer to the underlying configuration structure

Member Function Documentation

◆ getAllowUnmatched()

bool FiftyoneDegrees::DeviceDetection::ConfigDeviceDetection::getAllowUnmatched ( )

Get whether there should be at least one matched hash node (or substring) in order for the results to be considered valid.

By default, this is false.

Returns
true if results with no matched hash nodes should be considered valid

◆ getMaxMatchedUserAgentLength()

int FiftyoneDegrees::DeviceDetection::ConfigDeviceDetection::getMaxMatchedUserAgentLength ( )

If the matched User-Agent characters should be stored the maximum number which should be available.

Returns
the number of characters to store if enabled, otherwise 0.

◆ getUpdateMatchedUserAgent()

bool FiftyoneDegrees::DeviceDetection::ConfigDeviceDetection::getUpdateMatchedUserAgent ( )

Gets whether the characters matched during processing should be stored in results.

Returns
true if the characters should be available, otherwise false.

◆ setAllowUnmatched()

void FiftyoneDegrees::DeviceDetection::ConfigDeviceDetection::setAllowUnmatched ( bool   allow )

Set whether there should be at least one matched hash node (or substring) in order for the results to be considered valid.

By default, this is false.

Parameters
allow - true if results with no matched hash nodes should be considered valid

◆ setMaxMatchedUserAgentLength()

void FiftyoneDegrees::DeviceDetection::ConfigDeviceDetection::setMaxMatchedUserAgentLength ( int   length )

Set the maximum length string to be allocated to the matched User-Agent.

This is only required if setUpdateMatchedUserAgent is set to true.

Parameters
length - to set

◆ setUpdateMatchedUserAgent()

void FiftyoneDegrees::DeviceDetection::ConfigDeviceDetection::setUpdateMatchedUserAgent ( bool   update )

Set whether or not the matched User-Agent should be constructed.

This is usually only needed for debugging User-Agents. If this is set to true then setMaxMatchedUserAgentLength must be used to provide the number of characters to record.

Parameters
update - should update the matched User-Agent

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