MythTV  master
Public Member Functions | List of all members
RecExtMlbDataPage Class Reference

#include <recordingextender.h>

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

Public Member Functions

 RecExtMlbDataPage (QObject *parent, QJsonDocument doc)
 
bool findGameInfo (ActiveGame &game) override
 Parse a previously downloaded data page for a given sport. More...
 
GameState findGameScore (ActiveGame &game) override
 Parse the previously downloaded data page for a given game. More...
 
bool parseGameObject (const QJsonObject &gameObject, ActiveGame &game)
 MLB ///. More...
 
- Public Member Functions inherited from RecExtDataPage
RecExtDataSourcegetSource ()
 
virtual QDateTime getNow ()
 Get the current time. Overridden by the testing code. More...
 
virtual bool timeIsClose (const QDateTime &eventStart)
 Base Classes ///. More...
 
QJsonDocument getDoc ()
 Get the JSON document associated with this object. More...
 
 RecExtDataPage (QObject *parent, QJsonDocument doc)
 Create a new RecExtDataPage object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from RecExtDataPage
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 inherited from RecExtDataPage
QJsonDocument m_doc
 

Detailed Description

Definition at line 249 of file recordingextender.h.

Constructor & Destructor Documentation

◆ RecExtMlbDataPage()

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

Definition at line 252 of file recordingextender.h.

Member Function Documentation

◆ findGameInfo()

bool RecExtMlbDataPage::findGameInfo ( ActiveGame game)
overridevirtual

Parse a previously downloaded data page for a given sport.

Find an entry that matches the specified team names, and update the game information with the starting time and a URL for retrieving the score for this game.

Parameters
game[in,out]A description of the desired game. The team names must be valid on input.
Returns
true if a match was found.

Implements RecExtDataPage.

Definition at line 806 of file recordingextender.cpp.

◆ findGameScore()

GameState RecExtMlbDataPage::findGameScore ( ActiveGame game)
overridevirtual

Parse the previously downloaded data page for a given game.

Find the current state of the game, and the current period.

Parameters
[in]gameA description of the desired game. The team names and the URL must be valid on input.
Returns
The game state for the specified game.

Implements RecExtDataPage.

Definition at line 875 of file recordingextender.cpp.

◆ parseGameObject()

bool RecExtMlbDataPage::parseGameObject ( const QJsonObject &  gameObject,
ActiveGame game 
)

MLB ///.

Parse a single game from the returned MLB schedule page.

Parameters
[in]gameObjectThe json object on the MLB schedule page that describes a single game.
[in,out]gameThe game data structure to be filled in.
Returns
true if the json was successfully parsed.

Definition at line 762 of file recordingextender.cpp.

Referenced by findGameInfo().


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