MythTV  master
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
RecExtDataPage Class Referenceabstract

#include <recordingextender.h>

Inheritance diagram for RecExtDataPage:
Inheritance graph
[legend]
Collaboration diagram for RecExtDataPage:
Collaboration graph
[legend]

Public Member Functions

RecExtDataSourcegetSource ()
 
virtual QDateTime getNow ()
 Get the current time. Overridden by the testing code. More...
 
virtual bool timeIsClose (const QDateTime &eventStart)
 Base Classes ///. More...
 
virtual bool findGameInfo (ActiveGame &game)=0
 
virtual GameState findGameScore (ActiveGame &game)=0
 
QJsonDocument getDoc ()
 Get the JSON document associated with this object. More...
 
 RecExtDataPage (QObject *parent, QJsonDocument doc)
 Create a new RecExtDataPage object. More...
 

Static Public Member Functions

static QJsonObject walkJsonPath (QJsonObject &object, const QStringList &path)
 Iterate through a json object and return the specified object. More...
 
static bool getJsonInt (const QJsonObject &object, QStringList &path, int &value)
 Retrieve the specified integer from a json object. More...
 
static bool getJsonInt (const QJsonObject &object, const QString &key, int &value)
 Retrieve the specified integer from a json object. More...
 
static bool getJsonString (const QJsonObject &object, QStringList &path, QString &value)
 Retrieve the specified string from a json object. More...
 
static bool getJsonString (const QJsonObject &object, const QString &key, QString &value)
 Retrieve the specified string from a json object. More...
 
static bool getJsonObject (const QJsonObject &object, QStringList &path, QJsonObject &value)
 Retrieve a specific object from another json object. More...
 
static bool getJsonObject (const QJsonObject &object, const QString &key, QJsonObject &value)
 Retrieve a specific object from another json object. More...
 
static bool getJsonArray (const QJsonObject &object, const QString &key, QJsonArray &value)
 Retrieve the specified array from a json object. More...
 

Protected Attributes

QJsonDocument m_doc
 

Detailed Description

Definition at line 161 of file recordingextender.h.

Constructor & Destructor Documentation

◆ RecExtDataPage()

RecExtDataPage::RecExtDataPage ( QObject *  parent,
QJsonDocument  doc 
)
inline

Create a new RecExtDataPage object.

Parameters
docThe JSON document to associate with this object.

Definition at line 186 of file recordingextender.h.

Member Function Documentation

◆ getSource()

RecExtDataSource* RecExtDataPage::getSource ( )
inline

◆ getNow()

virtual QDateTime RecExtDataPage::getNow ( )
inlinevirtual

Get the current time. Overridden by the testing code.

Definition at line 168 of file recordingextender.h.

Referenced by timeIsClose().

◆ timeIsClose()

bool RecExtDataPage::timeIsClose ( const QDateTime &  eventStart)
virtual

Base Classes ///.

Does the specified time fall within -3/+1 hour from now?

Parameters
eventStartThe starting time of the sporting event.
Returns
true if the starting time is within the specified window.

Definition at line 137 of file recordingextender.cpp.

Referenced by RecExtEspnDataPage::findGameInfo(), and RecExtMlbDataPage::findGameInfo().

◆ findGameInfo()

virtual bool RecExtDataPage::findGameInfo ( ActiveGame game)
pure virtual

◆ findGameScore()

virtual GameState RecExtDataPage::findGameScore ( ActiveGame game)
pure virtual

Implemented in RecExtMlbDataPage, and RecExtEspnDataPage.

◆ walkJsonPath()

QJsonObject RecExtDataPage::walkJsonPath ( QJsonObject &  object,
const QStringList &  path 
)
static

Iterate through a json object and return the specified object.

Parameters
objectThe json object to process.
pathA list of successive items to look up in the specified object. The last object looked up will be returned to the caller.
Returns
The object at the end of the path lookup, or an empty object.

Definition at line 159 of file recordingextender.cpp.

Referenced by getJsonInt(), getJsonObject(), and getJsonString().

◆ getDoc()

