Gnash  0.8.11dev
Public Types | Static Public Member Functions | List of all members
gnash::NetworkAdapter Class Reference

Code to use libcurl as an IOChannel stream. More...

#include <NetworkAdapter.h>

Public Types

typedef std::map< std::string, std::string, StringNoCaseLessThanRequestHeaders
 
typedef std::set< std::string, StringNoCaseLessThanReservedNames
 

Static Public Member Functions

static DSOEXPORT std::unique_ptr< IOChannelmakeStream (const std::string &url, const std::string &cachefile)
 Returns a read-only IOChannel that fetches data from an url. More...
 
static DSOEXPORT std::unique_ptr< IOChannelmakeStream (const std::string &url, const std::string &postdata, const std::string &cachefile)
 Returns a read-only IOChannel that fetches data from an url getting posted to. More...
 
static DSOEXPORT std::unique_ptr< IOChannelmakeStream (const std::string &url, const std::string &postdata, const RequestHeaders &headers, const std::string &cachefile)
 Returns a read-only IOChannel that fetches data from an url getting posted to. More...
 
static DSOEXPORT bool isHeaderAllowed (const std::string &headerName)
 Check whether a RequestHeader is permitted. More...
 
static void setCookiesIn (const std::string &cookiesin)
 Set CookiesIn variable to cookiefile path. More...
 
static const std::string & getCookiesIn ()
 Get CookiesIn variable, cookiefile path. More...
 

Detailed Description

Code to use libcurl as an IOChannel stream.

Member Typedef Documentation

§ RequestHeaders

typedef std::map<std::string, std::string, StringNoCaseLessThan> gnash::NetworkAdapter::RequestHeaders

Custom headers for addRequestHeader. These are case insensitive, and subsequent addition of a header already there replaces any previous one. Some values are not allowed.

§ ReservedNames

Member Function Documentation

§ getCookiesIn()

static const std::string& gnash::NetworkAdapter::getCookiesIn ( )
inlinestatic

Get CookiesIn variable, cookiefile path.

Returns the cookiefile path.

References DSOEXPORT.

§ isHeaderAllowed()

static DSOEXPORT bool gnash::NetworkAdapter::isHeaderAllowed ( const std::string &  headerName)
inlinestatic

Check whether a RequestHeader is permitted.

Parameters
headerNameis checked against a set of reserved names (case-insensitive).
Returns
true if the name is allowed.

References names.

§ makeStream() [1/3]

std::unique_ptr< IOChannel > gnash::NetworkAdapter::makeStream ( const std::string &  url,
const std::string &  cachefile 
)
static

Returns a read-only IOChannel that fetches data from an url.

Parameters
urlThe url to fetch data from.

References _, and gnash::log_error().

Referenced by gnash::StreamProvider::getStream(), and makeStream().

§ makeStream() [2/3]

std::unique_ptr< IOChannel > gnash::NetworkAdapter::makeStream ( const std::string &  url,
const std::string &  postdata,
const std::string &  cachefile 
)
static

Returns a read-only IOChannel that fetches data from an url getting posted to.

The caller owns the returned IOChannel.

Parameters
urlThe url to post to.
postdataThe url-encoded post data

References makeStream().

§ makeStream() [3/3]

std::unique_ptr< IOChannel > gnash::NetworkAdapter::makeStream ( const std::string &  url,
const std::string &  postdata,
const RequestHeaders headers,
const std::string &  cachefile 
)
static

Returns a read-only IOChannel that fetches data from an url getting posted to.

The caller owns the returned IOChannel.

Parameters
urlThe url to post to.
postdataThe url-encoded post data
headersA RequestHeaders map of custom headers to send.

References _, data, gnash::get(), gnash::gnashSleep(), gnash::log_debug(), gnash::log_error(), makeStream(), UNUSED, and url.

§ setCookiesIn()

static void gnash::NetworkAdapter::setCookiesIn ( const std::string &  cookiesin)
inlinestatic

Set CookiesIn variable to cookiefile path.

Parameters
cookiesinCookiefile path

Referenced by gnash::Player::setCookiesIn().


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