FlightGear next
flightgear::http Namespace Reference

Classes

class  CanvasImageRequest
 
class  Connection
 
class  ConnectionData
 
class  DOMElement
 
class  DOMNode
 
class  DOMTextElement
 
class  FGHttpd
 
class  FlightHistoryUriHandler
 
class  HTTPRequest
 
class  HTTPResponse
 
struct  ImageCompressionTask
 
class  ImageCompressor
 
class  ImageReadyListener
 
class  JSON
 
class  JsonUriHandler
 
class  MirrorPropertyTreeWebsocket
 
class  MirrorTreeListener
 
class  MongooseConnection
 
class  MongooseHttpd
 A FGHttpd implementation based on mongoose httpd. More...
 
class  MongooseHTTPRequest
 A Helper class to create a HTTPRequest from a mongoose connection struct. More...
 
class  NavdbUriHandler
 
class  PkgUriHandler
 
class  PropertyChangeObserver
 
struct  PropertyChangeObserverEntry
 
class  PropertyChangeWebsocket
 
class  PropertyUriHandler
 
struct  PropertyValue
 
class  RegularConnection
 
struct  RemovedNode
 
class  RunUriHandler
 
class  ScreenshotCallback
 Based on osgworks ScreenCapture.cpp. More...
 
class  ScreenshotRequest
 
class  ScreenshotUriHandler
 
class  SortedChilds
 
class  StringReadyListener
 
class  URIHandler
 A Base class for URI Handlers. More...
 
class  URIHandlerMap
 A Helper class for URI Handlers. More...
 
class  Websocket
 
class  WebsocketConnection
 
class  WebsocketWriter
 

Typedefs

typedef unsigned int PropertyId
 
typedef SGSharedPtr< PropertyChangeObserverEntryPropertyChangeObserverEntryRef
 
typedef simgear::Singleton< ImageCompressorImageCompressorSingleton
 

Functions

static string FlightHistoryToJson (const SGGeodVec &history, size_t last_seen)
 
static string AutoUpdateResponse (const HTTPRequest &request, const string &base, const string &interval)
 
static string FlightHistoryToKml (const SGGeodVec &history, const HTTPRequest &request)
 
static bool GetJsonDouble (cJSON *json, const char *item, double &out)
 
static bool GetJsonBool (cJSON *json, const char *item, bool &out)
 
static cJSON * createPositionArray (double x, double y, double z)
 
static cJSON * createPositionArray (double x, double y)
 
static cJSON * createLOCGeometry (FGNavRecord *navRecord)
 
static cJSON * createPointGeometry (FGPositioned *positioned)
 
static cJSON * createRunwayPolygon (FGRunwayBase *rwy)
 
static cJSON * createAirportGeometry (FGAirport *airport)
 
static cJSON * createGeometryFor (FGPositioned *positioned)
 
static void addAirportProperties (cJSON *json, FGAirport *airport)
 
static void addNAVProperties (cJSON *json, FGNavRecord *navRecord)
 
static cJSON * createPropertiesFor (FGPositioned *positioned)
 
static cJSON * createFeatureFor (FGPositioned *positioned)
 
static cJSON * StringListToJson (const string_list &l)
 
static cJSON * PackageToJson (simgear::pkg::Package *p)
 
static cJSON * PackageListToJson (const simgear::pkg::PackageList &l)
 
static cJSON * CatalogToJson (simgear::pkg::Catalog *c)
 
static string PackageRootCommand (simgear::pkg::Root *packageRoot, const string &command, const string &args)
 
static string findCommand (const string &uri, string &outArgs)
 
static void setPropertyFromJson (SGPropertyNode_ptr prop, cJSON *json)
 
static void handleSetCommand (const string_list &nodes, cJSON *json, WebsocketWriter &writer)
 
static void handleExecCommand (cJSON *json)
 
static void ReplaceAll (std::string &str, const std::string &from, const std::string &to)
 
static std::string htmlSpecialChars (const std::string &s)
 
static const char * getPropertyTypeString (simgear::props::Type type)
 
DOMElementcreateHeader (const string &prefix, const string &propertyPath)
 
static DOMNodecreateLabeledRadioButton (const char *label, const std::string &name, bool checked)
 
