osgEarth 2.1.1
Classes | Namespaces | Defines | Functions | Variables

/home/cube/sources/osgearth/src/osgEarth/HTTPClient.cpp File Reference

#include <curl/curl.h>
#include <osgEarth/HTTPClient>
#include <osgEarth/Registry>
#include <osgEarth/Version>
#include <osgDB/Registry>
#include <osgDB/FileNameUtils>
#include <osg/Notify>
#include <string.h>
#include <sstream>
#include <fstream>
#include <iterator>
#include <iostream>
#include <algorithm>
Include dependency graph for HTTPClient.cpp:

Go to the source code of this file.

Classes

struct  osgEarth::StreamObject

Namespaces

namespace  osgEarth
namespace  anonymous_namespace{HTTPClient.cpp}

Defines

#define LC   "[HTTPClient] "
#define OE_DEBUG   OE_NULL
#define QUOTE_(X)   #X
#define QUOTE(X)   QUOTE_(X)
#define USER_AGENT   "osgearth" QUOTE(OSGEARTH_MAJOR_VERSION) "." QUOTE(OSGEARTH_MINOR_VERSION)

Functions

static size_t osgEarth::StreamObjectReadCallback (void *ptr, size_t size, size_t nmemb, void *data)
static int CurlProgressCallback (void *clientp, double dltotal, double dlnow, double ultotal, double ulnow)
static std::vector< std::string > tokenize_str (const std::string &str, const std::string &delims=", \t")
osgDB::ReaderWriter * anonymous_namespace{HTTPClient.cpp}::getReader (const std::string &url, const HTTPResponse &response)

Variables

static optional< ProxySettings_proxySettings
static std::string _userAgent = USER_AGENT

Define Documentation

#define LC   "[HTTPClient] "

Definition at line 35 of file HTTPClient.cpp.

#define OE_DEBUG   OE_NULL

Definition at line 38 of file HTTPClient.cpp.

#define QUOTE (   X)    QUOTE_(X)

Definition at line 252 of file HTTPClient.cpp.

#define QUOTE_ (   X)    #X

Definition at line 251 of file HTTPClient.cpp.

#define USER_AGENT   "osgearth" QUOTE(OSGEARTH_MAJOR_VERSION) "." QUOTE(OSGEARTH_MINOR_VERSION)

Definition at line 253 of file HTTPClient.cpp.


Function Documentation

static int CurlProgressCallback ( void *  clientp,
double  dltotal,
double  dlnow,
double  ultotal,
double  ulnow 
) [static]

Definition at line 104 of file HTTPClient.cpp.

{
    ProgressCallback* callback = (ProgressCallback*)clientp;
    bool cancelled = false;
    if (callback)
    {
        cancelled = callback->isCanceled() || callback->reportProgress(dlnow, dltotal);
    }
    return cancelled;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static std::vector<std::string> tokenize_str ( const std::string &  str,
const std::string &  delims = ", \t" 
) [static]

Definition at line 371 of file HTTPClient.cpp.

{
  using namespace std;
  // Skip delims at beginning, find start of first token
  string::size_type lastPos = str.find_first_not_of(delims, 0);
  // Find next delimiter @ end of token
  string::size_type pos     = str.find_first_of(delims, lastPos);

  // output vector
  vector<string> tokens;

  while (string::npos != pos || string::npos != lastPos)
    {
      // Found a token, add it to the vector.
      tokens.push_back(str.substr(lastPos, pos - lastPos));
      // Skip delims.  Note the "not_of". this is beginning of token
      lastPos = str.find_first_not_of(delims, pos);
      // Find next delimiter at end of token.
      pos     = str.find_first_of(delims, lastPos);
    }

  return tokens;
}

Here is the caller graph for this function:


Variable Documentation

Definition at line 256 of file HTTPClient.cpp.

std::string _userAgent = USER_AGENT [static]

Definition at line 257 of file HTTPClient.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines