reference

This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.

ofBaseURLFileLoader Class Referenceabstract

loads a file from a URL using an HTTP request More...

#include <ofURLFileLoader.h>

Inheritance diagram for ofBaseURLFileLoader:
ofURLFileLoaderImpl

Public Member Functions

virtual ~ofBaseURLFileLoader ()
 
virtual ofHttpResponse get (const std::string &url)=0
 make an HTTP request blocks until a response is returned or the request times out
 
virtual int getAsync (const std::string &url, const std::string &name="")=0
 make an asynchronous HTTP request will not block, placed in a queue and run using a background thread
 
virtual ofHttpResponse saveTo (const std::string &url, const of::filesystem::path &path)=0
 make an HTTP request and save the response data to a file blocks until a response is returned or the request times out
 
virtual int saveAsync (const std::string &url, const of::filesystem::path &path)=0
 make an asynchronous HTTP request and save the response data to a file will not block, placed in a queue and run using a background thread
 
virtual void remove (int id)=0
 remove an active HTTP request from the queue
 
virtual void clear ()=0
 clear all active HTTP requests from the queue
 
virtual void stop ()=0
 stop & remove all active and waiting HTTP requests
 
virtual ofHttpResponse handleRequest (const ofHttpRequest &request)=0
 low level HTTP request implementation blocks until a response is returned or the request times out
 
virtual int handleRequestAsync (const ofHttpRequest &request)=0
 

Detailed Description

loads a file from a URL using an HTTP request

Constructor & Destructor Documentation

◆ ~ofBaseURLFileLoader()

virtual ofBaseURLFileLoader::~ofBaseURLFileLoader ( )
inlinevirtual

Member Function Documentation

◆ clear()

virtual void ofBaseURLFileLoader::clear ( )
pure virtual

clear all active HTTP requests from the queue

Implemented in ofURLFileLoaderImpl.

◆ get()

virtual ofHttpResponse ofBaseURLFileLoader::get ( const std::string &  url)
pure virtual

make an HTTP request blocks until a response is returned or the request times out

Parameters
urlHTTP url to request, ie. "http://somewebsite.com/someapi/someimage.jpg"
Returns
HTTP response on success or failure

◆ getAsync()

virtual int ofBaseURLFileLoader::getAsync ( const std::string &  url,
const std::string &  name = "" 
)
pure virtual

make an asynchronous HTTP request will not block, placed in a queue and run using a background thread

Parameters
urlHTTP url to request, ie. "http://somewebsite.com/someapi/someimage.jpg"
nameoptional key to use when sorting requests
Returns
unique id for the active HTTP request

◆ handleRequest()

virtual ofHttpResponse ofBaseURLFileLoader::handleRequest ( const ofHttpRequest request)
pure virtual

low level HTTP request implementation blocks until a response is returned or the request times out

Returns
HTTP response on success or failure

Implemented in ofURLFileLoaderImpl.

◆ handleRequestAsync()

virtual int ofBaseURLFileLoader::handleRequestAsync ( const ofHttpRequest request)
pure virtual

Implemented in ofURLFileLoaderImpl.

◆ remove()

virtual void ofBaseURLFileLoader::remove ( int  id)
pure virtual

remove an active HTTP request from the queue

Parameters
uniqueHTTP request id

Implemented in ofURLFileLoaderImpl.

◆ saveAsync()

virtual int ofBaseURLFileLoader::saveAsync ( const std::string &  url,
const of::filesystem::path &  path 
)
pure virtual

make an asynchronous HTTP request and save the response data to a file will not block, placed in a queue and run using a background thread

Parameters
urlHTTP url to request, ie. "http://somewebsite.com/someapi/someimage.jpg"
pathfile path to save to
Returns
unique id for the active HTTP request

◆ saveTo()

virtual ofHttpResponse ofBaseURLFileLoader::saveTo ( const std::string &  url,
const of::filesystem::path &  path 
)
pure virtual

make an HTTP request and save the response data to a file blocks until a response is returned or the request times out

Parameters
urlHTTP url to request, ie. "http://somewebsite.com/someapi/someimage.jpg"
pathfile path to save to
Returns
HTTP response on success or failure

◆ stop()

virtual void ofBaseURLFileLoader::stop ( )
pure virtual

stop & remove all active and waiting HTTP requests

Implemented in ofURLFileLoaderImpl.


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