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
Inheritance diagram for FiftyoneDegrees::DeviceDetection::ConfigDeviceDetection:
Collaboration diagram for FiftyoneDegrees::DeviceDetection::ConfigDeviceDetection:
Public Member Functions | |
Constructors | |
| ConfigDeviceDetection (fiftyoneDegreesConfigDeviceDetection *config) | |
| Constructs a new instance of the configuration with a reference to the C configuration provided. | |
Setters | |
| void | setUpdateMatchedUserAgent (bool update) |
| Set whether or not the matched User-Agent should be constructed. | |
| void | setMaxMatchedUserAgentLength (int length) |
| Set the limit in bytes on the length of a single header such as User-Agent, of a pseudo header including the separators between its values, and of the matched User-Agent. | |
| 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. | |
| void | setProcessSpecialEvidence (bool process) |
| Set whether special evidence like getHighEntropyValues, Structured User Agents, or Device Ids, should be checked for during evidence processing. | |
| bool | getUpdateMatchedUserAgent () |
| Gets whether the characters matched during processing should be stored in results. | |
| int | getMaxMatchedUserAgentLength () |
| Get the limit in bytes on the length of a single header, a pseudo header and the matched User-Agent, as described in setMaxMatchedUserAgentLength. | |
| bool | getAllowUnmatched () |
| Get whether there should be at least one matched hash node (or substring) in order for the results to be considered valid. | |
| bool | getProcessSpecialEvidence () |
| Get whether special evidence like getHighEntropyValues, Structured User Agents, or Device Ids, should be checked for during evidence processing. | |
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. | |
| 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_'. | |
| 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. | |
| void | setReuseTempFile (bool reuse) |
| Set whether or not a temporary file that already exists for a master file should be reused by another process. | |
| 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. | |
| void | setPropertyValueIndex (bool index) |
| Set whether or not an index to speed up the retrieval of values for profiles and properties is created. | |
| bool | getUseUpperPrefixHeaders () const |
| Get whether or not an HTTP_ upper case prefixes should be considered when evaluating HTTP headers. | |
| bool | getUseTempFile () const |
| Get whether or not a temporary file should be created from the original data file and used to initialise the data set. | |
| bool | getReuseTempFile () const |
| Get whether temporary files can be reused across multiple processes. | |
| vector< string > | getTempDirectories () const |
| Gets a vector of temporary directory strings which should be used to store temporary files. | |
| bool | getPropertyValueIndex () const |
| Gets a flag indicating if an index of values for properties and profile is created. | |
| virtual uint16_t | getConcurrency () const |
| Get the expected number of concurrent accessors of the data set. | |
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 | ( | ) |
Get the limit in bytes on the length of a single header, a pseudo header and the matched User-Agent, as described in setMaxMatchedUserAgentLength.
- Returns
- the limit, whether or not the matched User-Agent is stored
◆ getProcessSpecialEvidence()
| bool FiftyoneDegrees::DeviceDetection::ConfigDeviceDetection::getProcessSpecialEvidence | ( | ) |
Get whether special evidence like getHighEntropyValues, Structured User Agents, or Device Ids, should be checked for during evidence processing.
By default, this is true.
- Returns
- true if special evidence will be processed
◆ 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 limit in bytes on the length of a single header such as User-Agent, of a pseudo header including the separators between its values, and of the matched User-Agent.
The working memory for a pseudo header is allocated from this value when a set of results is created, and detection does not grow it. A value longer than the limit is ignored and detection moves on to the next header. A direct User-Agent call over the limit gives the same results as evidence holding that value. The limit applies whether or not setUpdateMatchedUserAgent is true. The default is 500. To raise the limit set a larger value before the engine is created, which also raises the memory each set of results holds.
- Parameters
-
length to set
◆ setProcessSpecialEvidence()
| void FiftyoneDegrees::DeviceDetection::ConfigDeviceDetection::setProcessSpecialEvidence | ( | bool | process | ) |
Set whether special evidence like getHighEntropyValues, Structured User Agents, or Device Ids, should be checked for during evidence processing.
By default, this is true.
- Examples
- Hash/GettingStarted.cpp.
◆ 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:
