SuperTuxKart
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
HardwareStats::Json Class Reference

A class to manage json data. More...

#include <hardware_stats.hpp>

Inheritance diagram for HardwareStats::Json:
Inheritance graph
[legend]

Public Member Functions

 Json ()
 Constructor.
 
const std::string sanitize (std::string value)
 
template<typename C >
void add (const std::string &key, const C &value)
 Adds a key-value pair to the json string.
 
void add (const std::string &key, const std::string &value)
 Specialisation for adding string values.
 
void add (const std::string &key, const char *s)
 Specialisation for adding character pointers.
 
void finish ()
 
std::string toString ()
 Returns the json data as one string.
 

Private Attributes

std::string m_data
 The accumulated json data.
 

Detailed Description

A class to manage json data.

Member Function Documentation

◆ add() [1/2]

void HardwareStats::Json::add ( const std::string &  key,
const char *  s 
)
inline

Specialisation for adding character pointers.

String values in are enclosed in "".

◆ add() [2/2]

void HardwareStats::Json::add ( const std::string &  key,
const std::string &  value 
)
inline

Specialisation for adding string values.

String values in are enclosed in "".


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