game_launcher 1.1.0
Modern Linux game launcher with Steam / Proton / Wine integration
Loading...
Searching...
No Matches
performance_profile_service.cpp File Reference
#include "performance_profile_service.h"
#include "logger.h"
#include <algorithm>
#include <ctime>
#include <filesystem>
#include <fstream>
#include <iomanip>
#include <sstream>
#include <utility>
#include <uuid/uuid.h>
Include dependency graph for performance_profile_service.cpp:

Go to the source code of this file.

Classes

class  PerformanceProfileService::Impl

Functions

static std::string generateUUID ()
static std::string jsonEscape (const std::string &str)
static std::pair< size_t, size_t > jsonFindObject (const std::string &json, const std::string &key, size_t start=0, size_t end=std::string::npos)
static bool jsonParseBool (const std::string &json, const std::string &key, size_t start=0, size_t end=std::string::npos, bool def=false)
static double jsonParseDouble (const std::string &json, const std::string &key, size_t start=0, size_t end=std::string::npos, double def=0.0)
static int jsonParseInt (const std::string &json, const std::string &key, size_t start=0, size_t end=std::string::npos, int def=0)
static long long jsonParseLong (const std::string &json, const std::string &key, size_t start=0, size_t end=std::string::npos, long long def=0)
static PerformanceProfile jsonParseProfile (const std::string &json, size_t ps, size_t pe)
static std::string jsonParseStr (const std::string &json, const std::string &key, size_t start=0, size_t end=std::string::npos)
std::string performancePresetName (PerformancePreset preset)
 Get human-readable preset name.

Function Documentation

◆ generateUUID()

◆ jsonEscape()

std::string jsonEscape ( const std::string & str)
static

◆ jsonFindObject()

std::pair< size_t, size_t > jsonFindObject ( const std::string & json,
const std::string & key,
size_t start = 0,
size_t end = std::string::npos )
static

Definition at line 151 of file performance_profile_service.cpp.

Referenced by jsonParseProfile().

◆ jsonParseBool()

bool jsonParseBool ( const std::string & json,
const std::string & key,
size_t start = 0,
size_t end = std::string::npos,
bool def = false )
static

Definition at line 132 of file performance_profile_service.cpp.

Referenced by jsonParseProfile().

◆ jsonParseDouble()

double jsonParseDouble ( const std::string & json,
const std::string & key,
size_t start = 0,
size_t end = std::string::npos,
double def = 0.0 )
static

◆ jsonParseInt()

int jsonParseInt ( const std::string & json,
const std::string & key,
size_t start = 0,
size_t end = std::string::npos,
int def = 0 )
static

◆ jsonParseLong()

long long jsonParseLong ( const std::string & json,
const std::string & key,
size_t start = 0,
size_t end = std::string::npos,
long long def = 0 )
static

Definition at line 70 of file performance_profile_service.cpp.

Referenced by jsonParseProfile().

◆ jsonParseProfile()

◆ jsonParseStr()

std::string jsonParseStr ( const std::string & json,
const std::string & key,
size_t start = 0,
size_t end = std::string::npos )
static

◆ performancePresetName()

std::string performancePresetName ( PerformancePreset preset)

Get human-readable preset name.

Definition at line 1305 of file performance_profile_service.cpp.

References Balanced, BatteryLife, Compatibility, Custom, Performance, Quality, and Silent.

Referenced by PerformanceProfileService::createFromPreset().