Device Generator 1.0.3
Devices, browsers, user agents and IP addresses that fit together for C++23
Loading...
Searching...
No Matches
devicegen.hpp File Reference

Device Generator library — devices, browsers, user agents and IP addresses that fit together for C++23. More...

#include "core.hpp"
#include <algorithm>
#include <array>
#include <bit>
#include <chrono>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <filesystem>
#include <initializer_list>
#include <format>
#include <limits>
#include <map>
#include <numbers>
#include <optional>
#include <ranges>
#include <ostream>
#include <span>
#include <stdexcept>
#include <string>
#include <string_view>
#include <system_error>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

struct  dasmig::device_request
 What a device call asks for. More...
 
struct  dasmig::device_screen
 A screen in CSS pixels. More...
 
class  dasmig::device
 Return type for device generation. More...
 
class  dasmig::dvg
 Device Generator: devices whose model, OS, browser, user agent, screen and IP address fit together at a date. More...
 

Enumerations

enum class  dasmig::device_kind : std::uint8_t { phone , tablet , desktop , other }
 The form of a device. More...
 
enum class  dasmig::ip_version : std::uint8_t { any , v4 , v6 }
 Which IP family a device gets. More...
 
enum class  dasmig::device_table : std::uint8_t {
  countries , platforms , platform_shares , maker_shares ,
  models , releases , adoption , version_shares ,
  requirements , bundled , browser_shares , ua_templates ,
  screens , ipv4 , ipv6 , reserved
}
 The data tables of device-generator. Each is a TSV file in a tier directory and can be extended with layers. More...
 

Detailed Description

Device Generator library — devices, browsers, user agents and IP addresses that fit together for C++23.

Author
Diego Dasso Migotto (diegomigotto at hotmail dot com)
See also
See doc/usage.md for the narrative tutorial.

Definition in file devicegen.hpp.

Enumeration Type Documentation

◆ device_kind

enum class dasmig::device_kind : std::uint8_t
strong

The form of a device.

Enumerator
phone 

A phone.

tablet 

A tablet.

desktop 

A desktop or laptop computer.

other 

Anything else (no browser is modelled for it).

Definition at line 47 of file devicegen.hpp.

◆ device_table

enum class dasmig::device_table : std::uint8_t
strong

The data tables of device-generator. Each is a TSV file in a tier directory and can be extended with layers.

Enumerator
countries 

countries.tsv: population, internet and IPv6 shares.

platforms 

platforms.tsv: the platforms and their global shares.

platform_shares 

platform_shares.tsv: per-country shares, in percent.

maker_shares 

maker_shares.tsv: makers by country and platform.

models 

models.tsv: models, release dates, OS range, screen.

releases 

releases.tsv: OS and browser versions with dates.

adoption 

adoption.tsv: how fast versions and models spread.

version_shares 

version_shares.tsv: explicit OS version shares by date.

requirements 

requirements.tsv: the oldest OS a browser version runs on.

bundled 

bundled.tsv: the browser version an OS version ships with.

browser_shares 

browser_shares.tsv: browsers by OS and country.

ua_templates 

ua_templates.tsv: user-agent formats.

screens 

screens.tsv: screen sizes where the model has none.

ipv4 

ipv4.tsv: IPv4 blocks by country.

ipv6 

ipv6.tsv: IPv6 prefixes by country.

reserved 

reserved.tsv: the documentation ranges.

Definition at line 271 of file devicegen.hpp.

◆ ip_version

enum class dasmig::ip_version : std::uint8_t
strong

Which IP family a device gets.

Enumerator
any 

IPv6 with the country's IPv6 share, otherwise IPv4.

v4 

Always IPv4.

v6 

IPv6 where the country has prefixes, otherwise IPv4.

Definition at line 56 of file devicegen.hpp.