static DOMElementrenderPropertyValueElement (SGPropertyNode_ptr node)
 
static const string KEY_SCREENSHOT ("ScreenshotUriHandler::ScreenshotRequest")
 
static const string KEY_CANVASIMAGE ("ScreenshotUriHandler::CanvasImageRequest")
 

Variables

static const char * errorPage
 
const char * PROPERTY_ROOT = "/sim/http"
 
static unsigned nextid = 0
 
static const std::string specialChars [][2]
 

Typedef Documentation

◆ ImageCompressorSingleton

Definition at line 106 of file ScreenshotUriHandler.cxx.

◆ PropertyChangeObserverEntryRef

◆ PropertyId

typedef unsigned int flightgear::http::PropertyId

Definition at line 45 of file MirrorPropertyTreeWebsocket.cxx.

Function Documentation

◆ addAirportProperties()

static void flightgear::http::addAirportProperties ( cJSON * json,
FGAirport * airport )
static

Definition at line 168 of file NavdbUriHandler.cxx.

◆ addNAVProperties()

static void flightgear::http::addNAVProperties ( cJSON * json,
FGNavRecord * navRecord )
static

Definition at line 222 of file NavdbUriHandler.cxx.

◆ AutoUpdateResponse()

static string flightgear::http::AutoUpdateResponse ( const HTTPRequest & request,
const string & base,
const string & interval )
static

Definition at line 91 of file FlightHistoryUriHandler.cxx.

◆ CatalogToJson()

static cJSON * flightgear::http::CatalogToJson ( simgear::pkg::Catalog * c)
static

Definition at line 94 of file PkgUriHandler.cxx.

◆ createAirportGeometry()

static cJSON * flightgear::http::createAirportGeometry ( FGAirport * airport)
static

Definition at line 119 of file NavdbUriHandler.cxx.

◆ createFeatureFor()

static cJSON * flightgear::http::createFeatureFor ( FGPositioned * positioned)
static

Definition at line 256 of file NavdbUriHandler.cxx.

◆ createGeometryFor()

static cJSON * flightgear::http::createGeometryFor ( FGPositioned * positioned)
static

Definition at line 153 of file NavdbUriHandler.cxx.

◆ createHeader()

DOMElement * flightgear::http::createHeader ( const string & prefix,
const string & propertyPath )

Definition at line 102 of file PropertyUriHandler.cxx.

◆ createLabeledRadioButton()

static DOMNode * flightgear::http::createLabeledRadioButton ( const char * label,
const std::string & name,
bool checked )
static

Definition at line 151 of file PropertyUriHandler.cxx.

◆ createLOCGeometry()

static cJSON * flightgear::http::createLOCGeometry ( FGNavRecord * navRecord)
static

Definition at line 50 of file NavdbUriHandler.cxx.

◆ createPointGeometry()

static cJSON * flightgear::http::createPointGeometry ( FGPositioned * positioned)
static

Definition at line 87 of file NavdbUriHandler.cxx.

◆ createPositionArray() [1/2]

static cJSON * flightgear::http::createPositionArray ( double x,
double y )
static

Definition at line 42 of file NavdbUriHandler.cxx.

◆ createPositionArray() [2/2]

static cJSON * flightgear::http::createPositionArray ( double x,
double y,
double z )
static

Definition at line 33 of file NavdbUriHandler.cxx.

◆ createPropertiesFor()

static cJSON * flightgear::http::createPropertiesFor ( FGPositioned * positioned)
static

Definition at line 242 of file NavdbUriHandler.cxx.

◆ createRunwayPolygon()

static cJSON * flightgear::http::createRunwayPolygon ( FGRunwayBase * rwy)
static

Definition at line 96 of file NavdbUriHandler.cxx.

◆ findCommand()

static string flightgear::http::findCommand ( const string & uri,
string & outArgs )
static

Definition at line 175 of file PkgUriHandler.cxx.

◆ FlightHistoryToJson()

static string flightgear::http::FlightHistoryToJson ( const SGGeodVec & history,
size_t last_seen )
static

Definition at line 58 of file FlightHistoryUriHandler.cxx.

◆ FlightHistoryToKml()

