Device

Classin device_detectioncompute-sdk-cpp 0.7.0View source

Include fastly/device_detection.h to use this class.

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

Methods

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

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

Returns

std::optional<std::string>

device_name

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

The name of the client device.

Returns

std::optional<std::string>
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.

Returns

std::optional<std::string>

is_desktop

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

The client is a desktop web browser.

Returns

std::optional<bool>

is_ereader

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

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

Returns

std::optional<bool>

is_gameconsole

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

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

Returns

std::optional<bool>

is_mediaplayer

View source
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).

Returns

std::optional<bool>

is_mobile

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

The client device is a mobile phone.

Returns

std::optional<bool>

is_smarttv

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

The client device is a smart TV.

Returns

std::optional<bool>

is_tablet

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

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

Returns

std::optional<bool>

is_touchscreen

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

The client device's screen is touch sensitive.

Returns

std::optional<bool>

is_tvplayer

View source
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).

Returns

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

The model of the client device.

Returns

std::optional<std::string>