Fastly Compute C++ SDK
Loading...
Searching...
No Matches
fastly::device_detection::Device Class Reference

The device data associated with a particular User-Agent string. More...

#include <device_detection.h>

Public Member Functions

std::optional< std::string > device_name ()
 The name of the client device.
std::optional< std::string > brand ()
std::optional< std::string > model ()
 The model of the client device.
std::optional< std::string > hwtype ()
std::optional< bool > is_ereader ()
 The client device is a reading device (like a Kindle).
std::optional< bool > is_gameconsole ()
 The client device is a video game console (like a PlayStation or Xbox).
std::optional< bool > is_mediaplayer ()
std::optional< bool > is_mobile ()
 The client device is a mobile phone.
std::optional< bool > is_smarttv ()
 The client device is a smart TV.
std::optional< bool > is_tablet ()
 The client device is a tablet (like an iPad).
std::optional< bool > is_tvplayer ()
std::optional< bool > is_desktop ()
 The client is a desktop web browser.
std::optional< bool > is_touchscreen ()
 The client device's screen is touch sensitive.

Friends

fastly::expected< std::optional< Device > > lookup (std::string_view user_agent)
 Look up the data associated with a particular User-Agent string.

Detailed Description

The device data associated with a particular User-Agent string.

Member Function Documentation

◆ brand()

std::optional< std::string > fastly::device_detection::Device::brand ( )

The brand of the client device, possibly different from the manufacturer of that device.

◆ device_name()

std::optional< std::string > fastly::device_detection::Device::device_name ( )

The name of the client device.

◆ hwtype()

std::optional< std::string > fastly::device_detection::Device::hwtype ( )

A string representation of the primary client platform hardware. The most commonly used device types are also identified via boolean variables. Because a device may have multiple device types and this variable only has the primary type, we recommend using the boolean variables for logic and using this string representation for logging.

◆ is_desktop()

std::optional< bool > fastly::device_detection::Device::is_desktop ( )

The client is a desktop web browser.

◆ is_ereader()

std::optional< bool > fastly::device_detection::Device::is_ereader ( )

The client device is a reading device (like a Kindle).

◆ is_gameconsole()

std::optional< bool > fastly::device_detection::Device::is_gameconsole ( )

The client device is a video game console (like a PlayStation or Xbox).

◆ is_mediaplayer()

std::optional< bool > fastly::device_detection::Device::is_mediaplayer ( )

The client device is a media player (like Blu-ray players, iPod devices, and smart speakers such as Amazon Echo).

◆ is_mobile()

std::optional< bool > fastly::device_detection::Device::is_mobile ( )

The client device is a mobile phone.

◆ is_smarttv()

std::optional< bool > fastly::device_detection::Device::is_smarttv ( )

The client device is a smart TV.

◆ is_tablet()

std::optional< bool > fastly::device_detection::Device::is_tablet ( )

The client device is a tablet (like an iPad).

◆ is_touchscreen()

std::optional< bool > fastly::device_detection::Device::is_touchscreen ( )

The client device's screen is touch sensitive.

◆ is_tvplayer()

std::optional< bool > fastly::device_detection::Device::is_tvplayer ( )

The client device is a set-top box or other TV player (like a Roku or Apple TV).

◆ model()

std::optional< std::string > fastly::device_detection::Device::model ( )

The model of the client device.

◆ lookup

fastly::expected< std::optional< Device > > lookup ( std::string_view user_agent)
friend

Look up the data associated with a particular User-Agent string.


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