static string flightgear::http::FlightHistoryToKml ( const SGGeodVec & history,
const HTTPRequest & request )
static

Definition at line 116 of file FlightHistoryUriHandler.cxx.

◆ GetJsonBool()

static bool flightgear::http::GetJsonBool ( cJSON * json,
const char * item,
bool & out )
static

Definition at line 194 of file FlightHistoryUriHandler.cxx.

◆ GetJsonDouble()

static bool flightgear::http::GetJsonDouble ( cJSON * json,
const char * item,
double & out )
static

Definition at line 181 of file FlightHistoryUriHandler.cxx.

◆ getPropertyTypeString()

static const char * flightgear::http::getPropertyTypeString ( simgear::props::Type type)
static

Definition at line 83 of file PropertyUriHandler.cxx.

◆ handleExecCommand()

static void flightgear::http::handleExecCommand ( cJSON * json)
static

Definition at line 106 of file PropertyChangeWebsocket.cxx.

◆ handleSetCommand()

static void flightgear::http::handleSetCommand ( const string_list & nodes,
cJSON * json,
WebsocketWriter & writer )
static

Definition at line 68 of file PropertyChangeWebsocket.cxx.

◆ htmlSpecialChars()

static std::string flightgear::http::htmlSpecialChars ( const std::string & s)
inlinestatic

Definition at line 58 of file PropertyUriHandler.cxx.

◆ KEY_CANVASIMAGE()

static const string flightgear::http::KEY_CANVASIMAGE ( "ScreenshotUriHandler::CanvasImageRequest" )
static

◆ KEY_SCREENSHOT()

static const string flightgear::http::KEY_SCREENSHOT ( "ScreenshotUriHandler::ScreenshotRequest" )
static

◆ PackageListToJson()

static cJSON * flightgear::http::PackageListToJson ( const simgear::pkg::PackageList & l)
static

Definition at line 85 of file PkgUriHandler.cxx.

◆ PackageRootCommand()

static string flightgear::http::PackageRootCommand ( simgear::pkg::Root * packageRoot,
const string & command,
const string & args )
static

Definition at line 111 of file PkgUriHandler.cxx.

◆ PackageToJson()

static cJSON * flightgear::http::PackageToJson ( simgear::pkg::Package * p)
static

Definition at line 64 of file PkgUriHandler.cxx.

◆ renderPropertyValueElement()

static DOMElement * flightgear::http::renderPropertyValueElement ( SGPropertyNode_ptr node)
static

Definition at line 168 of file PropertyUriHandler.cxx.

◆ ReplaceAll()

static void flightgear::http::ReplaceAll ( std::string & str,
const std::string & from,
const std::string & to )
static

Definition at line 41 of file PropertyUriHandler.cxx.

◆ setPropertyFromJson()

static void flightgear::http::setPropertyFromJson ( SGPropertyNode_ptr prop,
cJSON * json )
static

Definition at line 42 of file PropertyChangeWebsocket.cxx.

◆ StringListToJson()

static cJSON * flightgear::http::StringListToJson ( const string_list & l)
static

Definition at line 56 of file PkgUriHandler.cxx.

Variable Documentation

◆ errorPage

const char* flightgear::http::errorPage
static
Initial value:
=
"<html><head><title>Flight History</title></head><body>"
"<h1>Flight History</h1>"
"Supported formats:"
"<ul>"
"<li><a href='track.json'>JSON</a></li>"
"<li><a href='track.kml'>KML</a></li>"
"</ul>"
"</body></html>"

Definition at line 48 of file FlightHistoryUriHandler.cxx.

◆ nextid

unsigned flightgear::http::nextid = 0
static

Definition at line 40 of file PropertyChangeWebsocket.cxx.

◆ PROPERTY_ROOT

const char * flightgear::http::PROPERTY_ROOT = "/sim/http"

Definition at line 49 of file httpd.cxx.

◆ specialChars

const std::string flightgear::http::specialChars[][2]
static
Initial value:
= {
{ "&", "&amp;" },
{ "\"", "&quot;" },
{ "'", "&#039;" },
{ "<", "&lt;" },
{ ">", "&gt;" },
}

Definition at line 50 of file PropertyUriHandler.cxx.