\r\n

51Degrees Device Detection C/C++  4.5

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

fiftyoneDegreesTransformIterateResult Struct Reference

Detailed Description

User-Agent Client Hints (UACH) Representation Conversion Routines.

3 common ways to represent UACH are:

  • HTTP header map
  • getHighEntropyValues() JS API call result in JSON format
  • Structured User Agent Object from OpenRTB 2.6

Links:

51Degrees uses HTTP header map to represent UACH and expects the evidence to be provided as HTTP headers (or same name query parameters). The header names in question are:

  • Sec-CH-UA
  • Sec-CH-UA-Platform
  • Sec-CH-UA-Mobile
  • Sec-CH-UA-Model
  • Sec-CH-UA-Full-Version-List
  • Sec-CH-UA-Platform-Version
  • Sec-CH-UA-Arch
  • Sec-CH-UA-Bitness

The conversion routines transform the GetHighEntropyValues (GHEV) or Structured User Agent (SUA) SUA input into the HTTP header maps.

Routines are provided in 2 styles: iterative (for potentially lazy consumption) and array-results (for eager consumption). The former uses callback to iteratively provide header name-value pairs to the caller, the latter provides the whole header map array as output. In addition 2 variants of GHEV routine is provided: one that accepts a raw JSON string and one that accepts a base64 encoded JSON string as input parameter.

Both styles use an externally preallocated memory buffer to write the formed http header values to. The output callback or headermap will have pointers to the null-terminated strings stored in that buffer. Thus the buffer should outlive the last output evidence use.Used as a return type from the conversion routines to carry information about the operation results to the caller, allows the caller to f.e. judge about the buffer utilization, and whether the buffer was of sufficient size

Data Fields

uint32_t  iterations
number of pairs of evidence extracted or would have been extracted and correspondingly calls to the callback made
size_t  written
number of characters written or that would have been written to the buffer, reflects required buffer size
bool  bufferTooSmall
the caller should check this flag and reallocate the buffer to be of at least written size if this flag is set

The documentation for this struct was generated from the following file:
  • /home/runner/work/device-detection-cxx/device-detection-cxx/common/device-detection-cxx/src/transform.h
On This Page