QJsonDocument RecExtDataPage::getDoc ( )
inline

Get the JSON document associated with this object.

Returns
a JSonDocument object.

Definition at line 175 of file recordingextender.h.

◆ getJsonInt() [1/2]

bool RecExtDataPage::getJsonInt ( const QJsonObject &  _object,
QStringList &  path,
int &  value 
)
static

Retrieve the specified integer from a json object.

Parameters
[in]objectThe json object to process.
[in]pathA list of successive items to look up in the specified object. The last object looked up will be returned to the caller.
[out]valueWhere to store the retrieved integer.
Returns
true if the parsing was successful and a value returned.

Definition at line 210 of file recordingextender.cpp.

Referenced by RecExtEspnDataPage::findGameScore(), RecExtMlbDataPage::findGameScore(), and getJsonInt().

◆ getJsonInt() [2/2]

bool RecExtDataPage::getJsonInt ( const QJsonObject &  object,
const QString &  key,
int &  value 
)
static

Retrieve the specified integer from a json object.

Parameters
[in]objectThe json object to process.
[in]keyA description of how to find a specific integer object. This can be a single key name, or a series of key names separated with slash characters.
[out]valueWhere to store the retrieved integer.
Returns
true if the parsing was successful and a value returned.

Definition at line 236 of file recordingextender.cpp.

◆ getJsonString() [1/2]

bool RecExtDataPage::getJsonString ( const QJsonObject &  _object,
QStringList &  path,
QString &  value 
)
static

Retrieve the specified string from a json object.

Parameters
[in]objectThe json object to process.
[in]pathA description of how to find a specific string object.
[out]valueWhere to store the retrieved string.
Returns
true if the parsing was successful and a value returned.

Definition at line 248 of file recordingextender.cpp.

Referenced by RecExtEspnDataPage::findGameInfo(), RecExtEspnDataPage::findGameScore(), RecExtMlbDataPage::findGameScore(), getJsonString(), and RecExtMlbDataPage::parseGameObject().

◆ getJsonString() [2/2]

bool RecExtDataPage::getJsonString ( const QJsonObject &  object,
const QString &  key,
QString &  value 
)
static

Retrieve the specified string from a json object.

Parameters
[in]objectThe json object to process.
[in]keyA description of how to find a specific string object. This can be a single key name, or a series of key names separated with slash characters.
[out]valueWhere to store the retrieved string.
Returns
true if the parsing was successful and a value returned.

Definition at line 274 of file recordingextender.cpp.

◆ getJsonObject() [1/2]

bool RecExtDataPage::getJsonObject ( const QJsonObject &  _object,
QStringList &  path,
QJsonObject &  value 
)
static

Retrieve a specific object from another json object.

Parameters
[in]objectThe json object to process.
[in]keyThe name of the object to return.
[out]valueWhere to store the retrieved object.
Returns
true if the parsing was successful and a value returned.

Definition at line 286 of file recordingextender.cpp.

Referenced by getJsonObject().

◆ getJsonObject() [2/2]

bool RecExtDataPage::getJsonObject ( const QJsonObject &  object,
const QString &  key,
QJsonObject &  value 
)
static

Retrieve a specific object from another json object.

Parameters
[in]objectThe json object to process.
[in]keyA description of how to find a specific object. This can be a single key name, or a series of key names separated with slash characters.
[out]valueWhere to store the retrieved object.
Returns
true if the parsing was successful and a value returned.

Definition at line 312 of file recordingextender.cpp.

◆ getJsonArray()

bool RecExtDataPage::getJsonArray ( const QJsonObject &  object,
const QString &  key,
QJsonArray &  value 
)
static

Retrieve the specified array from a json object.

Parameters
[in]objectThe json object to process.
[in]keyThe name of the array to return.
[out]valueWhere to store the retrieved object.
Returns
true if the parsing was successful and a value returned.

Definition at line 324 of file recordingextender.cpp.

Referenced by RecExtMlbDataPage::findGameInfo().

Member Data Documentation

◆ m_doc

QJsonDocument RecExtDataPage::m_doc
protected

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