GLWebTools: Class List

GLWebTools
An collection of library for online services
  • Main Page
  • Namespaces
  • Classes
  • Files
  • Class List
  • Class Hierarchy
  • Class Members
Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | Wrap a value with a validator (for input) and a formatter (for output)
glwebtools::AttributeFormatter | Functor used to format attributes of requests to string
glwebtools::AttributeValidator | Functor used to validate attribute
glwebtools::Codec | Class with common data codec
glwebtools::Curl | Managed initialization of Curl
glwebtools::ExcludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > | Convenient wrapper to exclude multiple values
glwebtools::FalseType | Boolean false in meta-expression
glwebtools::FloatFormatter< PRECISION > | Functor used to format attributes of requests to string
glwebtools::GlWebTools | GlWebTools main class
glwebtools::GlWebTools::CreationSettings | GlWebTools creation settings structure
glwebtools::GlWebToolsCore | GlWebTools core class
glwebtools::HandleManager | Class that manage the handle
glwebtools::IncludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > | Convenient wrapper to include multiple values
glwebtools::IndexedValue< GLWEBTOOLS_VALUE > | Convenient wrapper to find value by index
glwebtools::IsArgumentOptional< GLWEBTOOLS_T > | Returns TrueType if GLWEBTOOLS_T is an optional argument, FalseType otherwise
glwebtools::IsArgumentRequired< GLWEBTOOLS_T > | Returns TrueType if GLWEBTOOLS_T is a required argument, FalseType otherwise
glwebtools::IsArgumentWrapped< GLWEBTOOLS_T > | Returns TrueType if GLWEBTOOLS_T is wrapped, FalseType otherwise
glwebtools::IsList< GLWEBTOOLS_T > | Specialize this traits for a class if it has functions begin() and end() and typedef iterator
glwebtools::IsRange< GLWEBTOOLS_T > | Specialize this traits for a class if it has functions getMinValue() and getMaxValue()
glwebtools::JsonReader | Parses a Json string and provides retrieval and conversion of data
glwebtools::JsonReader::Iterator | Iterator over array items or object items in a JsonReader
glwebtools::JsonWriter | Format data in Json
glwebtools::NameValuePair< GLWEBTOOLS_VALUE > | Convenient wrapper to find value by name
glwebtools::Not< LEFT > | Returns the result of logical not on its argument
glwebtools::OpenSSL | Managed initialization of OpenSSL
glwebtools::Or< LEFT, RIGHT > | Returns the result of logical or on its arguments
glwebtools::SAllocator< GLWEBTOOLS_T, Hint > | Very simple allocator implementation, containers using it can be used across dll boundaries
glwebtools::SecureDataFormatter< FORMATTER > | Functor used to format attributes of requests to string
glwebtools::StringValidator | Functor used to validate attribute
glwebtools::ThreadPool::CreationSettings | ThreadPool creation settings structure
glwebtools::TrueType | Boolean true in meta-expression
glwebtools::UrlConnection | A handle class wrapping UrlConnection with automatic ref count management
glwebtools::UrlConnection::CreationSettings | UrlConnection creation settings structure
glwebtools::UrlConnectionCore | Class for Url Connection
glwebtools::UrlRequest | A handle class wrapping UrlRequest with automatic ref count management
glwebtools::UrlRequestCore | Class to perform an url request
glwebtools::UrlResponse | A handle class wrapping UrlResponse with automatic ref count management
glwebtools::UrlResponseCore | Class containing the Response from an Url request
Generated by doxygen 1.7.5.1


GLWebTools: glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > Struct Template Reference

  • Namespaces
  • Classes
  • Files
  • Class List
  • Class Hierarchy
  • Class Members
  • glwebtools
  • ArgumentWrapper
Public Member Functions | Friends
glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > Struct Template Reference

Wrap a value with a validator (for input) and a formatter (for output) More...

#include <glwebtools_argumentwrapper.h>

Inherited by glwebtools::OptionalArgument< GLWEBTOOLS_T, VALIDATOR, FORMATTER >, and glwebtools::RequiredArgument< GLWEBTOOLS_T, VALIDATOR, FORMATTER >.

List of all members.

Public Member Functions

ArgumentWrapper ()
Default constructor.
ArgumentWrapper (const ArgumentWrapper &other)
ArgumentWrapper (const GLWEBTOOLS_T &value, VALIDATOR validator, FORMATTER formatter)
ArgumentWrapper (const GLWEBTOOLS_T &value, VALIDATOR validator)
ArgumentWrapper (const GLWEBTOOLS_T &value)
const FORMATTER & | Formatter () const
bool | IsValid () const
operator GLWEBTOOLS_T const & () const
ArgumentWrapper & | operator= (const ArgumentWrapper &other)
ArgumentWrapper & | operator= (const GLWEBTOOLS_T &value)
bool | operator== (const ArgumentWrapper &other) const
bool | operator== (const GLWEBTOOLS_T &other) const
void | Reset ()
template<typename GLWEBTOOLS_U , typename FIELD_T , typename VALUE_T >
void | SetMember (FIELD_T GLWEBTOOLS_U::*member, VALUE_T value)
template<typename GLWEBTOOLS_MEMBER >
Proxy< PointerType,
GLWEBTOOLS_MEMBER > 		SetMember (GLWEBTOOLS_MEMBER member)
void | ToString (std::string &str) const
std::string | ToString () const
const VALIDATOR & | Validator () const
const GLWEBTOOLS_T & | Value () const

Friends

std::ostream & | operator<< (std::ostream &os, const ArgumentWrapper &value)

Detailed Description

template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
struct glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >

Wrap a value with a validator (for input) and a formatter (for output)

Constructor & Destructor Documentation

template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >::ArgumentWrapper ( const ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > & other ) [inline]

Copy constructor

Parameters:
other Other instance to be copied.
template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >::ArgumentWrapper | ( | const GLWEBTOOLS_T & | value,
 |  | VALIDATOR | validator,
 |  | FORMATTER | formatter
 | ) |  | [inline]

Constructor

Parameters:
value | Value to assign
validator | used to validate the value
formatter | used to format the value as string
template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >::ArgumentWrapper | ( | const GLWEBTOOLS_T & | value,
 |  | VALIDATOR | validator
 | ) |  | [inline]

Constructor

Parameters:
value | Value to assign
validator | used to validate the value
template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >::ArgumentWrapper ( const GLWEBTOOLS_T & value ) [inline]

Constructor

Parameters:
value Value to assign

Member Function Documentation

template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
const FORMATTER& glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >::Formatter ( ) const [inline]

Returns the formatter

Returns:
The formatter
template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
bool glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >::IsValid ( ) const [inline]

Returns whether the assigned value is valid or not

Return values:
true | if the value is valid
false | if the value is not valid
template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >::operator GLWEBTOOLS_T const & ( ) const [inline]

Convert the wrapper to the inner value

Returns:
The unwrapped inner value
template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
ArgumentWrapper& glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >::operator= ( const ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > & other ) [inline]

Assignation operator

Parameters:
other Other instance to be copied.
template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
ArgumentWrapper& glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >::operator= ( const GLWEBTOOLS_T & value ) [inline]

Assignation operator

Parameters:
value Value to assign
template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
bool glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >::operator== ( const ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > & other ) const [inline]

Equality operator

template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
bool glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >::operator== ( const GLWEBTOOLS_T & other ) const [inline]

Equality operator

template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
void glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >::Reset ( ) [inline]

Default construct the inner value.

template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
template<typename GLWEBTOOLS_U , typename FIELD_T , typename VALUE_T >
void glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >::SetMember | ( | FIELD_T GLWEBTOOLS_U::* | member,
 |  | VALUE_T | value
 | ) |  | [inline]

Assign a value to a member of the inner value

Parameters:
member | the member to set
value | Value to assign
template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
template<typename GLWEBTOOLS_MEMBER >
Proxy<PointerType, GLWEBTOOLS_MEMBER> glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >::SetMember ( GLWEBTOOLS_MEMBER member ) [inline]

Assign a value to a member of the inner value

Parameters:
member the member to set
template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
void glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >::ToString ( std::string & str ) const [inline]

Formats the assigned value to string

Parameters:
[out] str The string to contain the formatted value.
template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
std::string glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >::ToString ( ) const [inline]

Formats the inner value to string

Returns:
The inner value formatted as string
template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
const VALIDATOR& glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >::Validator ( ) const [inline]

Returns the validator

Returns:
The validator
template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
const GLWEBTOOLS_T& glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >::Value ( ) const [inline]

Convert the wrapper to the inner value

Returns:
The unwrapped inner value

Friends And Related Function Documentation

template<typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
std::ostream& operator<< | ( | std::ostream & | os,
 |  | const ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > & | value
 | ) |  | [friend]

Overloaded output stream operator for ArgumentWrapper type.

Parameters:
os | the output stream
value | the value to put into the output stream
Returns:
the output stream
The documentation for this struct was generated from the following file:
  • glwebtools_argumentwrapper.h


GLWebTools: glwebtools::AttributeFormatter Class Reference

  • Class List
  • Class Hierarchy
  • Class Members
  • glwebtools
  • AttributeFormatter
Public Member Functions | Static Public Member Functions
glwebtools::AttributeFormatter Class Reference

Functor used to format attributes of requests to string. More...

#include <glwebtools_attributeformatter.h>

List of all members.

Public Member Functions

template<typename VALUE >
std::string | operator() (VALUE value) const
bool | operator== (const AttributeFormatter &) const

Static Public Member Functions

static std::string | ToString (bool value)
static std::string | ToString (int value)
static std::string | ToString (unsigned int value)
static std::string | ToString (long long value)
static std::string | ToString (float value, int precision=2)
static std::string | ToString (double value, int precision=2)
static std::string | ToString (const char *value)
static std::string | ToString (const std::string &value)

Detailed Description

Functor used to format attributes of requests to string.

Default Generic formatter.

Member Function Documentation

template<typename VALUE >
std::string glwebtools::AttributeFormatter::operator() ( VALUE value ) const [inline]

Formats value to string

Parameters:
value The value to format
Returns:
The formatted string
bool glwebtools::AttributeFormatter::operator== ( const AttributeFormatter & ) const [inline]

Equality operator

std::string glwebtools::AttributeFormatter::ToString ( bool value ) [static]

Formats value to string

Parameters:
value The value to format
Returns:
The formatted string
std::string glwebtools::AttributeFormatter::ToString ( int value ) [static]

Formats value to string

Parameters:
value The value to format
Returns:
The formatted string
std::string glwebtools::AttributeFormatter::ToString ( unsigned int value ) [static]

Formats value to string

Parameters:
value The value to format
Returns:
The formatted string
std::string glwebtools::AttributeFormatter::ToString ( long long value ) [static]

Formats value to string

Parameters:
value The value to format
Returns:
The formatted string
std::string glwebtools::AttributeFormatter::ToString | ( | float | value,
 |  | int | precision = 2
 | ) |  | [static]

Formats value to string

Parameters:
value | The value to format
precision | The decimal precision to be used when formatting the float value
Returns:
The formatted string
std::string glwebtools::AttributeFormatter::ToString | ( | double | value,
 |  | int | precision = 2
 | ) |  | [static]

Formats value to string

Parameters:
value | The value to format
precision | The decimal precision to be used when formatting the float value
Returns:
The formatted string
static std::string glwebtools::AttributeFormatter::ToString ( const char * value ) [inline, static]

Formats value to string

Parameters:
value The value to format
Returns:
The formatted string
static std::string glwebtools::AttributeFormatter::ToString ( const std::string & value ) [inline, static]

Formats value to string

Parameters:
value The value to format
Returns:
The formatted string
The documentation for this class was generated from the following files:
  • glwebtools_attributeformatter.h
  • glwebtools_attributeformatter.cpp


GLWebTools: glwebtools::AttributeValidator Struct Reference

  • glwebtools
  • AttributeValidator
Public Member Functions
glwebtools::AttributeValidator Struct Reference

Functor used to validate attribute. More...

#include <glwebtools_attributevalidator.h>

Inherits glwebtools::BaseValidator< GLWEBTOOLS_T >.

List of all members.

Public Member Functions

template<typename VALUE >
bool operator() (VALUE value) const

Detailed Description

Functor used to validate attribute.

Default Generic validator, always return true.

Member Function Documentation

template<typename VALUE >
bool glwebtools::AttributeValidator::operator() ( VALUE value ) const [inline]

Validate the value. Returns whether the assigned value is valid or not.

Parameters:
value The value to validate
Return values:
true | if value is valid
false | if value is not valid
The documentation for this struct was generated from the following file:
  • glwebtools_attributevalidator.h


GLWebTools: glwebtools::Codec Class Reference

  • glwebtools
  • Codec
Static Public Member Functions
glwebtools::Codec Class Reference

Class with common data codec. More...

#include <glwebtools_codec.h>

List of all members.

Static Public Member Functions

static size_t | DecodeBase64 (const char *base64Data, size_t dataSize, void *outData, bool strict=false)
Decode a base64 encoded string into a block of data.
static size_t | DecodeBase64 (const glwebtools::String &base64Data, void *outData, bool strict=false)
Decode a base64 encoded string into a block of data.
static size_t | DecodeBase64Custom (const char *base64Data, size_t dataSize, void *outData, const char *customkey)
Decode a base64 encoded string into a block of data with a custom key.
static size_t | DecodeBase64Custom (const glwebtools::String &base64Data, void *outData, const char *customkey)
Decode a base64 encoded string into a block of data with a custom key.
static size_t | DecodeBlob (const glwebtools::String &blobbedData, void *outData)
Decode a blob encoded string into a block of data.
static bool | DecodeUrl (const glwebtools::String &source, glwebtools::String &dest)
Decode a Url encoded string.
static bool | DecryptTEA (const void *indata, size_t indataSize, void *outData, size_t outdataSize, const unsigned int *key)
Decrypt data according to TEA.
static bool | DecryptXTEA (const void *indata, size_t indataSize, void *outData, size_t outdataSize, const unsigned int *key)
Decrypt data according to XTEA.
static bool | DecryptXXTEA (const void *indata, size_t indataSize, void *outData, size_t outdataSize, const unsigned int *key)
Decrypt data according to XXTEA.
static bool | EncodeBase64 (const unsigned char *src, size_t dataSize, glwebtools::String &dest, MaxLineLength maxLineLength=none)
Encode a block of data in a base64 string.
static bool | EncodeBase64 (const unsigned char *src, size_t dataSize, glwebtools::String &dest, size_t maxLineLength)
Encode a block of data in a base64 string.
static bool | EncodeBase64Custom (const unsigned char *src, size_t dataSize, glwebtools::String &dest, const char *customkey)
Encode a block of data in a base64 string with a custom key (key must be url encoding compliant)
static bool | EncodeBlob (const unsigned char *src, size_t dataSize, glwebtools::String &dest)
Encode a block of data in a blob string.
static bool | EncodeUrlRFC1738 (const glwebtools::String &source, glwebtools::String &dest)
Url encode a string according to RFC1738.
static bool | EncodeUrlRFC3986 (const glwebtools::String &source, glwebtools::String &dest)
Url encode a string according to RFC3986.
static bool | EncryptTEA (const void *indata, size_t indataSize, void *outData, size_t outdataSize, const unsigned int *key)
Encrypt data according to TEA.
static bool | EncryptXTEA (const void *indata, size_t indataSize, void *outData, size_t outdataSize, const unsigned int *key)
Encrypt data according to XTEA.
static bool | EncryptXXTEA (const void *indata, size_t indataSize, void *outData, size_t outdataSize, const unsigned int *key)
Encrypt data according to XXTEA.
static void | GenerateBase64CustomKey (char *key)
Generate a url encoding compliant key using rand()
static void | GenerateBase64CustomKey (char *key, unsigned int seed1, unsigned int seed2)
Generate a url encoding compliant key using procedural generation.
static bool | GenerateMD5 (const void *data, size_t size, char *dest)
Generate a MD5 checksum of a data buffer.
static bool | GenerateSHA256 (const void *data, size_t size, char *dest)
Generate a SHA256 checksum of a data buffer.
static size_t | GetDecodedBase64DataSize (const glwebtools::String &base64Data, bool strict=false)
Get the decoded size of a base64 string.
static size_t | GetDecodedBlobDataSize (const glwebtools::String &blobbedData)
Get the decoded size of a blob string.
static size_t | GetEncryptedTEADataSize (size_t inDataSize)
Get the encrypted size of the data using TEA.
static size_t | GetEncryptedXTEADataSize (size_t inDataSize)
Get the encrypted size of the data using XTEA.
static size_t | GetEncryptedXXTEADataSize (size_t inDataSize)
Get the encrypted size of the data using XXTEA.
static bool | IsInBase64Alphabet (char data)
Test whether data is in the base encoding alhpabet.
static unsigned int | Random (unsigned int &seed1, unsigned int &seed2)
Generate a random number, using seed1 and seed2. Will modify seed1 and seed2.

Detailed Description

Class with common data codec.

Member Function Documentation

size_t glwebtools::Codec::DecodeBase64 | ( | const char * | base64Data,
 |  | size_t | dataSize,
 |  | void * | outData,
 |  | bool | strict = false
 | ) |  | [static]

Decode a base64 encoded string into a block of data.

Parameters:
base64Data | Base64 c-string to decode
dataSize | Size of the string to decode
outData | Pointer to the buffer to write to (must be already allocated)
strict | If true, all character not in the alphabet for Base64, will be ignored.
Returns:
Size of the decoded data
size_t glwebtools::Codec::DecodeBase64 | ( | const glwebtools::String & | base64Data,
 |  | void * | outData,
 |  | bool | strict = false
 | ) |  | [static]

Decode a base64 encoded string into a block of data.

Parameters:
base64Data | Base64 string to decode
outData | Pointer to the buffer to write to (must be already allocated)
strict | If true, all character not in the alphabet for Base64, will be ignored.
Returns:
Size of the decoded data
size_t glwebtools::Codec::DecodeBase64Custom | ( | const char * | base64Data,
 |  | size_t | dataSize,
 |  | void * | outData,
 |  | const char * | customkey
 | ) |  | [static]

Decode a base64 encoded string into a block of data with a custom key.

Parameters:
base64Data | Base64 c-string to decode
dataSize | Size of the string to decode
outData | Pointer to the buffer to write to (must be already allocated)
customkey | Encoding key to use
Returns:
Size of the decoded data
size_t glwebtools::Codec::DecodeBase64Custom | ( | const glwebtools::String & | base64Data,
 |  | void * | outData,
 |  | const char * | customkey
 | ) |  | [static]

Decode a base64 encoded string into a block of data with a custom key.

Parameters:
base64Data | Base64 string to decode
outData | Pointer to the buffer to write to (must be already allocated)
customkey | Encoding key to use
Returns:
Size of the decoded data
size_t glwebtools::Codec::DecodeBlob | ( | const glwebtools::String & | blobbedData,
 |  | void * | outData
 | ) |  | [static]

Decode a blob encoded string into a block of data.

Parameters:
blobbedData | Blobbed string to decode
outData | Pointer to the buffer to write to (must be already allocated)
Returns:
Size of the decoded data
bool glwebtools::Codec::DecodeUrl | ( | const glwebtools::String & | source,
 |  | glwebtools::String & | dest
 | ) |  | [static]

Decode a Url encoded string.

Parameters:
source | String to decode
dest | Reference to a string to append the decoded string to
Returns:
True if the string was encoded successfully
bool glwebtools::Codec::DecryptTEA | ( | const void * | indata,
 |  | size_t | indataSize,
 |  | void * | outData,
 |  | size_t | outdataSize,
 |  | const unsigned int * | key
 | ) |  | [static]

Decrypt data according to TEA.

The input buffer and output buffer can be the same, but input data will be overwriten.

Parameters:
indata | Data to decrypt
indataSize | Size of the data to decrypt
outData | Buffer to write the decrypted data to (must be of size indataSize or more)
outdataSize | Size of the output buffer
key | 128 bit encryption key (4 x unsigned int)
Returns:
True if decryption is successful
bool glwebtools::Codec::DecryptXTEA | ( | const void * | indata,
 |  | size_t | indataSize,
 |  | void * | outData,
 |  | size_t | outdataSize,
 |  | const unsigned int * | key
 | ) |  | [static]

Decrypt data according to XTEA.

The input buffer and output buffer can be the same, but input data will be overwriten.

Parameters:
indata | Data to decrypt
indataSize | Size of the data to decrypt
outData | Buffer to write the decrypted data to (must be of size indataSize or more)
outdataSize | Size of the output buffer
key | 128 bit encryption key (4 x unsigned int)
Returns:
True if decryption is successful
bool glwebtools::Codec::DecryptXXTEA | ( | const void * | indata,
 |  | size_t | indataSize,
 |  | void * | outData,
 |  | size_t | outdataSize,
 |  | const unsigned int * | key
 | ) |  | [static]

Decrypt data according to XXTEA.

The input buffer and output buffer can be the same, but input data will be overwriten.

Parameters:
indata | Data to decrypt
indataSize | Size of the data to decrypt
outData | Buffer to write the decrypted data to (must be of size indataSize or more)
outdataSize | Size of the output buffer
key | 128 bit encryption key (4 x unsigned int)
Returns:
True if decryption is successful
bool glwebtools::Codec::EncodeBase64 | ( | const unsigned char * | src,
 |  | size_t | dataSize,
 |  | glwebtools::String & | dest,
 |  | Codec::MaxLineLength | maxLineLength = none
 | ) |  | [static]

Encode a block of data in a base64 string.

Parameters:
src | Block of data to encode
dataSize | Size of the block of data to encode
dest | Reference to append the encoded string to
maxLineLength | Maximum encoded line length. A line feed will be inserted every maxLineLength
Returns:
True if the data was encoded successfully
bool glwebtools::Codec::EncodeBase64 | ( | const unsigned char * | src,
 |  | size_t | dataSize,
 |  | glwebtools::String & | dest,
 |  | size_t | maxLineLength
 | ) |  | [static]

Encode a block of data in a base64 string.

Parameters:
src | Block of data to encode
dataSize | Size of the block of data to encode
dest | Reference to append the encoded string to
maxLineLength | Maximum encoded line length. A line feed will be inserted every maxLineLength
Returns:
True if the data was encoded successfully
bool glwebtools::Codec::EncodeBase64Custom | ( | const unsigned char * | src,
 |  | size_t | dataSize,
 |  | glwebtools::String & | dest,
 |  | const char * | customkey
 | ) |  | [static]

Encode a block of data in a base64 string with a custom key (key must be url encoding compliant)

Parameters:
src | Block of data to encode
dataSize | Size of the block of data to encode
dest | Reference to append the encoded string to
customkey | Encoding key to use
Returns:
True if the data was encoded successfully
bool glwebtools::Codec::EncodeBlob | ( | const unsigned char * | src,
 |  | size_t | dataSize,
 |  | glwebtools::String & | dest
 | ) |  | [static]

Encode a block of data in a blob string.

Parameters:
src | Block of data to encode
dataSize | Size of the block of data to encode
dest | Reference to append the encoded string to
Returns:
True if the data was encoded successfully
bool glwebtools::Codec::EncodeUrlRFC1738 | ( | const glwebtools::String & | source,
 |  | glwebtools::String & | dest
 | ) |  | [static]

Url encode a string according to RFC1738.

Escape any character that is not unreserved according to RFC1738.

Parameters:
source | String to encode
dest | Reference to a string to append the encoded string to
Returns:
True if the string was encoded successfully
bool glwebtools::Codec::EncodeUrlRFC3986 | ( | const glwebtools::String & | source,
 |  | glwebtools::String & | dest
 | ) |  | [static]

Url encode a string according to RFC3986.

Escape any character that is not unreserved according to RFC3986.

Parameters:
source | String to encode
dest | Reference to a string to append the encoded string to
Returns:
True if the string was encoded successfully
bool glwebtools::Codec::EncryptTEA | ( | const void * | indata,
 |  | size_t | indataSize,
 |  | void * | outData,
 |  | size_t | outdataSize,
 |  | const unsigned int * | key
 | ) |  | [static]

Encrypt data according to TEA.

The input buffer and output buffer can be the same, but input data will be overwriten.

Parameters:
indata | Data to encrypt
indataSize | Size of the data to encrypt
outData | Buffer to write the encrypted data to (must be of size indataSize round up to a multiple of 8)
outdataSize | Size of the output buffer
key | 128 bit encryption key (4 x unsigned int)
Returns:
True if encryption is successful
bool glwebtools::Codec::EncryptXTEA | ( | const void * | indata,
 |  | size_t | indataSize,
 |  | void * | outData,
 |  | size_t | outdataSize,
 |  | const unsigned int * | key
 | ) |  | [static]

Encrypt data according to XTEA.

The input buffer and output buffer can be the same, but input data will be overwriten.

Parameters:
indata | Data to encrypt
indataSize | Size of the data to encrypt
outData | Buffer to write the encrypted data to (must be of size indataSize round up to a multiple of 8)
outdataSize | Size of the output buffer
key | 128 bit encryption key (4 x unsigned int)
Returns:
True if encryption is successful
bool glwebtools::Codec::EncryptXXTEA | ( | const void * | indata,
 |  | size_t | indataSize,
 |  | void * | outData,
 |  | size_t | outdataSize,
 |  | const unsigned int * | key
 | ) |  | [static]

Encrypt data according to XXTEA.

The input buffer and output buffer can be the same, but input data will be overwriten.

Parameters:
indata | Data to encrypt
indataSize | Size of the data to encrypt
outData | Buffer to write the encrypted data to (must be of size indataSize round up to a multiple of 4)
outdataSize | Size of the output buffer
key | 128 bit encryption key (4 x unsigned int)
Returns:
True if encryption is successful
void glwebtools::Codec::GenerateBase64CustomKey ( char * key ) [static]

Generate a url encoding compliant key using rand()

Parameters:
key A 64 bytes buffer to contain the generated key
void glwebtools::Codec::GenerateBase64CustomKey | ( | char * | key,
 |  | unsigned int | seed1,
 |  | unsigned int | seed2
 | ) |  | [static]

Generate a url encoding compliant key using procedural generation.

Parameters:
key | A 64 bytes buffer to contain the generated key
seed1 | First 32 bit seed for procedural generation
seed2 | Second 32 bit seed for procedural generation
bool glwebtools::Codec::GenerateMD5 | ( | const void * | data,
 |  | size_t | size,
 |  | char * | dest
 | ) |  | [static]

Generate a MD5 checksum of a data buffer.

Parameters:
data | Data to generate the checksum from
size | Size of the data
dest | A 32 bytes buffer to write the check sum (hexa string)
Returns:
True if checksum was generated successfully
bool glwebtools::Codec::GenerateSHA256 | ( | const void * | data,
 |  | size_t | size,
 |  | char * | dest
 | ) |  | [static]

Generate a SHA256 checksum of a data buffer.

Parameters:
data | Data to generate the checksum from
size | Size of the data
dest | A 64 bytes buffer to write the check sum (hexa string)
Returns:
True if checksum was generated successfully
size_t glwebtools::Codec::GetDecodedBase64DataSize | ( | const glwebtools::String & | base64Data,
 |  | bool | strict = false
 | ) |  | [static]

Get the decoded size of a base64 string.

Parameters:
base64Data | Base64 string to decode
strict | If true, all character not in the alphabet for Base64, will be ignored.
Returns:
Size of the decoded data
size_t glwebtools::Codec::GetDecodedBlobDataSize ( const glwebtools::String & blobbedData ) [static]

Get the decoded size of a blob string.

Parameters:
blobbedData Blobbed string to decode
Returns:
Size of the decoded data
size_t glwebtools::Codec::GetEncryptedTEADataSize ( size_t inDataSize ) [static]

Get the encrypted size of the data using TEA.

Parameters:
inDataSize Size of the data to encrypt
Returns:
Size of the encrypted Data
size_t glwebtools::Codec::GetEncryptedXTEADataSize ( size_t inDataSize ) [static]

Get the encrypted size of the data using XTEA.

Parameters:
inDataSize Size of the data to encrypt
Returns:
Size of the encrypted Data
size_t glwebtools::Codec::GetEncryptedXXTEADataSize ( size_t inDataSize ) [static]

Get the encrypted size of the data using XXTEA.

Parameters:
inDataSize Size of the data to encrypt
Returns:
Size of the encrypted Data
bool glwebtools::Codec::IsInBase64Alphabet ( char data ) [static]

Test whether data is in the base encoding alhpabet.

Parameters:
data Base64 char to decode.
Returns:
True if data is in the base encoding alhpabet, otherwise false.
unsigned int glwebtools::Codec::Random | ( | unsigned int & | seed1,
 |  | unsigned int & | seed2
 | ) |  | [static]

Generate a random number, using seed1 and seed2. Will modify seed1 and seed2.

Parameters:
[out] | seed1 | First seed used to generate the random number. Will contain a new seed.
[out] | seed2 | Second seed used to generate the random number. Will contain a new seed.
Returns:
A random number.
The documentation for this class was generated from the following files:
  • glwebtools_codec.h
  • glwebtools_codec.cpp


GLWebTools: glwebtools::Curl Class Reference

  • glwebtools
  • Curl
Public Member Functions
glwebtools::Curl Class Reference

Managed initialization of Curl. More...

#include <glwebtools_curl.h>

List of all members.

Public Member Functions

Curl ()
Default constructor.
~Curl ()
Default destructor.

Detailed Description

Managed initialization of Curl.

This class sets and unsets the allocators for Curl. The class is internally ref-counted, so the last destroyed instance will destroy the mutexes. This class is not thread-safe so the caller (the application) must ensure that multiple instances are not called concurently. Since GlWebTools stores an instance of this class, GlWebTool must not be concurrently created or destroyed with another instance of this class.

The documentation for this class was generated from the following files:
  • glwebtools_curl.h
  • glwebtools_curl.cpp


GLWebTools: glwebtools::ExcludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > Struct Template Reference

  • glwebtools
  • ExcludedItems
glwebtools::ExcludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > Struct Template Reference

Convenient wrapper to exclude multiple values. More...

#include <glwebtools_jsonbase.h>

List of all members.

Detailed Description

template<typename GLWEBTOOLS_ITERATOR, typename GLWEBTOOLS_VALUE>
struct glwebtools::ExcludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE >

Convenient wrapper to exclude multiple values.

The documentation for this struct was generated from the following file:
  • glwebtools_jsonbase.h


GLWebTools: glwebtools::FalseType Struct Reference

  • glwebtools
  • FalseType
glwebtools::FalseType Struct Reference

Boolean false in meta-expression. More...

#include <glwebtools_typetraits.h>

Inheritance diagram for glwebtools::FalseType:
glwebtools::IsArgumentOptional< GLWEBTOOLS_T > glwebtools::IsArgumentRequired< GLWEBTOOLS_T > glwebtools::IsArgumentWrapped< GLWEBTOOLS_T > glwebtools::IsList< GLWEBTOOLS_T > glwebtools::IsRange< GLWEBTOOLS_T >

List of all members.

Detailed Description

Boolean false in meta-expression.

The documentation for this struct was generated from the following file:
  • glwebtools_typetraits.h


GLWebTools: glwebtools::FloatFormatter< PRECISION > Class Template Reference

  • glwebtools
  • FloatFormatter
Public Member Functions
glwebtools::FloatFormatter< PRECISION > Class Template Reference

Functor used to format attributes of requests to string. More...

#include <glwebtools_attributeformatter.h>

List of all members.

Public Member Functions

std::string | operator() (float value) const
std::string | operator() (double value) const
bool | operator== (const FloatFormatter< PRECISION > &) const

Detailed Description

template<int PRECISION>
class glwebtools::FloatFormatter< PRECISION >

Functor used to format attributes of requests to string.

Formatter of float values, with a fixed precision.

Member Function Documentation

template<int PRECISION>
std::string glwebtools::FloatFormatter< PRECISION >::operator() ( float value ) const [inline]

Formats value to string

Parameters:
value The value to format
Returns:
The formatted string
template<int PRECISION>
std::string glwebtools::FloatFormatter< PRECISION >::operator() ( double value ) const [inline]

Formats value to string

Parameters:
value The value to format
Returns:
The formatted string
template<int PRECISION>
bool glwebtools::FloatFormatter< PRECISION >::operator== ( const FloatFormatter< PRECISION > & ) const [inline]

Equality operator

The documentation for this class was generated from the following file:
  • glwebtools_attributeformatter.h


GLWebTools: glwebtools::GlWebTools Class Reference

  • glwebtools
  • GlWebTools
Classes | Public Member Functions
glwebtools::GlWebTools Class Reference

GlWebTools main class. More...

#include <glwebtools_glwebtoolshandle.h>

List of all members.

Classes

struct | CreationSettings
GlWebTools creation settings structure. More...

Public Member Functions

GlWebTools ()
Default constructor for empty handle.
GlWebTools (const GlWebTools &rhs)
Copy constructor.
~GlWebTools ()
Default destructor.
glwebtools::Error | AddTaskGroup (const TaskGroupId &id, const TaskGroup::CreationSettings &creationSettings)
glwebtools::Error | AddTaskGroup (const TaskGroupId &id)
UrlConnection CreateUrlConnection ()
Create a managed UrlConnection.
UrlConnection | CreateUrlConnection (UrlConnection::CreationSettings &cs)
Create a managed UrlConnection with custom configuration.
UrlRequest CreateUrlRequest ()
Create a managed UrlRequest.
UrlRequest | CreateUrlRequest (UrlRequest::CreationSettings &cs)
Create a managed UrlRequest.
glwebtools::Error | Initialize (const GlWebTools::CreationSettings &cs)
Initialize GlWebTools.
bool | IsInitialized () const
Verify instance initialization.
GlWebTools & | operator= (const GlWebTools &rhs)
Assignation contructor.
glwebtools::Error | Release ()
Release the reference to the internal GlWebTools.
glwebtools::Error | Release (unsigned int milliseconds)
Release the reference to the internal GlWebTools.
glwebtools::Error | Shutdown ()
Shutdown GlWebTools.
bool | ShutdownInProgress () const
Test if Shutdown is in progress.
glwebtools::Error | Terminate ()
glwebtools::Error | Terminate (unsigned int milliseconds)
glwebtools::Error | Update ()
Update GlWebTools.

Detailed Description

GlWebTools main class.

Member Function Documentation

glwebtools::Error glwebtools::GlWebTools::AddTaskGroup | ( | const TaskGroupId & | id,
 |  | const TaskGroup::CreationSettings & | creationSettings
 | ) |  |

Add a new task group for the url connections.

Parameters:
id | a unique id for the taskgroup
creationSettings | configuration of the task group
Return values:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_PARAMETER | if a task group with the same id already exists.
glwebtools::E_MEMORY_ERROR | not enough memory to allocate the task group
Precondition:
IsInitialized() == true
glwebtools::Error glwebtools::GlWebTools::AddTaskGroup ( const TaskGroupId & id )

Add a new task group with default settings for the url connections.

Parameters:
id a unique id for the taskgroup
Return values:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_PARAMETER | if a task group with the same id already exists.
glwebtools::E_MEMORY_ERROR | not enough memory to allocate the task group
Precondition:
IsInitialized() == true
UrlConnection glwebtools::GlWebTools::CreateUrlConnection ( )

Create a managed UrlConnection.

Returns:
a handle to the UrlConnection if created
Precondition:
IsInitialized() == true
Postcondition:
ShutdownInProgress() == false
UrlConnection glwebtools::GlWebTools::CreateUrlConnection ( UrlConnection::CreationSettings & cs )

Create a managed UrlConnection with custom configuration.

Parameters:
cs Creation settings for the UrlConnection
Returns:
a handle to the UrlConnection if created
Precondition:
IsInitialized() == true
Postcondition:
ShutdownInProgress() == false
UrlRequest glwebtools::GlWebTools::CreateUrlRequest ( )

Create a managed UrlRequest.

Returns:
a handle to the UrlRequest if created
Precondition:
IsInitialized() == true
Postcondition:
ShutdownInProgress() == false
UrlRequest glwebtools::GlWebTools::CreateUrlRequest ( UrlRequest::CreationSettings & cs )

Create a managed UrlRequest.

Parameters:
cs Creation settings for the UrlRequest
Returns:
a handle to the UrlRequest if created
Precondition:
IsInitialized() == true
Postcondition:
ShutdownInProgress() == false
glwebtools::Error glwebtools::GlWebTools::Initialize ( const GlWebTools::CreationSettings & cs )

Initialize GlWebTools.

No effect if GlWebTools is already initialized

Parameters:
cs CreationSetting for the initialization of GlWebTools
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_OPERATION | if GlWebTools is already initialized
glwebtools::E_INITIALIZATION_ERROR | if a fatal error occured during initialization
glwebtools::E_MEMORY_ERROR | if a memory allocation prevent the initialization from completing
Precondition:
IsValid() == true
IsInitialized() == false
Postcondition:
IsInitialized() == true
bool glwebtools::GlWebTools::IsInitialized ( ) const

Verify instance initialization.

Return values:
True | The instance is initialized.
False | The handle is not valid or the instance is not initialized.
glwebtools::Error glwebtools::GlWebTools::Release ( )

Release the reference to the internal GlWebTools.

Returns:
glwebtools::E_SUCCESS if the internal GlWebTools reference was released
Postcondition:
IsInitialized() == false
glwebtools::Error glwebtools::GlWebTools::Release ( unsigned int milliseconds )

Release the reference to the internal GlWebTools.

Parameters:
milliseconds timeout before termination.
Returns:
glwebtools::E_SUCCESS if the internal GlWebTools reference was released
Postcondition:
IsInitialized() == false
glwebtools::Error glwebtools::GlWebTools::Shutdown ( )

Shutdown GlWebTools.

When shutdown is call, it will always send a cancel instruction to all connections running.

Return values:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
Precondition:
IsInitialized() == true
Postcondition:
ShutdownInProgress() == true
bool glwebtools::GlWebTools::ShutdownInProgress ( ) const

Test if Shutdown is in progress.

Return values:
True | if Shutdown is in progress.
False | The handle is not valid or there is no shutdown in progress.
glwebtools::Error glwebtools::GlWebTools::Terminate ( )

Wait for shutdown completion, then destroy all dependent connection and request. All connections and request will be deleted when there are no more running connection or after the default timeout.

Return values:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
Precondition:
IsInitialized() == true
Postcondition:
IsInitialized() == false
ShutdownInProgress() == false
glwebtools::Error glwebtools::GlWebTools::Terminate ( unsigned int milliseconds )

Wait for shutdown completion, then destroy all dependent connection and request. All connections and request will be deleted when there are no more running connection or after milliseconds.

Parameters:
milliseconds timeout before termination.
Return values:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
Precondition:
IsInitialized() == true
Postcondition:
IsInitialized() == false
ShutdownInProgress() == false
glwebtools::Error glwebtools::GlWebTools::Update ( )

Update GlWebTools.

This call does nothing when in threaded mode

Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_OPERATION | if GlWebTools is not initialized
glwebtools::E_INVALID_DATA | if internal data error prevented update
Precondition:
IsInitialized() == true
The documentation for this class was generated from the following files:
  • glwebtools_glwebtoolshandle.h
  • glwebtools_glwebtools.cpp


GLWebTools: glwebtools::GlWebTools::CreationSettings Struct Reference

  • glwebtools
  • GlWebTools
  • CreationSettings
Public Member Functions | Public Attributes
glwebtools::GlWebTools::CreationSettings Struct Reference

GlWebTools creation settings structure. More...

#include <glwebtools_glwebtoolshandle.h>

List of all members.

Public Member Functions

CreationSettings ()
Default contructor.

Public Attributes

std::string | m_applicationIdentifier
Application identifier, will be used in user-agent field.
std::string | m_applicationVersion
Application version, will be used in user-agent field.
unsigned int | m_connectionHysteresis_ms
time (ms) before reducing the thread pool by one when there are idle threads in the pool of the default task group for connections.
unsigned int | m_connectionMaxThreadCount
Max Number of threads in the pool of the default task group for connections.
unsigned int | m_connectionMinThreadCount
Min Number of threads in the pool of the default task group for connections.
glwebtools::Thread::Priority | m_connectionThreadPriority
Threads priority of the default task group for connections.
std::string | m_deviceIdentifier
Device identifier.
std::string | m_instanceName
Optional. Debug info.
bool | m_isThreadedUpdate
Set the update to its own thread (unmanaged mode)
unsigned int | m_maxThreadStartTime_ms
time (ms) before removing a thread failing to start.
std::string | m_osIdentifier
OS identifier, will be used in user-agent field.
std::string | m_osVersion
OS version, will be used in user-agent field.
unsigned int | m_threadedUpdatePeriod
Update period when in threaded mode (in ms)
glwebtools::Thread::Priority | m_updateThreadPriority
Thread priority to use when in threaded mode.

Detailed Description

GlWebTools creation settings structure.

Constructor & Destructor Documentation

glwebtools::GlWebTools::CreationSettings::CreationSettings ( )

Default contructor.

Initialize all internal value to default

The documentation for this struct was generated from the following files:
  • glwebtools_glwebtoolshandle.h
  • glwebtools_glwebtools.cpp


GLWebTools: glwebtools::GlWebToolsCore Class Reference

  • glwebtools
  • GlWebToolsCore
Public Member Functions
glwebtools::GlWebToolsCore Class Reference

GlWebTools core class. More...

#include <glwebtools_glwebtoolscore.h>

Inherits glwebtools::Managed.

List of all members.

Public Member Functions

virtual | ~GlWebToolsCore ()
Destructor - Application should not call it directly.
glwebtools::Error | AddTaskGroup (const TaskGroupId &id, const TaskGroup::CreationSettings &creationSettings)
glwebtools::Error | AddTaskGroup (const TaskGroupId &id)

Detailed Description

GlWebTools core class.

Member Function Documentation

glwebtools::Error glwebtools::GlWebToolsCore::AddTaskGroup | ( | const TaskGroupId & | id,
 |  | const TaskGroup::CreationSettings & | creationSettings
 | ) |  |

Add a new task group for the url connections.

Parameters:
id | a unique id for the taskgroup
creationSettings | configuration of the task group
Return values:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_PARAMETER | if a task group with the same id already exists.
glwebtools::E_MEMORY_ERROR | not enough memory to allocate the task group
Precondition:
IsInitialized() == true
glwebtools::Error glwebtools::GlWebToolsCore::AddTaskGroup ( const TaskGroupId & id )

Add a new task group with default settings for the url connections.

Parameters:
id a unique id for the taskgroup
Return values:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_PARAMETER | if a task group with the same id already exists.
glwebtools::E_MEMORY_ERROR | not enough memory to allocate the task group
Precondition:
IsInitialized() == true
The documentation for this class was generated from the following files:
  • glwebtools_glwebtoolscore.h
  • glwebtools_glwebtools.cpp


GLWebTools: glwebtools::HandleManager Class Reference

  • glwebtools
  • HandleManager
glwebtools::HandleManager Class Reference

Class that manage the handle. More...

#include <glwebtools_handlemanager.h>

Inherits glwebtools::NonCopyable.

List of all members.

Detailed Description

Class that manage the handle.

This object manage the handle from the time an object is registered as handlable to the time it's unregistered. The manager will create a token on successful registration that will be required to unregister an object or get the pointer to the object inside the node.

The implementation allows O(1) insertion and removal and O(1) object pointer request.
The manager is meant to be shared and is thread safe. Type and counter can be manage by the manager or locally. If type are managed locally, the application is responsible to avoid type id clash. Type id 0 should not be used to avoid confusion with null token (0)

The documentation for this class was generated from the following files:
  • glwebtools_handlemanager.h
  • glwebtools_handlemanager.cpp


GLWebTools: glwebtools::IncludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > Struct Template Reference

  • glwebtools
  • IncludedItems
glwebtools::IncludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > Struct Template Reference

Convenient wrapper to include multiple values. More...

#include <glwebtools_jsonbase.h>

List of all members.

Detailed Description

template<typename GLWEBTOOLS_ITERATOR, typename GLWEBTOOLS_VALUE>
struct glwebtools::IncludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE >

Convenient wrapper to include multiple values.

The documentation for this struct was generated from the following file:
  • glwebtools_jsonbase.h


GLWebTools: glwebtools::IndexedValue< GLWEBTOOLS_VALUE > Struct Template Reference

  • glwebtools
  • IndexedValue
glwebtools::IndexedValue< GLWEBTOOLS_VALUE > Struct Template Reference

Convenient wrapper to find value by index. More...

#include <glwebtools_jsonbase.h>

List of all members.

Detailed Description

template<typename GLWEBTOOLS_VALUE>
struct glwebtools::IndexedValue< GLWEBTOOLS_VALUE >

Convenient wrapper to find value by index.

The documentation for this struct was generated from the following file:
  • glwebtools_jsonbase.h


GLWebTools: glwebtools::IsArgumentOptional< GLWEBTOOLS_T > Struct Template Reference

  • glwebtools
  • IsArgumentOptional
glwebtools::IsArgumentOptional< GLWEBTOOLS_T > Struct Template Reference

Returns TrueType if GLWEBTOOLS_T is an optional argument, FalseType otherwise. More...

#include <glwebtools_argumentwrapper.h>

Inheritance diagram for glwebtools::IsArgumentOptional< GLWEBTOOLS_T >:
glwebtools::FalseType

List of all members.

Detailed Description

template<typename GLWEBTOOLS_T>
struct glwebtools::IsArgumentOptional< GLWEBTOOLS_T >

Returns TrueType if GLWEBTOOLS_T is an optional argument, FalseType otherwise.

The documentation for this struct was generated from the following file:
  • glwebtools_argumentwrapper.h


GLWebTools: glwebtools::IsArgumentRequired< GLWEBTOOLS_T > Struct Template Reference

  • glwebtools
  • IsArgumentRequired
glwebtools::IsArgumentRequired< GLWEBTOOLS_T > Struct Template Reference

Returns TrueType if GLWEBTOOLS_T is a required argument, FalseType otherwise. More...

#include <glwebtools_argumentwrapper.h>

Inheritance diagram for glwebtools::IsArgumentRequired< GLWEBTOOLS_T >:
glwebtools::FalseType

List of all members.

Detailed Description

template<typename GLWEBTOOLS_T>
struct glwebtools::IsArgumentRequired< GLWEBTOOLS_T >

Returns TrueType if GLWEBTOOLS_T is a required argument, FalseType otherwise.

The documentation for this struct was generated from the following file:
  • glwebtools_argumentwrapper.h


GLWebTools: glwebtools::IsArgumentWrapped< GLWEBTOOLS_T > Struct Template Reference

  • glwebtools
  • IsArgumentWrapped
glwebtools::IsArgumentWrapped< GLWEBTOOLS_T > Struct Template Reference

Returns TrueType if GLWEBTOOLS_T is wrapped, FalseType otherwise. More...

#include <glwebtools_argumentwrapper.h>

Inheritance diagram for glwebtools::IsArgumentWrapped< GLWEBTOOLS_T >:
glwebtools::FalseType

List of all members.

Detailed Description

template<typename GLWEBTOOLS_T>
struct glwebtools::IsArgumentWrapped< GLWEBTOOLS_T >

Returns TrueType if GLWEBTOOLS_T is wrapped, FalseType otherwise.

The documentation for this struct was generated from the following file:
  • glwebtools_argumentwrapper.h


GLWebTools: glwebtools::IsList< GLWEBTOOLS_T > Struct Template Reference

  • glwebtools
  • IsList
glwebtools::IsList< GLWEBTOOLS_T > Struct Template Reference

Specialize this traits for a class if it has functions begin() and end() and typedef iterator. More...

#include <glwebtools_attributeformatter.h>

Inheritance diagram for glwebtools::IsList< GLWEBTOOLS_T >:
glwebtools::FalseType

List of all members.

Detailed Description

template<typename GLWEBTOOLS_T>
struct glwebtools::IsList< GLWEBTOOLS_T >

Specialize this traits for a class if it has functions begin() and end() and typedef iterator.

The documentation for this struct was generated from the following file:
  • glwebtools_attributeformatter.h


GLWebTools: glwebtools::IsRange< GLWEBTOOLS_T > Struct Template Reference

  • glwebtools
  • IsRange
glwebtools::IsRange< GLWEBTOOLS_T > Struct Template Reference

Specialize this traits for a class if it has functions getMinValue() and getMaxValue(). More...

#include <glwebtools_attributeformatter.h>

Inheritance diagram for glwebtools::IsRange< GLWEBTOOLS_T >:
glwebtools::FalseType

List of all members.

Detailed Description

template<typename GLWEBTOOLS_T>
struct glwebtools::IsRange< GLWEBTOOLS_T >

Specialize this traits for a class if it has functions getMinValue() and getMaxValue().

The documentation for this struct was generated from the following file:
  • glwebtools_attributeformatter.h


GLWebTools: glwebtools::JsonReader Class Reference

  • glwebtools
  • JsonReader
Classes | Public Member Functions | Static Public Member Functions
glwebtools::JsonReader Class Reference

Parses a Json string and provides retrieval and conversion of data. More...

#include <glwebtools_jsonreader.h>

List of all members.

Classes

class | Iterator
Iterator over array items or object items in a JsonReader. More...

Public Member Functions

JsonReader ()
Default constructor.
JsonReader (const std::string &data)
JsonReader (const char *data)
Iterator | begin () const
Iterator | end () const
glwebtools::Error | exclude (const char **begin, const char **end, glwebtools::CustomAttributeList &value) const
glwebtools::Error | exclude (const char **begin, const char **end, glwebtools::JSONObject &value) const
glwebtools::Error | exclude (size_t *begin, size_t *end, glwebtools::JSONArray &value) const
glwebtools::Error | include (const char **begin, const char **end, glwebtools::CustomAttributeList &value) const
glwebtools::Error | include (const char **begin, const char **end, glwebtools::JSONObject &value) const
glwebtools::Error | include (size_t *begin, size_t *end, glwebtools::JSONArray &value) const
bool | isArray () const
bool | isBool () const
bool | isDouble () const
bool | isInt () const
bool | isObject () const
bool | isString () const
bool | isUInt () const
bool | IsValid () const
JsonReader | operator[] (unsigned int index) const
JsonReader | operator[] (const std::string &name) const
JsonReader | operator[] (const char *name) const
glwebtools::Error | parse (const std::string &data)
glwebtools::Error | parse (const char *data)
glwebtools::Error | read (short &value) const
glwebtools::Error | read (unsigned short &value) const
glwebtools::Error | read (int &value) const
glwebtools::Error | read (unsigned int &value) const
glwebtools::Error | read (double &value) const
glwebtools::Error | read (bool &value) const
glwebtools::Error | read (std::string &value) const
glwebtools::Error | read (glwebtools::CustomArgument &argument) const
glwebtools::Error | read (glwebtools::CustomAttributeList &attribute) const
glwebtools::Error | read (glwebtools::JSONValue &argument) const
glwebtools::Error | read (glwebtools::JSONObject &value) const
glwebtools::Error | read (glwebtools::JSONArray &value) const
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error | read (GLWEBTOOLS_VALUE &value) const
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error | read (NameValuePair< GLWEBTOOLS_VALUE > value) const
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error | read (NameValuePair< glwebtools::OptionalArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > > value) const
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error | read (IndexedValue< GLWEBTOOLS_VALUE > value) const
template<typename GLWEBTOOLS_ITERATOR , typename GLWEBTOOLS_VALUE >
glwebtools::Error | read (IncludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > value) const
template<typename GLWEBTOOLS_ITERATOR , typename GLWEBTOOLS_VALUE >
glwebtools::Error | read (ExcludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > value) const
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error | read (IndexedValue< glwebtools::OptionalArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > > value) const
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error | read (glwebtools::OptionalArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > &value) const
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error | read (glwebtools::RequiredArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > &value) const
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_ALLOCATOR >
glwebtools::Error | read (std::vector< GLWEBTOOLS_VALUE, GLWEBTOOLS_ALLOCATOR > &container) const
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_COMPARE , typename GLWEBTOOLS_ALLOCATOR >
glwebtools::Error | read (std::set< GLWEBTOOLS_VALUE, GLWEBTOOLS_COMPARE, GLWEBTOOLS_ALLOCATOR > &container) const
template<typename GLWEBTOOLS_KEY , typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_COMPARE , typename GLWEBTOOLS_ALLOCATOR >
glwebtools::Error | read (std::map< GLWEBTOOLS_KEY, GLWEBTOOLS_VALUE, GLWEBTOOLS_COMPARE, GLWEBTOOLS_ALLOCATOR > &container) const
size_t | size () const
std::string | ToString () const
void | ToString (std::string &result) const

Static Public Member Functions

template<typename GLWEBTOOLS_VALUE >
static IndexedValue
< GLWEBTOOLS_VALUE > 		ByIndex (unsigned int index, GLWEBTOOLS_VALUE &value)
template<typename GLWEBTOOLS_VALUE >
static NameValuePair
< GLWEBTOOLS_VALUE > 		ByName (const std::string &name, GLWEBTOOLS_VALUE &value)
template<typename GLWEBTOOLS_VALUE >
static NameValuePair
< GLWEBTOOLS_VALUE > 		ByName (const char *name, GLWEBTOOLS_VALUE &value)

Detailed Description

Parses a Json string and provides retrieval and conversion of data.

Constructor & Destructor Documentation

glwebtools::JsonReader::JsonReader ( const std::string & data ) [explicit]

Constructor.

Parameters:
data Json string to be parsed
glwebtools::JsonReader::JsonReader ( const char * data ) [explicit]

Constructor.

Parameters:
data Json string to be parsed

Member Function Documentation

JsonReader::Iterator glwebtools::JsonReader::begin ( ) const

Returns an iterator on the first item of the Json array. If the embedded Json is not of type array, returns an invalid iterator.

Returns:
an iterator on the first item of the Json array.
template<typename GLWEBTOOLS_VALUE >
static IndexedValue<GLWEBTOOLS_VALUE> glwebtools::JsonReader::ByIndex | ( | unsigned int | index,
 |  | GLWEBTOOLS_VALUE & | value
 | ) |  | [inline, static]

IndexedValue generator

Parameters:
index | index of the data to be read
[out] | value | value to contains the read data
template<typename GLWEBTOOLS_VALUE >
static NameValuePair<GLWEBTOOLS_VALUE> glwebtools::JsonReader::ByName | ( | const std::string & | name,
 |  | GLWEBTOOLS_VALUE & | value
 | ) |  | [inline, static]

NameValuePair generator

Parameters:
name | name of the data to be read
[out] | value | value to contains the read data
template<typename GLWEBTOOLS_VALUE >
static NameValuePair<GLWEBTOOLS_VALUE> glwebtools::JsonReader::ByName | ( | const char * | name,
 |  | GLWEBTOOLS_VALUE & | value
 | ) |  | [inline, static]

NameValuePair generator

Parameters:
name | name of the data to be read
[out] | value | value to contains the read data
JsonReader::Iterator glwebtools::JsonReader::end ( ) const

Returns an iterator past the last item of the Json array. If the embedded Json is not of type array, returns an invalid iterator.

Returns:
an iterator past the last item of the Json array.
glwebtools::Error glwebtools::JsonReader::exclude | ( | const char ** | begin,
 |  | const char ** | end,
 |  | glwebtools::CustomAttributeList & | value
 | ) |  | const

Transfer all items excluding those identified by keys into value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
glwebtools::Error glwebtools::JsonReader::exclude | ( | const char ** | begin,
 |  | const char ** | end,
 |  | glwebtools::JSONObject & | value
 | ) |  | const

Transfer all items excluding those identified by keys into value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
glwebtools::Error glwebtools::JsonReader::exclude | ( | size_t * | begin,
 |  | size_t * | end,
 |  | glwebtools::JSONArray & | value
 | ) |  | const

Transfer all items excluding those identified by keys into value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
glwebtools::Error glwebtools::JsonReader::include | ( | const char ** | begin,
 |  | const char ** | end,
 |  | glwebtools::CustomAttributeList & | value
 | ) |  | const

Transfer all items identified by keys into value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
glwebtools::Error glwebtools::JsonReader::include | ( | const char ** | begin,
 |  | const char ** | end,
 |  | glwebtools::JSONObject & | value
 | ) |  | const

Transfer all items identified by keys into value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
glwebtools::Error glwebtools::JsonReader::include | ( | size_t * | begin,
 |  | size_t * | end,
 |  | glwebtools::JSONArray & | value
 | ) |  | const

Transfer all items identified by keys into value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
bool glwebtools::JsonReader::isArray ( ) const

Returns whether the embedded json is of type Array

Return values:
true | if the embedded json is of type Array
false | if the embedded json is not of type Array
bool glwebtools::JsonReader::isBool ( ) const

Returns whether the embedded json is of type Bool

Return values:
true | if the embedded json is of type Bool
false | if the embedded json is not of type Bool
bool glwebtools::JsonReader::isDouble ( ) const

Returns whether the embedded json is of type Double

Return values:
true | if the embedded json is of type Double
false | if the embedded json is not of type Double
bool glwebtools::JsonReader::isInt ( ) const

Returns whether the embedded json is of type Int

Return values:
true | if the embedded json is of type Int
false | if the embedded json is not of type Int
bool glwebtools::JsonReader::isObject ( ) const

Returns whether the embedded json is of type Object

Return values:
true | if the embedded json is of type Object
false | if the embedded json is not of type Object
bool glwebtools::JsonReader::isString ( ) const

Returns whether the embedded json is of type String

Return values:
true | if the embedded json is of type String
false | if the embedded json is not of type String
bool glwebtools::JsonReader::isUInt ( ) const

Returns whether the embedded json is of type UInt

Return values:
true | if the embedded json is of type UInt
false | if the embedded json is not of type UInt
bool glwebtools::JsonReader::IsValid ( ) const

Returns whether the embedded json is valid or not

Return values:
true | if the value is valid
false | if the value is not valid
JsonReader glwebtools::JsonReader::operator[] ( unsigned int index ) const

Retrieves an item by index in the Json array. If the index si not valid or this instance is not an array, returns an invalid JsonReader.

Parameters:
index index of the item in the array
Returns:
a JsonReader containing providing access to the item.
JsonReader glwebtools::JsonReader::operator[] ( const std::string & name ) const

Retrieves an item by name in the Json object. If the index is not valid or this instance is not an object, returns an invalid JsonReader.

Parameters:
name index of the item in the object
Returns:
a JsonReader containing providing access to the item.
JsonReader glwebtools::JsonReader::operator[] ( const char * name ) const

Retrieves an item by name in the Json object. If the index is not valid or this instance is not an object, returns an invalid JsonReader.

Parameters:
name index of the item in the object
Returns:
a JsonReader containing providing access to the item.
glwebtools::Error glwebtools::JsonReader::parse ( const std::string & data )

Parses a Json string

Parameters:
data Json string to be parsed
Return values:
federation::E_INVALID_PARAMETER | if data cannot be parsed.
federation::E_SUCCESS | if the method succeeded.
glwebtools::Error glwebtools::JsonReader::parse ( const char * data )

Parses a Json string

Parameters:
data Json string to be parsed
Return values:
federation::E_INVALID_PARAMETER | if data cannot be parsed.
federation::E_SUCCESS | if the method succeeded.
glwebtools::Error glwebtools::JsonReader::read ( short & value ) const

Read the parsed Json string and converts it to value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
glwebtools::Error glwebtools::JsonReader::read ( unsigned short & value ) const

Read the parsed Json string and converts it to value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
glwebtools::Error glwebtools::JsonReader::read ( int & value ) const

Read the parsed Json string and converts it to value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
glwebtools::Error glwebtools::JsonReader::read ( unsigned int & value ) const

Read the parsed Json string and converts it to value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
glwebtools::Error glwebtools::JsonReader::read ( double & value ) const

Read the parsed Json string and converts it to value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
glwebtools::Error glwebtools::JsonReader::read ( bool & value ) const

Read the parsed Json string and converts it to value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
glwebtools::Error glwebtools::JsonReader::read ( std::string & value ) const

Read the parsed Json string and converts it to value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
glwebtools::Error glwebtools::JsonReader::read ( glwebtools::CustomArgument & argument ) const

Read the parsed Json string and converts it to value

Parameters:
[out] argument value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
glwebtools::Error glwebtools::JsonReader::read ( glwebtools::CustomAttributeList & attribute ) const

Read the parsed Json string and converts it to value

Parameters:
[out] argument value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
glwebtools::Error glwebtools::JsonReader::read ( glwebtools::JSONValue & argument ) const

Read the parsed Json string and converts it to value

Parameters:
[out] argument value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
glwebtools::Error glwebtools::JsonReader::read ( glwebtools::JSONObject & value ) const

Read the parsed Json string and converts it to value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
glwebtools::Error glwebtools::JsonReader::read ( glwebtools::JSONArray & value ) const

Read the parsed Json string and converts it to value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::JsonReader::read ( GLWEBTOOLS_VALUE & value ) const [inline]

Read the parsed Json string and converts it to value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::JsonReader::read ( NameValuePair< GLWEBTOOLS_VALUE > value ) const [inline]

Read the parsed Json string and converts it to value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error glwebtools::JsonReader::read ( NameValuePair< glwebtools::OptionalArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > > value ) const [inline]

Read the parsed Json string and converts it to value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::JsonReader::read ( IndexedValue< GLWEBTOOLS_VALUE > value ) const [inline]

Read the parsed Json string and converts it to value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
template<typename GLWEBTOOLS_ITERATOR , typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::JsonReader::read ( IncludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > value ) const [inline]

Read the parsed Json string and converts it to value

Parameters:
[out] value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
template<typename GLWEBTOOLS_ITERATOR , typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::JsonReader::read ( ExcludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > value ) const [inline]

Read the parsed Json string and converts it to value

Parameters:
[out] value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error glwebtools::JsonReader::read ( IndexedValue< glwebtools::OptionalArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > > value ) const [inline]

Read the parsed Json string and converts it to value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error glwebtools::JsonReader::read ( glwebtools::OptionalArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > & value ) const [inline]

Read the parsed Json string and converts it to value

Parameters:
[out] value value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error glwebtools::JsonReader::read ( glwebtools::RequiredArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > & value ) const [inline]

Read the parsed Json string and converts it to value

Parameters:
[out] value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_ALLOCATOR >
glwebtools::Error glwebtools::JsonReader::read ( std::vector< GLWEBTOOLS_VALUE, GLWEBTOOLS_ALLOCATOR > & container ) const [inline]

Read the parsed Json string and converts it to value

Parameters:
[out] value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_COMPARE , typename GLWEBTOOLS_ALLOCATOR >
glwebtools::Error glwebtools::JsonReader::read ( std::set< GLWEBTOOLS_VALUE, GLWEBTOOLS_COMPARE, GLWEBTOOLS_ALLOCATOR > & container ) const [inline]

Read the parsed Json string and converts it to value

Parameters:
[out] value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
template<typename GLWEBTOOLS_KEY , typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_COMPARE , typename GLWEBTOOLS_ALLOCATOR >
glwebtools::Error glwebtools::JsonReader::read ( std::map< GLWEBTOOLS_KEY, GLWEBTOOLS_VALUE, GLWEBTOOLS_COMPARE, GLWEBTOOLS_ALLOCATOR > & container ) const [inline]

Read the parsed Json string and converts it to value

Parameters:
[out] value to contains the read data
Return values:
federation::E_INVALID_OPERATION | if the JsonReader is not valid.
federation::E_INVALID_PARAMETER | if the type of the value is not compatible with the parsed Json string.
federation::E_SUCCESS | if the method succeeded.
size_t glwebtools::JsonReader::size ( ) const

Number of values in the embedded json object of type array or object.

Returns:
Number of values in array or object.
std::string glwebtools::JsonReader::ToString ( ) const

Returns the Json string

Returns:
the Json string
void glwebtools::JsonReader::ToString ( std::string & result ) const

Returns the Json string

Parameters:
[out] result the Json string
The documentation for this class was generated from the following files:
  • glwebtools_jsonreader.h
  • glwebtools_jsonreader.cpp


GLWebTools: glwebtools::JsonReader::Iterator Class Reference

  • glwebtools
  • JsonReader
  • Iterator
Public Member Functions
glwebtools::JsonReader::Iterator Class Reference

Iterator over array items or object items in a JsonReader. More...

#include <glwebtools_jsonreader.h>

List of all members.

Public Member Functions

Iterator ()
Default constructor.
Iterator (const Iterator &other)
Copy constructor.
unsigned int | index () const
Get the index of the current pointed element (for a Json array)
std::string | name () const
Get the name of the current pointed element (for a Json object)
bool | operator!= (const Iterator &other) const
Unequality operator.
reference | operator* () const
Indirection operator.
Iterator | operator++ (int)
Postfix increment operator.
Iterator & operator++ ()
Prefix decrement operator.
Iterator | operator-- (int)
Postfix decrement operator.
Iterator & operator-- ()
Prefix increment operator.
Iterator & | operator= (const Iterator &other)
Assignment operator.
bool | operator== (const Iterator &other) const
Equality operator.

Detailed Description

Iterator over array items or object items in a JsonReader.

The documentation for this class was generated from the following files:
  • glwebtools_jsonreader.h
  • glwebtools_jsonreader.cpp


GLWebTools: glwebtools::JsonWriter Class Reference

  • glwebtools
  • JsonWriter
Public Member Functions
glwebtools::JsonWriter Class Reference

Format data in Json. More...

#include <glwebtools_jsonwriter.h>

List of all members.

Public Member Functions

JsonWriter ()
Default constructor.
template<typename GLWEBTOOLS_VALUE >
JsonWriter (GLWEBTOOLS_VALUE value)
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error | append (const GLWEBTOOLS_VALUE &value)
glwebtools::Error | exclude (const char **begin, const char **end, const glwebtools::CustomAttributeList &value)
glwebtools::Error | exclude (const char **begin, const char **end, const glwebtools::JSONObject &value)
glwebtools::Error | exclude (size_t *begin, size_t *end, const glwebtools::JSONArray &value)
glwebtools::Error | include (const char **begin, const char **end, const glwebtools::CustomAttributeList &value)
glwebtools::Error | include (const char **begin, const char **end, const glwebtools::JSONObject &value)
glwebtools::Error | include (size_t *begin, size_t *end, const glwebtools::JSONArray &value)
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error | insert (unsigned int index, const GLWEBTOOLS_VALUE &value)
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error | insert (const std::string &name, const GLWEBTOOLS_VALUE &value)
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error | insert (const char *name, const GLWEBTOOLS_VALUE &value)
bool | isArray () const
bool | isBool () const
bool | isDouble () const
bool | isInt () const
bool | isObject () const
bool | isString () const
bool | isUInt () const
bool | IsValid () const
JsonWriter | operator[] (unsigned int index)
JsonWriter | operator[] (const std::string &name)
JsonWriter | operator[] (const char *name)
std::string | ToPrettyString () const
void | ToPrettyString (std::string &result) const
std::string | ToString () const
void | ToString (std::string &result) const
glwebtools::Error | write (int value)
glwebtools::Error | write (unsigned int value)
glwebtools::Error | write (double value)
glwebtools::Error | write (float value)
glwebtools::Error | write (bool value)
glwebtools::Error | write (const std::string &value)
glwebtools::Error | write (const char *value)
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error | write (const GLWEBTOOLS_VALUE &value)
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error | write (NameValuePair< GLWEBTOOLS_VALUE > value)
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error | write (NameValuePair< const glwebtools::OptionalArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > > value)
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error | write (NameValuePair< const glwebtools::RequiredArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > > value)
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error | write (IndexedValue< GLWEBTOOLS_VALUE > value)
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error | write (IndexedValue< const glwebtools::OptionalArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > > value)
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error | write (IndexedValue< const glwebtools::RequiredArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > > value)
template<typename GLWEBTOOLS_ITERATOR , typename GLWEBTOOLS_VALUE >
glwebtools::Error | write (IncludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > value)
template<typename GLWEBTOOLS_ITERATOR , typename GLWEBTOOLS_VALUE >
glwebtools::Error | write (ExcludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > value)
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error | write (const glwebtools::OptionalArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > &value)
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error | write (const glwebtools::RequiredArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > &value)
glwebtools::Error | write (const glwebtools::CustomArgument &argument)
glwebtools::Error | write (const glwebtools::CustomAttributeList &argument)
glwebtools::Error | write (const glwebtools::JSONValue &argument)
glwebtools::Error | write (NameValuePair< const glwebtools::JSONObject > argument)
glwebtools::Error | write (IndexedValue< const glwebtools::JSONArray > argument)
glwebtools::Error | write (const glwebtools::JSONObject &argument)
glwebtools::Error | write (const glwebtools::JSONArray &argument)
template<typename ITERATOR >
glwebtools::Error | write (ITERATOR begin, ITERATOR end)

Detailed Description

Format data in Json.

Constructor & Destructor Documentation

template<typename GLWEBTOOLS_VALUE >
glwebtools::JsonWriter::JsonWriter ( GLWEBTOOLS_VALUE value ) [inline, explicit]

Constructor.

Parameters:
value data to be formatted in Json.

Member Function Documentation

template<typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::JsonWriter::append ( const GLWEBTOOLS_VALUE & value ) [inline]

Appends an element to the current Json array or object

Parameters:
value sub element to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
glwebtools::Error glwebtools::JsonWriter::exclude | ( | const char ** | begin,
 |  | const char ** | end,
 |  | const glwebtools::CustomAttributeList & | value
 | ) |  |

Transfer all items excluding those identified by keys from value

Parameters:
keys | list of keys identifying data not to be transfered.
value | data to be transfered.
Return values:
federation::E_SUCCESS if the method succeeded.
glwebtools::Error glwebtools::JsonWriter::exclude | ( | const char ** | begin,
 |  | const char ** | end,
 |  | const glwebtools::JSONObject & | value
 | ) |  |

Transfer all items excluding those identified by keys from value

Parameters:
keys | list of keys identifying data not to be transfered.
value | data to be transfered.
Return values:
federation::E_SUCCESS if the method succeeded.
glwebtools::Error glwebtools::JsonWriter::exclude | ( | size_t * | begin,
 |  | size_t * | end,
 |  | const glwebtools::JSONArray & | value
 | ) |  |

Transfer all items excluding those identified by keys from value

Parameters:
keys | list of keys identifying data not to be transfered.
value | data to be transfered.
Return values:
federation::E_SUCCESS if the method succeeded.
glwebtools::Error glwebtools::JsonWriter::include | ( | const char ** | begin,
 |  | const char ** | end,
 |  | const glwebtools::CustomAttributeList & | value
 | ) |  |

Transfer all items identified by keys from value

Parameters:
keys | list of keys identifying data to be transfered.
value | data to be transfered.
Return values:
federation::E_SUCCESS if the method succeeded.
glwebtools::Error glwebtools::JsonWriter::include | ( | const char ** | begin,
 |  | const char ** | end,
 |  | const glwebtools::JSONObject & | value
 | ) |  |

Transfer all items identified by keys from value

Parameters:
keys | list of keys identifying data to be transfered.
value | data to be transfered.
Return values:
federation::E_SUCCESS if the method succeeded.
glwebtools::Error glwebtools::JsonWriter::include | ( | size_t * | begin,
 |  | size_t * | end,
 |  | const glwebtools::JSONArray & | value
 | ) |  |

Transfer all items identified by keys from value

Parameters:
keys | list of keys identifying data to be transfered.
value | data to be transfered.
Return values:
federation::E_SUCCESS if the method succeeded.
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::JsonWriter::insert | ( | unsigned int | index,
 |  | const GLWEBTOOLS_VALUE & | value
 | ) |  | [inline]

Insert an element in the current Json array

Parameters:
index | index of sub element to be inserted.
value | sub element to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::JsonWriter::insert | ( | const std::string & | name,
 |  | const GLWEBTOOLS_VALUE & | value
 | ) |  | [inline]

Insert an element in the current Json object

Parameters:
name | name of sub element to be inserted.
value | sub element to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::JsonWriter::insert | ( | const char * | name,
 |  | const GLWEBTOOLS_VALUE & | value
 | ) |  | [inline]

Insert an element in the current Json object

Parameters:
name | name of sub element to be inserted.
value | sub element to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
bool glwebtools::JsonWriter::isArray ( ) const

Returns whether the embedded json is of type Array

Return values:
true | if the embedded json is of type Array
false | if the embedded json is not of type Array
bool glwebtools::JsonWriter::isBool ( ) const

Returns whether the embedded json is of type Bool

Return values:
true | if the embedded json is of type Bool
false | if the embedded json is not of type Bool
bool glwebtools::JsonWriter::isDouble ( ) const

Returns whether the embedded json is of type Double

Return values:
true | if the embedded json is of type Double
false | if the embedded json is not of type Double
bool glwebtools::JsonWriter::isInt ( ) const

Returns whether the embedded json is of type Int

Return values:
true | if the embedded json is of type Int
false | if the embedded json is not of type Int
bool glwebtools::JsonWriter::isObject ( ) const

Returns whether the embedded json is of type Object

Return values:
true | if the embedded json is of type Object
false | if the embedded json is not of type Object
bool glwebtools::JsonWriter::isString ( ) const

Returns whether the embedded json is of type String

Return values:
true | if the embedded json is of type String
false | if the embedded json is not of type String
bool glwebtools::JsonWriter::isUInt ( ) const

Returns whether the embedded json is of type UInt

Return values:
true | if the embedded json is of type UInt
false | if the embedded json is not of type UInt
bool glwebtools::JsonWriter::IsValid ( ) const

Returns whether the embedded json is valid or not

Return values:
true | if the value is valid
false | if the value is not valid
JsonWriter glwebtools::JsonWriter::operator[] ( unsigned int index )

Access an element in the current Json array

Parameters:
index index of sub element to be accessed.
Returns:
A JsonWriter of the sub element
JsonWriter glwebtools::JsonWriter::operator[] ( const std::string & name )

Access an element in the current Json object

Parameters:
name name of sub element to be accessed.
Returns:
A JsonWriter of the sub element
JsonWriter glwebtools::JsonWriter::operator[] ( const char * name )

Access an element in the current Json object

Parameters:
name name of sub element to be accessed.
Returns:
A JsonWriter of the sub element
std::string glwebtools::JsonWriter::ToPrettyString ( ) const

Returns the formatted Json string for debug ouput. Do not use in production code.

Returns:
the formatted Json string
void glwebtools::JsonWriter::ToPrettyString ( std::string & result ) const

Returns the formatted Json string for debug ouput. Do not use in production code.

Parameters:
[out] result the formatted Json string
std::string glwebtools::JsonWriter::ToString ( ) const

Returns the formatted Json string

Returns:
the formatted Json string
void glwebtools::JsonWriter::ToString ( std::string & result ) const

Returns the formatted Json string

Parameters:
[out] result the formatted Json string
glwebtools::Error glwebtools::JsonWriter::write ( int value )

Formats value as Json..

Parameters:
value data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
glwebtools::Error glwebtools::JsonWriter::write ( unsigned int value )

Formats value as Json..

Parameters:
value data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
glwebtools::Error glwebtools::JsonWriter::write ( double value )

Formats value as Json..

Parameters:
value data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
glwebtools::Error glwebtools::JsonWriter::write ( float value )

Formats value as Json..

Parameters:
value data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
glwebtools::Error glwebtools::JsonWriter::write ( bool value )

Formats value as Json..

Parameters:
value data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
glwebtools::Error glwebtools::JsonWriter::write ( const std::string & value )

Formats value as Json..

Parameters:
value data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
glwebtools::Error glwebtools::JsonWriter::write ( const char * value )

Formats value as Json..

Parameters:
value data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::JsonWriter::write ( const GLWEBTOOLS_VALUE & value ) [inline]

Formats value as Json..

Parameters:
value data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::JsonWriter::write ( NameValuePair< GLWEBTOOLS_VALUE > value ) [inline]

Formats value as Json..

Parameters:
value data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error glwebtools::JsonWriter::write ( NameValuePair< const glwebtools::OptionalArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > > value ) [inline]

Formats value as Json..

Parameters:
value data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error glwebtools::JsonWriter::write ( NameValuePair< const glwebtools::RequiredArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > > value ) [inline]

Formats value as Json..

Parameters:
value data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::JsonWriter::write ( IndexedValue< GLWEBTOOLS_VALUE > value ) [inline]

Formats value as Json..

Parameters:
value data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error glwebtools::JsonWriter::write ( IndexedValue< const glwebtools::OptionalArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > > value ) [inline]

Formats value as Json..

Parameters:
value data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error glwebtools::JsonWriter::write ( IndexedValue< const glwebtools::RequiredArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > > value ) [inline]

Formats value as Json..

Parameters:
value data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
template<typename GLWEBTOOLS_ITERATOR , typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::JsonWriter::write ( IncludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > value ) [inline]

Formats value as Json..

Parameters:
value data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
template<typename GLWEBTOOLS_ITERATOR , typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::JsonWriter::write ( ExcludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > value ) [inline]

Formats value as Json..

Parameters:
value data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error glwebtools::JsonWriter::write ( const glwebtools::OptionalArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > & value ) [inline]

Formats value as Json..

Parameters:
value data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
template<typename GLWEBTOOLS_VALUE , typename GLWEBTOOLS_VALIDATOR , typename GLWEBTOOLS_FORMATTER >
glwebtools::Error glwebtools::JsonWriter::write ( const glwebtools::RequiredArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > & value ) [inline]

Formats value as Json..

Parameters:
value data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
glwebtools::Error glwebtools::JsonWriter::write ( const glwebtools::CustomArgument & argument )

Formats value as Json..

Parameters:
argument data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
glwebtools::Error glwebtools::JsonWriter::write ( const glwebtools::CustomAttributeList & argument )

Formats value as Json..

Parameters:
argument data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
glwebtools::Error glwebtools::JsonWriter::write ( const glwebtools::JSONValue & argument )

Formats value as Json..

Parameters:
argument data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
glwebtools::Error glwebtools::JsonWriter::write ( NameValuePair< const glwebtools::JSONObject > argument )

Formats value as Json..

Parameters:
argument data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
glwebtools::Error glwebtools::JsonWriter::write ( IndexedValue< const glwebtools::JSONArray > argument )

Formats value as Json..

Parameters:
argument data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
glwebtools::Error glwebtools::JsonWriter::write ( const glwebtools::JSONObject & argument )

Formats value as Json..

Parameters:
argument data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
glwebtools::Error glwebtools::JsonWriter::write ( const glwebtools::JSONArray & argument )

Formats value as Json..

Parameters:
argument data to be formatted in Json.
Return values:
federation::E_SUCCESS if the method succeeded.
template<typename ITERATOR >
glwebtools::Error glwebtools::JsonWriter::write | ( | ITERATOR | begin,
 |  | ITERATOR | end
 | ) |  | [inline]

Formats value as Json..

Parameters:
begin | iterator on the first element to be formatted.
end | iterator past the last element to be formatted.
Return values:
federation::E_SUCCESS if the method succeeded.
The documentation for this class was generated from the following files:
  • glwebtools_jsonwriter.h
  • glwebtools_jsonwriter.cpp


GLWebTools: glwebtools::NameValuePair< GLWEBTOOLS_VALUE > Struct Template Reference

  • glwebtools
  • NameValuePair
glwebtools::NameValuePair< GLWEBTOOLS_VALUE > Struct Template Reference

Convenient wrapper to find value by name. More...

#include <glwebtools_jsonbase.h>

List of all members.

Detailed Description

template<typename GLWEBTOOLS_VALUE>
struct glwebtools::NameValuePair< GLWEBTOOLS_VALUE >

Convenient wrapper to find value by name.

The documentation for this struct was generated from the following file:
  • glwebtools_jsonbase.h


GLWebTools: glwebtools::Not< LEFT > Struct Template Reference

  • glwebtools
  • Not
glwebtools::Not< LEFT > Struct Template Reference

Returns the result of logical not on its argument. More...

#include <glwebtools_typetraits.h>

Inherits glwebtools::Internal::Not< LEFT >.

List of all members.

Detailed Description

template<typename LEFT>
struct glwebtools::Not< LEFT >

Returns the result of logical not on its argument.

The documentation for this struct was generated from the following file:
  • glwebtools_typetraits.h


GLWebTools: glwebtools::OpenSSL Class Reference

  • glwebtools
  • OpenSSL
Public Member Functions
glwebtools::OpenSSL Class Reference

Managed initialization of OpenSSL. More...

#include <glwebtools_openssl.h>

List of all members.

Public Member Functions

OpenSSL ()
Default constructor.
~OpenSSL ()
Default destructor.

Detailed Description

Managed initialization of OpenSSL.

This class sets and unsets the mutexes for OpenSSL. The class is internally ref-counted, so the last destroyed instance will destroy the mutexes. This class is not thread-safe so the caller (the application) must ensure that multiple instances are not called concurently. Since GlWebTools stores an instance of this class, GlWebTool must not be concurrently created or destroyed with another instance of this class.

The documentation for this class was generated from the following files:
  • glwebtools_openssl.h
  • glwebtools_openssl.cpp


GLWebTools: glwebtools::Or< LEFT, RIGHT > Struct Template Reference

  • glwebtools
  • Or
glwebtools::Or< LEFT, RIGHT > Struct Template Reference

Returns the result of logical or on its arguments. More...

#include <glwebtools_typetraits.h>

Inherits glwebtools::Internal::Or< LEFT, RIGHT >.

List of all members.

Detailed Description

template<typename LEFT, typename RIGHT>
struct glwebtools::Or< LEFT, RIGHT >

Returns the result of logical or on its arguments.

The documentation for this struct was generated from the following file:
  • glwebtools_typetraits.h


GLWebTools: glwebtools::SAllocator< GLWEBTOOLS_T, Hint > Class Template Reference

  • glwebtools
  • SAllocator
Public Member Functions
glwebtools::SAllocator< GLWEBTOOLS_T, Hint > Class Template Reference

Very simple allocator implementation, containers using it can be used across dll boundaries. More...

#include <glwebtools_memory.h>

List of all members.

Public Member Functions

GLWEBTOOLS_T * | allocate (size_t cnt, const void *hint=0)
Allocate memory for an array of objects.
void | construct (GLWEBTOOLS_T *ptr, const GLWEBTOOLS_T &e)
Construct an element.
void | deallocate (GLWEBTOOLS_T *ptr, size_type)
Deallocate memory for an array of objects.
void | destroy (GLWEBTOOLS_T *ptr)
Synonym for destruct (for STL compliance).

Detailed Description

template<typename GLWEBTOOLS_T, glwebtools::MemHint Hint = glwebtools::MH_ALIGN_ANY>
class glwebtools::SAllocator< GLWEBTOOLS_T, Hint >

Very simple allocator implementation, containers using it can be used across dll boundaries.

The documentation for this class was generated from the following file:
  • glwebtools_memory.h


GLWebTools: glwebtools::SecureDataFormatter< FORMATTER > Class Template Reference

  • glwebtools
  • SecureDataFormatter
Public Member Functions
glwebtools::SecureDataFormatter< FORMATTER > Class Template Reference

Functor used to format attributes of requests to string. More...

#include <glwebtools_securedata.h>

List of all members.

Public Member Functions

template<typename GLWEBTOOLS_T >
std::string | operator() (GLWEBTOOLS_T value) const
bool | operator== (const SecureDataFormatter< FORMATTER > &) const

Detailed Description

template<typename FORMATTER = AttributeFormatter>
class glwebtools::SecureDataFormatter< FORMATTER >

Functor used to format attributes of requests to string.

Formatter of SecureData.

Member Function Documentation

template<typename FORMATTER = AttributeFormatter>
template<typename GLWEBTOOLS_T >
std::string glwebtools::SecureDataFormatter< FORMATTER >::operator() ( GLWEBTOOLS_T value ) const [inline]

Formats value to string

Parameters:
value The value to format
Returns:
The formatted string
template<typename FORMATTER = AttributeFormatter>
bool glwebtools::SecureDataFormatter< FORMATTER >::operator== ( const SecureDataFormatter< FORMATTER > & ) const [inline]

Equality operator

The documentation for this class was generated from the following file:
  • glwebtools_securedata.h


GLWebTools: glwebtools::StringValidator Struct Reference

  • glwebtools
  • StringValidator
Public Member Functions
glwebtools::StringValidator Struct Reference

Functor used to validate attribute. More...

#include <glwebtools_attributevalidator.h>

Inherits glwebtools::BaseValidator< GLWEBTOOLS_T >.

List of all members.

Public Member Functions

bool operator() (const std::string &value) const

Detailed Description

Functor used to validate attribute.

Default String validator, always returns true unless the string is empty.

Member Function Documentation

bool glwebtools::StringValidator::operator() ( const std::string & value ) const [inline]

Validate the value

Parameters:
value The value to validate
Return values:
true | if value is valid
false | if value is not valid
The documentation for this struct was generated from the following file:
  • glwebtools_attributevalidator.h


GLWebTools: glwebtools::ThreadPool::CreationSettings Struct Reference

  • glwebtools
  • ThreadPool
  • CreationSettings
Public Member Functions | Public Attributes
glwebtools::ThreadPool::CreationSettings Struct Reference

ThreadPool creation settings structure. More...

#include <glwebtools_threadpool.h>

List of all members.

Public Member Functions

CreationSettings ()
Default Constructor - Value initialize according to default.
CreationSettings (unsigned int minThreadCount, unsigned int maxThreadCount, glwebtools::Thread::Priority threadPriority, unsigned int hysteresis_ms, unsigned int maxThreadStartTime_ms)

Public Attributes

unsigned int | m_hysteresis_ms
time (ms) before reducing the thread pool by one when there are idle threads.
unsigned int | m_maxThreadCount
Max Number of threads in the pool.
unsigned int | m_maxThreadStartTime_ms
time (ms) before removing a thread failing to start.
unsigned int | m_minThreadCount
Min Number of threads in the pool.
glwebtools::Thread::Priority | m_threadPriority
Threads priority.

Detailed Description

ThreadPool creation settings structure.

Constructor & Destructor Documentation

glwebtools::ThreadPool::CreationSettings::CreationSettings | ( | unsigned int | minThreadCount,
 |  | unsigned int | maxThreadCount,
 |  | glwebtools::Thread::Priority | threadPriority,
 |  | unsigned int | hysteresis_ms,
 |  | unsigned int | maxThreadStartTime_ms
 | ) |  |

Custom Constructor

Parameters:
minThreadCount | Min Number of threads in the pool.
maxThreadCount | Max Number of threads in the pool.
threadPriority | Threads priority.
hysteresis_ms | time (ms) before reducing the thread pool by one when there are idle threads.
The documentation for this struct was generated from the following files:
  • glwebtools_threadpool.h
  • glwebtools_threadpool.cpp


GLWebTools: glwebtools::TrueType Struct Reference

  • glwebtools
  • TrueType
glwebtools::TrueType Struct Reference

Boolean true in meta-expression. More...

#include <glwebtools_typetraits.h>

Inherited by glwebtools::Internal::Not< FalseType >, glwebtools::Internal::Or< LEFT, RIGHT >, glwebtools::IsArgumentOptional< OptionalArgument< GLWEBTOOLS_T, VALIDATOR, FORMATTER > >, glwebtools::IsArgumentRequired< RequiredArgument< GLWEBTOOLS_T, VALIDATOR, FORMATTER > >, glwebtools::IsArgumentWrapped< ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > >, glwebtools::IsArgumentWrapped< OptionalArgument< GLWEBTOOLS_T, VALIDATOR, FORMATTER > >, glwebtools::IsArgumentWrapped< RequiredArgument< GLWEBTOOLS_T, VALIDATOR, FORMATTER > >, glwebtools::IsList< std::list< GLWEBTOOLS_T, Allocator > >, glwebtools::IsList< std::vector< GLWEBTOOLS_T, Allocator > >, and glwebtools::Internal::Or< LEFT::type, RIGHT::type >.

List of all members.

Detailed Description

Boolean true in meta-expression.

The documentation for this struct was generated from the following file:
  • glwebtools_typetraits.h


GLWebTools: glwebtools::UrlConnection Class Reference

  • glwebtools
  • UrlConnection
Classes | Public Types | Public Member Functions | Friends
glwebtools::UrlConnection Class Reference

A handle class wrapping UrlConnection with automatic ref count management. More...

#include <glwebtools_urlhandle.h>

Inherits glwebtools::HandleBase< GLWEBTOOLS_T >.

List of all members.

Classes

struct | CreationSettings
UrlConnection creation settings structure. More...

Public Types

enum State {
S_INVALID, S_IDLE, S_WAITING_TO_RUN, S_RUNNING,
S_ERROR
}
Url Connection state. More...

Public Member Functions

UrlConnection ()
Default constructor for empty handle.
UrlConnection (const UrlConnection &rhs)
Copy constructor.
virtual | ~UrlConnection ()
Default destructor.
glwebtools::Error | CancelRequest ()
Cancel then current Url Request running.
glwebtools::Error | GetCreationSettings (UrlConnection::CreationSettings &cs) const
Retrieves creation settings.
size_t | GetDownloadedBytes () const
Get the current downloaded bytes count of the current request.
glwebtools::Error | GetLastError () const
Return last error from executed request.
glwebtools::Error | GetOutputDebugString (std::string &outputDebugString) const
Retrieves the last output debug string.
UrlConnection::State | GetState () const
Get the current state of the connection.
UrlResponse | GetUrlResponse () const
Get the last Url Response.
bool | HasDataPacket () const
Returns whether there is an available data packet to pop from the queue.
bool | HasServerSideEvent () const
Returns whether there is an available server side event to pop from the queue.
bool | IsError () const
Check is the request is in an error state.
bool | IsHandleValid () const
Check if current handle contain a valid object.
bool | IsReadyToRun () const
Check if the connection is ready to run a request.
bool | IsRunning () const
Check if the connection is running.
UrlConnection & | operator= (const UrlConnection &rhs)
Assignation contructor.
glwebtools::Error | PopDataPacket (MutableData &outData)
Pop a data packet from the queue.
glwebtools::Error | PopServerSideEvent (ServerSideEvent &serverSideEvent)
Pop a server side event from the queue.
glwebtools::Error | Release ()
Release the reference to the internal UrlConnection.
glwebtools::Error | StartRequest (UrlRequest &anUrlRequest)
Start running the current Url Request.
bool | SupportDataPacketQueue () const
Returns whether this connection is configured to support data packet.
bool | SupportServerSideEvent () const
Returns whether this connection is configured to support Server Side Events.

Friends

class | glwebtools::GlWebToolsCore

Detailed Description

A handle class wrapping UrlConnection with automatic ref count management.

Member Enumeration Documentation

enum glwebtools::UrlConnection::State

Url Connection state.

Enumerator:
S_INVALID

Not a valid connection (emtpy handle)

S_IDLE

State where the connection is ready to run a new request.

S_WAITING_TO_RUN

Initialized, state between the moment the request is added and the moment it's running.

S_RUNNING

Connection is running.

S_ERROR

Error.

Member Function Documentation

glwebtools::Error glwebtools::UrlConnection::CancelRequest ( )

Cancel then current Url Request running.

This call is asynchronous, the request will be canceled as soon it's possible.

Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_DATA | if internal data prevent the cancelation
glwebtools::E_INVALID_OPERATION | if connection is not in a state allowing the operation
glwebtools::Error glwebtools::UrlConnection::GetCreationSettings ( UrlConnection::CreationSettings & cs ) const

Retrieves creation settings.

Parameters:
[out] cs will be filled with creation settings
Return values:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
size_t glwebtools::UrlConnection::GetDownloadedBytes ( ) const

Get the current downloaded bytes count of the current request.

This value represent the current value and is updated during the reponse download. Precision of this command depends on OS.

Returns:
Bytes count of the data return by the current request
UrlConnection::State glwebtools::UrlConnection::GetState ( ) const

Get the current state of the connection.

Returns:
Current connection state
UrlResponse glwebtools::UrlConnection::GetUrlResponse ( ) const

Get the last Url Response.

An url response is only available if a request has ended and no new request was attached

Returns:
Last Url Response if available
bool glwebtools::UrlConnection::HasDataPacket ( ) const

Returns whether there is an available data packet to pop from the queue.

Precondition:
SupportServerSideEvent() == true
bool glwebtools::UrlConnection::HasServerSideEvent ( ) const

Returns whether there is an available server side event to pop from the queue.

Precondition:
SupportServerSideEvent() == true
bool glwebtools::UrlConnection::IsError ( ) const

Check is the request is in an error state.

*HELPER* In this state, the connection is either invalid or in an error state. The exact error depends on the implementation and will have been log at MINOR_ERROR level or higher

Returns:
True if the connection is in an error state.
bool glwebtools::UrlConnection::IsHandleValid ( ) const

Check if current handle contain a valid object.

Returns:
True if handle contain a valid connection
bool glwebtools::UrlConnection::IsReadyToRun ( ) const

Check if the connection is ready to run a request.

*HELPER* If the connection is in that state, it means that the connection is ready to start running a new request. This state is the initial state and the state after a successful request fisnished.

Returns:
True if the connection is ready to run a request
bool glwebtools::UrlConnection::IsRunning ( ) const

Check if the connection is running.

*HELPER* If the connection is in that state, it is currently running. In this state no modification is allowed other than canceling the connection.

Returns:
True if the connection currently running
glwebtools::Error glwebtools::UrlConnection::PopDataPacket ( MutableData & outData )

Pop a data packet from the queue.

Precondition:
SupportDataPacketQueue() == true
HasDataPacket() == true
Returns:
E_SUCCESS if operation successful
glwebtools::Error glwebtools::UrlConnection::PopServerSideEvent ( ServerSideEvent & serverSideEvent )

Pop a server side event from the queue.

Precondition:
SupportServerSideEvent() == true
HasServerSideEvent() == true
Returns:
E_SUCCESS if operation successful
glwebtools::Error glwebtools::UrlConnection::Release ( )

Release the reference to the internal UrlConnection.

Once released, the handle is invalid and can be reuse to store a new connection

Returns:
glwebtools::E_SUCCESS | if the internal connection was released
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::Error glwebtools::UrlConnection::StartRequest ( UrlRequest & anUrlRequest )

Start running the current Url Request.

The connection cannot be modified while running a request. The request is run asynchronously. If the request fails (either on a connection error or on a response error code), the request IsError method will return true.

Parameters:
anUrlRequest Request to attach
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_DATA | if internal initialization failed
glwebtools::E_INVALID_OPERATION | if connection is not in a state allowing the operation
glwebtools::E_MEMORY_ERROR | if internal object failed to allocate
The documentation for this class was generated from the following files:
  • glwebtools_urlhandle.h
  • glwebtools_urlhandle.cpp


GLWebTools: glwebtools::UrlConnection::CreationSettings Struct Reference

  • glwebtools
  • UrlConnection
  • CreationSettings
Public Member Functions | Public Attributes
glwebtools::UrlConnection::CreationSettings Struct Reference

UrlConnection creation settings structure. More...

#include <glwebtools_urlhandle.h>

List of all members.

Public Member Functions

CreationSettings ()
Default Constructor - Value initialize according to default.
CreationSettings (unsigned int maxConnections, bool failOnReponse400andHigher, bool follow302, unsigned int connectTimeout, glwebtools::Thread::Priority threadPriority, bool enableAcceptEncoding, const char *acceptEncoding)
Custom Constructor.
CreationSettings (unsigned int maxConnections, bool failOnReponse400andHigher, bool follow302, unsigned int connectTimeout, const std::string &taskGroupId, glwebtools::Thread::Priority threadPriority, bool enableAcceptEncoding, const char *acceptEncoding)
Custom Constructor.

Public Attributes

std::string | m_acceptEncoding
Definition of allowed encoding.
unsigned int | m_connectTimeout
Time for connecting to remote host (in second)
bool | m_enableAcceptEncoding
Allow data encoding (compression)
bool | m_follow302
Process redirection automatically - Maximum redirection dependent on implementation.
unsigned int | m_maxConnections
Maximum connection the object can maintain at the same time - excess connection are closed.
std::string | m_peerCAFile
CA file path and file name that is for verify SSL peer.
bool | m_supportServerSideEvent
Suport for listening of server side events.
std::string | m_taskGroupId
id of the task group for the connection
unsigned int | m_taskStartTimeout
Time for the task to start before cancelling the connection.
glwebtools::Thread::Priority | m_threadPriority
Work thread priority. Deprecated. Use the thread priority of the task group instead.
unsigned int | m_timeout
The maximum number of seconds to allow the request to execute.
bool | m_useDataPacketQueue
Use the data packet queue to get data as it is received instead of when the transfer finish.
std::string | m_userAgent
User agent for the connection.

Detailed Description

UrlConnection creation settings structure.

The documentation for this struct was generated from the following files:
  • glwebtools_urlhandle.h
  • glwebtools_urlconnection_curl.cpp
  • glwebtools_urlconnection_xmlhttprequest2.cpp


GLWebTools: glwebtools::UrlConnectionCore Class Reference

  • glwebtools
  • UrlConnectionCore
Public Member Functions | Static Public Member Functions | Friends
glwebtools::UrlConnectionCore Class Reference

Class for Url Connection. More...

#include <glwebtools_urlconnection.h>

Inherits glwebtools::Managed.

List of all members.

Public Member Functions

virtual | ~UrlConnectionCore ()
Destructor.

Static Public Member Functions

static void | RunRequestStatic (void *caller, void *param)
Work launcher.

Friends

class | glwebtools::GlWebToolsCore
class | glwebtools::UrlConnection
class | glwebtools::UrlResponse

Detailed Description

Class for Url Connection.

Member Function Documentation

void glwebtools::UrlConnectionCore::RunRequestStatic | ( | void * | caller,
 |  | void * | param
 | ) |  | [static]

Work launcher.

Parameters:
caller | Connection
param | Unused
The documentation for this class was generated from the following files:
  • glwebtools_urlconnection.h
  • glwebtools_urlconnection_curl.cpp
  • glwebtools_urlconnection_xmlhttprequest2.cpp


GLWebTools: glwebtools::UrlRequest Class Reference

  • glwebtools
  • UrlRequest
Public Types | Public Member Functions | Friends
glwebtools::UrlRequest Class Reference

A handle class wrapping UrlRequest with automatic ref count management. More...

#include <glwebtools_urlhandle.h>

Inherits glwebtools::HandleBase< GLWEBTOOLS_T >.

List of all members.

Public Types

enum | Method { , M_GET, M_POST, M_HEAD, M_DELETE }
Request Method. More...
enum | Protocol
Request Protocol.
enum State {
S_INVALID, S_INITIAL, S_IDLE, S_RUNNING,
S_ERROR
}
Url request state. More...

Public Member Functions

UrlRequest ()
Default constructor for empty handle.
UrlRequest (const UrlRequest &rhs)
Copy constructor.
virtual | ~UrlRequest ()
Default destructor.
glwebtools::Error | AddData (const std::map< std::string, std::string > &dataMap)
Add data to request.
glwebtools::Error | AddData (const char *key, const char *value)
Add data to request.
glwebtools::Error | AddData (const char *key, const std::string &value)
Add data to request.
glwebtools::Error | AddData (const std::string &key, const std::string &value)
Add data to request.
glwebtools::Error | AddHeaders (const char *headerField, const char *value)
Add a field to the request header.
glwebtools::Error | AddHeaders (const char *headerField, const std::string &value)
Add a field to the request header.
glwebtools::Error | AddHeaders (const std::string &headerField, const std::string &value)
Add a field to the request header.
glwebtools::Error | ClearData ()
Clear current request data.
glwebtools::Error | ClearHeaders ()
Clear current request headers.
glwebtools::Error | GetCreationSettings (UrlRequest::CreationSettings &cs) const
Retrieves creation settings.
UrlRequest::Method | GetMethod () const
Get method currently set for the request.
UrlRequest::State | GetState () const
Get request current state.
bool | IsError () const
Check is the request is in an error state.
bool | IsHandleValid () const
Check if current handle contain a valid object.
bool | IsInitialState () const
Check if the current state of the request is UrlRequest::S_INITIAL.
bool | IsReadyToRun () const
Check if the request is ready to run.
bool | IsRunning () const
Check if the request is running.
UrlRequest & | operator= (const UrlRequest &rhs)
Assignation contructor.
glwebtools::Error | Release ()
Release the reference to the internal UrlRequest.
glwebtools::Error | Reset ()
Reset the request.
glwebtools::Error | SetData (const std::string &data)
Set request data.
glwebtools::Error | SetData (const void *data, size_t dataSize)
Set request data.
glwebtools::Error | SetData (const std::map< std::string, std::string > &dataMap)
Set data to request.
glwebtools::Error | SetHeaders (const std::map< std::string, std::string > &headerMap)
Set all field of the request header.
glwebtools::Error | SetHTTPSUrl (const char *authority, const char *path=0, unsigned int port=0)
Set the url for the request using HTTPS protocol.
glwebtools::Error | SetHTTPSUrl (const std::string &authority, const std::string &path, unsigned int port=0)
Set the url for the request using HTTPS protocol.
glwebtools::Error | SetHTTPUrl (const char *authority, const char *path=0, unsigned int port=0)
Set the url for the request using HTTP protocol.
glwebtools::Error | SetHTTPUrl (const std::string &authority, const std::string &path, unsigned int port=0)
Set the url for the request using HTTP protocol.
glwebtools::Error | SetMethod (UrlRequest::Method method)
Set the method of the request.
glwebtools::Error | SetUrl (const char *url, unsigned int port=0)
Set the url for the request.
glwebtools::Error | SetUrl (const std::string &url, unsigned int port=0)
Set the url for the request.
glwebtools::Error | SetUrl (UrlRequest::Protocol protocol, const char *authority, const char *path, unsigned int port=0)
Set the url for the request.
glwebtools::Error | SetUrl (UrlRequest::Protocol protocol, const std::string &authority, const std::string &path, unsigned int port=0)
Set the url for the request.

Friends

class | glwebtools::GlWebToolsCore
class | glwebtools::UrlConnection

Detailed Description

A handle class wrapping UrlRequest with automatic ref count management.

Member Enumeration Documentation

enum glwebtools::UrlRequest::Method

Request Method.

Enumerator:
M_GET

Invalid method (empty handle)

GET method

M_POST

POST method.

M_HEAD

HEAD method.

M_DELETE

DELETE method.

enum glwebtools::UrlRequest::State

Url request state.

Enumerator:
S_INVALID

Not a valid request (emtpy handle)

S_INITIAL

Unitialized request.

S_IDLE

Initialized request ready to run.

S_RUNNING

Currently running.

S_ERROR

Request in error.

Member Function Documentation

glwebtools::Error glwebtools::UrlRequest::AddData ( const std::map< std::string, std::string > & dataMap )

Add data to request.

Data need to be properly encoded before settings to the request

Parameters:
dataMap Map of paired value to set as data
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::AddData | ( | const char * | key,
 |  | const char * | value
 | ) |  |

Add data to request.

Data need to be properly encoded before settings to the request

Parameters:
key | Key identifier
value | Value of the data
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_PARAMETER | if one of the parameter passed is not valid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::AddData | ( | const char * | key,
 |  | const std::string & | value
 | ) |  |

Add data to request.

Data need to be properly encoded before settings to the request

Parameters:
key | Key identifier
value | Value of the data
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_PARAMETER | if one of the parameter passed is not valid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::AddData | ( | const std::string & | key,
 |  | const std::string & | value
 | ) |  |

Add data to request.

Data need to be properly encoded before settings to the request

Parameters:
key | Key identifier
value | Value of the data
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_PARAMETER | if one of the parameter passed is not valid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::AddHeaders | ( | const char * | headerField,
 |  | const char * | value
 | ) |  |

Add a field to the request header.

Parameters:
headerField | Header Field identifier
value | Value to set for the field
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_PARAMETER | if one of the parameter passed is not valid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::AddHeaders | ( | const char * | headerField,
 |  | const std::string & | value
 | ) |  |

Add a field to the request header.

Parameters:
headerField | Header Field identifier
value | Value to set for the field
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_PARAMETER | if one of the parameter passed is not valid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::AddHeaders | ( | const std::string & | headerField,
 |  | const std::string & | value
 | ) |  |

Add a field to the request header.

Parameters:
headerField | Header Field identifier
value | Value to set for the field
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_PARAMETER | if one of the parameter passed is not valid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::ClearData ( )

Clear current request data.

Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::ClearHeaders ( )

Clear current request headers.

Return values:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::GetCreationSettings ( UrlRequest::CreationSettings & cs ) const

Retrieves creation settings.

Parameters:
[out] cs will be filled with creation settings
Return values:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
UrlRequest::Method glwebtools::UrlRequest::GetMethod ( ) const

Get method currently set for the request.

Returns:
Current method
UrlRequest::State glwebtools::UrlRequest::GetState ( ) const

Get request current state.

Returns:
Current state
bool glwebtools::UrlRequest::IsError ( ) const

Check is the request is in an error state.

*HELPER* In this state, the request is either invalid or in an error state. The exact error depends on the implementation and will have been log at MINOR_ERROR level or higher

Returns:
True if the request is in an error state.
bool glwebtools::UrlRequest::IsHandleValid ( ) const

Check if current handle contain a valid object.

Returns:
True if handle contain a valid request
bool glwebtools::UrlRequest::IsInitialState ( ) const

Check if the current state of the request is UrlRequest::S_INITIAL.

*HELPER* If the request is in that state, it means in a state where it doesn't have the minimum data set to run (for exemple missing an URL)

Returns:
True if the request is in state UrlRequest::S_INITIAL
bool glwebtools::UrlRequest::IsReadyToRun ( ) const

Check if the request is ready to run.

*HELPER* If the request is in that state, it has enough data to run. However, the request may still be imcomplete (for exemple the url is set, but the payload is not).

Returns:
True if the request has at least the minimum data require is set
bool glwebtools::UrlRequest::IsRunning ( ) const

Check if the request is running.

*HELPER* If the request is in that state, it is currently running. In this state no modification is allowed.

Returns:
True if the request currently running
glwebtools::Error glwebtools::UrlRequest::Release ( )

Release the reference to the internal UrlRequest.

Once released, the handle is invalid and can be reuse to store a new request

Returns:
glwebtools::E_SUCCESS | if the internal request was released
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::Error glwebtools::UrlRequest::Reset ( )

Reset the request.

Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::SetData ( const std::string & data )

Set request data.

Data need to be properly encoded before settings to the request

Parameters:
data String to use as the data
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::SetData | ( | const void * | data,
 |  | size_t | dataSize
 | ) |  |

Set request data.

Data need to be properly encoded before settings to the request

Parameters:
data | Pointer to the data to use
dataSize | Size of the data
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_PARAMETER | if one of the parameter passed is not valid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::SetData ( const std::map< std::string, std::string > & dataMap )

Set data to request.

Data need to be properly encoded before settings to the request

Parameters:
dataMap Map of paired value to set as data
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::SetHeaders ( const std::map< std::string, std::string > & headerMap )

Set all field of the request header.

Parameters:
headerMap A map of headers to add to the request
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::SetHTTPSUrl | ( | const char * | authority,
 |  | const char * | path = 0,
 |  | unsigned int | port = 0
 | ) |  |

Set the url for the request using HTTPS protocol.

See SetUrl for more details.

Parameters:
authority | Host with optionnal user info and port (authority = [ userinfo "@" ] host [ ":" port ])
path | Remote path for the request
port | Port to set for the request, optionnal if using default port or if port already in url
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_PARAMETER | if one of the parameter passed is not valid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::SetHTTPSUrl | ( | const std::string & | authority,
 |  | const std::string & | path,
 |  | unsigned int | port = 0
 | ) |  |

Set the url for the request using HTTPS protocol.

See SetUrl for more details.

Parameters:
authority | Host with optionnal user info and port (authority = [ userinfo "@" ] host [ ":" port ])
path | Remote path for the request
port | Port to set for the request, optionnal if using default port or if port already in url
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_PARAMETER | if one of the parameter passed is not valid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::SetHTTPUrl | ( | const char * | authority,
 |  | const char * | path = 0,
 |  | unsigned int | port = 0
 | ) |  |

Set the url for the request using HTTP protocol.

See SetUrl for more details.

Parameters:
authority | Host with optionnal user info and port (authority = [ userinfo "@" ] host [ ":" port ])
path | Remote path for the request
port | Port to set for the request, optionnal if using default port or if port already in url
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_PARAMETER | if one of the parameter passed is not valid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::SetHTTPUrl | ( | const std::string & | authority,
 |  | const std::string & | path,
 |  | unsigned int | port = 0
 | ) |  |

Set the url for the request using HTTP protocol.

See SetUrl for more details.

Parameters:
authority | Host with optionnal user info and port (authority = [ userinfo "@" ] host [ ":" port ])
path | Remote path for the request
port | Port to set for the request, optionnal if using default port or if port already in url
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_PARAMETER | if one of the parameter passed is not valid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::SetMethod ( UrlRequest::Method method )

Set the method of the request.

Parameters:
method Method to set for the request
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::SetUrl | ( | const char * | url,
 |  | unsigned int | port = 0
 | ) |  |

Set the url for the request.

Parameters:
url | Url to set for the request
port | Port to set for the request, optionnal if using default port or if port already in url
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_PARAMETER | if one of the parameter passed is not valid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::SetUrl | ( | const std::string & | url,
 |  | unsigned int | port = 0
 | ) |  |

Set the url for the request.

Parameters:
url | Url to set for the request
port | Port to set for the request, optionnal if using default port or if port already in url
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_PARAMETER | if one of the parameter passed is not valid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::SetUrl | ( | UrlRequest::Protocol | protocol,
 |  | const char * | authority,
 |  | const char * | path,
 |  | unsigned int | port = 0
 | ) |  |

Set the url for the request.

Using this method the url will be formed as follow :

url := protocol "://" authority [ ":" port ] "/" path
protocol := "http" | "https"

For exemple :

url := "http" "://" "valpha.gameloft.org" ":20000" "/" "locate"

Authority only require the host address, port and userinfo are optional ("valpha.gameloft.org" or "myuserid:myuserpass@valpha.gameloft.com:20000" are both valid nomenclature)

Parameters:
protocol | Protocol to use for the request
authority | Host with optionnal user info and port (authority = [ userinfo "@" ] host [ ":" port ])
path | Remote path for the request
port | Port to set for the request, optionnal if using default port or if port already in url
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_PARAMETER | if one of the parameter passed is not valid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
glwebtools::Error glwebtools::UrlRequest::SetUrl | ( | UrlRequest::Protocol | protocol,
 |  | const std::string & | authority,
 |  | const std::string & | path,
 |  | unsigned int | port = 0
 | ) |  |

Set the url for the request.

Using this method the url will be formed as follow :

url := protocol "://" authority [ ":" port ] "/" path
protocol := "http" | "https"

For exemple :

url := "http" "://" "valpha.gameloft.org" ":20000" "/" "locate"

Authority only require the host address, port and userinfo are optional ("valpha.gameloft.org" or "myuserid:myuserpass@valpha.gameloft.com:20000" are both valid nomenclature)

Parameters:
protocol | Protocol to use for the request
authority | Host with optionnal user info and port (authority = [ userinfo "@" ] host [ ":" port ])
path | Remote path for the request
port | Port to set for the request, optionnal if using default port or if port already in url
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_PARAMETER | if one of the parameter passed is not valid
glwebtools::E_OBJECT_BUSY | if the request is currently running and doesn't allow the operation
The documentation for this class was generated from the following files:
  • glwebtools_urlhandle.h
  • glwebtools_urlhandle.cpp


GLWebTools: glwebtools::UrlRequestCore Class Reference

  • glwebtools
  • UrlRequestCore
Friends
glwebtools::UrlRequestCore Class Reference

Class to perform an url request. More...

#include <glwebtools_urlrequest.h>

Inherits glwebtools::Managed.

List of all members.

Friends

class | glwebtools::GlWebToolsCore
class | glwebtools::UrlConnectionCore
class | glwebtools::UrlRequest

Detailed Description

Class to perform an url request.

The documentation for this class was generated from the following files:
  • glwebtools_urlrequest.h
  • glwebtools_urlrequest_curl.cpp
  • glwebtools_urlrequest_xmlhttprequest2.cpp


GLWebTools: glwebtools::UrlResponse Class Reference

  • glwebtools
  • UrlResponse
Public Member Functions | Friends
glwebtools::UrlResponse Class Reference

A handle class wrapping UrlResponse with automatic ref count management. More...

#include <glwebtools_urlhandle.h>

Inherits glwebtools::HandleBase< GLWEBTOOLS_T >.

List of all members.

Public Member Functions

UrlResponse ()
Default constructor for empty handle.
UrlResponse (const UrlResponse &rhs)
Copy constructor.
virtual | ~UrlResponse ()
Default destructor.
glwebtools::Error | GetData (const void *&dataPtr, size_t &dataSize) const
Get data in the response.
glwebtools::Error | GetDataAsString (std::string &outString) const
Get data as string.
const char * | GetHeaderField (const char *fieldId) const
Get the value of a header from the response.
long | GetResponseCode () const
Get http response code.
bool | IsHandleValid () const
Check if current handle contain a valid object.
bool | IsHTTPError () const
Check if the response is an HTTP error.
bool | IsResponseReady () const
Check if current handle contain a valid object.
UrlResponse & | operator= (const UrlResponse &rhs)
Assignation contructor.
glwebtools::Error | Release ()
Release the reference to the internal UrlResponse.

Friends

class | glwebtools::GlWebToolsCore
class | glwebtools::UrlConnection

Detailed Description

A handle class wrapping UrlResponse with automatic ref count management.

Member Function Documentation

glwebtools::Error glwebtools::UrlResponse::GetData | ( | const void *& | dataPtr,
 |  | size_t & | dataSize
 | ) |  | const

Get data in the response.

Note : Some request, like head request, may succeed without data available

Parameters:
dataPtr | Reference to local pointer to copy the data pointer to
dataSize | Reference to the variable where the size of the data will be written
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_DATA | if the response doesn't have internal data
glwebtools::E_MEMORY_ERROR | if the response doesn't have data container
glwebtools::Error glwebtools::UrlResponse::GetDataAsString ( std::string & outString ) const

Get data as string.

If the data in the response is not a null terminated string data may be incomplete when using this method

Parameters:
outString String to append data to
Returns:
glwebtools::E_SUCCESS | if the operation was successful
glwebtools::E_INVALID_HANDLE | if the handle is invalid
glwebtools::E_INVALID_DATA | if the response doesn't have internal data
glwebtools::E_MEMORY_ERROR | if the response doesn't have data container
const char * glwebtools::UrlResponse::GetHeaderField ( const char * fieldId ) const

Get the value of a header from the response.

Parameters:
fieldId String of the header field identifier to get
Returns:
String to the value of the header if it exist
long glwebtools::UrlResponse::GetResponseCode ( ) const

Get http response code.

Returns:
Http response code
bool glwebtools::UrlResponse::IsHandleValid ( ) const

Check if current handle contain a valid object.

Returns:
True if handle contain a valid connection
bool glwebtools::UrlResponse::IsHTTPError ( ) const

Check if the response is an HTTP error.

*HELPER* Verify if the response code is an HTTP Error, only valid if request was HTTP/HTTPS

Returns:
True if the response represent an error
bool glwebtools::UrlResponse::IsResponseReady ( ) const

Check if current handle contain a valid object.

*HELPER*Before getting data from a response, the response needs to be ready. Response with a response code higher than 0 are always ready.

Returns:
True if handle contain a valid response
glwebtools::Error glwebtools::UrlResponse::Release ( )

Release the reference to the internal UrlResponse.

Once released, the handle is invalid and can be reuse to store a new response

Returns:
glwebtools::E_SUCCESS | if the internal response was released
glwebtools::E_INVALID_HANDLE | if the handle is invalid
The documentation for this class was generated from the following files:
  • glwebtools_urlhandle.h
  • glwebtools_urlhandle.cpp


GLWebTools: glwebtools::UrlResponseCore Class Reference

  • glwebtools
  • UrlResponseCore
Public Member Functions | Friends
glwebtools::UrlResponseCore Class Reference

Class containing the Response from an Url request. More...

#include <glwebtools_urlresponse.h>

List of all members.

Public Member Functions

glwebtools::Error | GetData (const void *&dataPtr, size_t &dataSize) const
Get data if present.
glwebtools::Error | GetDataAsString (glwebtools::String &outString) const
Get data as string.
const char * | GetHeaderField (const char *fieldId) const
Get the value of a header field of the response.
long | GetResponseCode () const
Get the response code from a request.

Friends

class | glwebtools::UrlConnectionCore

Detailed Description

Class containing the Response from an Url request.

Member Function Documentation

glwebtools::Error glwebtools::UrlResponseCore::GetData | ( | const void *& | dataPtr,
 |  | size_t & | dataSize
 | ) |  | const

Get data if present.

Parameters:
dataPtr | [out] If data is available, a const pointer to the internal data is written in that variable
dataSize | [out] If data is available, the size of the data is written in the variable
Returns:
E_SUCCESS if operation is successful
glwebtools::Error glwebtools::UrlResponseCore::GetDataAsString ( glwebtools::String & outString ) const

Get data as string.

If the data in the response is not a null terminated string data may be incomplete when using this method

Parameters:
outString String to append data to
Returns:
E_SUCCESS if operation is successful
const char * glwebtools::UrlResponseCore::GetHeaderField ( const char * fieldId ) const

Get the value of a header field of the response.

Parameters:
fieldId The identifier of the field requested (non case-sensitive)
Returns:
A const string pointer to the value if it exist, 0 otherwise
long glwebtools::UrlResponseCore::GetResponseCode ( ) const

Get the response code from a request.

Returns:
The HTTP response code of the request or 0 if the connection has not running, is running or did not complete
The documentation for this class was generated from the following files:
  • glwebtools_urlresponse.h
  • glwebtools_urlresponse.cpp


GLWebTools: Class Index

Class Index
A | C | E | F | G | H | I | J | N | O | S | T | U
A
F
IndexedValue (glwebtools) Not (glwebtools)
U
IsArgumentOptional (glwebtools)
O
ArgumentWrapper (glwebtools) FalseType (glwebtools) IsArgumentRequired (glwebtools) UrlConnection (glwebtools)
AttributeFormatter (glwebtools) FloatFormatter (glwebtools) IsArgumentWrapped (glwebtools) OpenSSL (glwebtools) UrlConnectionCore (glwebtools)
AttributeValidator (glwebtools)
G
IsList (glwebtools) Or (glwebtools) UrlRequest (glwebtools)
C
IsRange (glwebtools)
S
UrlRequestCore (glwebtools)
GlWebTools (glwebtools) JsonReader::Iterator (glwebtools) UrlResponse (glwebtools)
Codec (glwebtools) GlWebToolsCore (glwebtools)
J
SAllocator (glwebtools) UrlResponseCore (glwebtools)
UrlConnection::CreationSettings (glwebtools)
H
SecureDataFormatter (glwebtools)
ThreadPool::CreationSettings (glwebtools) JsonReader (glwebtools) StringValidator (glwebtools)
GlWebTools::CreationSettings (glwebtools) HandleManager (glwebtools) JsonWriter (glwebtools)
T
Curl (glwebtools)
I
N
E
TrueType (glwebtools)
IncludedItems (glwebtools) NameValuePair (glwebtools)
ExcludedItems (glwebtools)
A | C | E | F | G | H | I | J | N | O | S | T | U


GLWebTools: Class Hierarchy

Class Hierarchy
This inheritance list is sorted roughly, but not completely, alphabetically:
  • glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
  • glwebtools::AttributeFormatter
  • glwebtools::AttributeValidator
  • glwebtools::Codec
  • glwebtools::Curl
  • glwebtools::ExcludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE >
  • glwebtools::FalseType
    • glwebtools::IsArgumentOptional< GLWEBTOOLS_T >
    • glwebtools::IsArgumentRequired< GLWEBTOOLS_T >
    • glwebtools::IsArgumentWrapped< GLWEBTOOLS_T >
    • glwebtools::IsList< GLWEBTOOLS_T >
    • glwebtools::IsRange< GLWEBTOOLS_T >
  • glwebtools::FloatFormatter< PRECISION >
  • glwebtools::GlWebTools
  • glwebtools::GlWebTools::CreationSettings
  • glwebtools::GlWebToolsCore
  • glwebtools::HandleManager
  • glwebtools::IncludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE >
  • glwebtools::IndexedValue< GLWEBTOOLS_VALUE >
  • glwebtools::JsonReader
  • glwebtools::JsonReader::Iterator
  • glwebtools::JsonWriter
  • glwebtools::NameValuePair< GLWEBTOOLS_VALUE >
  • glwebtools::Not< LEFT >
  • glwebtools::OpenSSL
  • glwebtools::Or< LEFT, RIGHT >
  • glwebtools::SAllocator< GLWEBTOOLS_T, Hint >
  • glwebtools::SecureDataFormatter< FORMATTER >
  • glwebtools::StringValidator
  • glwebtools::ThreadPool::CreationSettings
  • glwebtools::TrueType
  • glwebtools::UrlConnection
  • glwebtools::UrlConnection::CreationSettings
  • glwebtools::UrlConnectionCore
  • glwebtools::UrlRequest
  • glwebtools::UrlRequestCore
  • glwebtools::UrlResponse
  • glwebtools::UrlResponseCore


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- a -

  • AddData() : glwebtools::UrlRequest
  • AddHeaders() : glwebtools::UrlRequest
  • AddTaskGroup()
: glwebtools::GlWebTools
, glwebtools::GlWebToolsCore
, glwebtools::GlWebTools
, glwebtools::GlWebToolsCore
  • allocate() : glwebtools::SAllocator< GLWEBTOOLS_T, Hint >
  • append() : glwebtools::JsonWriter
  • ArgumentWrapper() : glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >


GLWebTools: Namespace List

  • Namespace List
  • Namespace Members
Namespace List
Here is a list of all documented namespaces with brief descriptions:
glwebtools Glwebtools namespace


GLWebTools: glwebtools Namespace Reference

  • Namespace List
  • Namespace Members
Classes | Typedefs | Enumerations | Functions
glwebtools Namespace Reference

glwebtools namespace More...

Classes

struct | ArgumentWrapper
Wrap a value with a validator (for input) and a formatter (for output) More...
class | AttributeFormatter
Functor used to format attributes of requests to string. More...
struct | AttributeValidator
Functor used to validate attribute. More...
class | Codec
Class with common data codec. More...
class | Curl
Managed initialization of Curl. More...
struct | ExcludedItems
Convenient wrapper to exclude multiple values. More...
struct | FalseType
Boolean false in meta-expression. More...
class | FloatFormatter
Functor used to format attributes of requests to string. More...
class | GlWebTools
GlWebTools main class. More...
class | GlWebToolsCore
GlWebTools core class. More...
class | HandleManager
Class that manage the handle. More...
struct | IncludedItems
Convenient wrapper to include multiple values. More...
struct | IndexedValue
Convenient wrapper to find value by index. More...
struct | IsArgumentOptional
Returns TrueType if GLWEBTOOLS_T is an optional argument, FalseType otherwise. More...
struct | IsArgumentRequired
Returns TrueType if GLWEBTOOLS_T is a required argument, FalseType otherwise. More...
struct | IsArgumentWrapped
Returns TrueType if GLWEBTOOLS_T is wrapped, FalseType otherwise. More...
struct | IsList
Specialize this traits for a class if it has functions begin() and end() and typedef iterator. More...
struct | IsRange
Specialize this traits for a class if it has functions getMinValue() and getMaxValue(). More...
class | JsonReader
Parses a Json string and provides retrieval and conversion of data. More...
class | JsonWriter
Format data in Json. More...
struct | NameValuePair
Convenient wrapper to find value by name. More...
struct | Not
Returns the result of logical not on its argument. More...
class | OpenSSL
Managed initialization of OpenSSL. More...
struct | Or
Returns the result of logical or on its arguments. More...
class | SAllocator
Very simple allocator implementation, containers using it can be used across dll boundaries. More...
class | SecureDataFormatter
Functor used to format attributes of requests to string. More...
struct | StringValidator
Functor used to validate attribute. More...
struct | TrueType
Boolean true in meta-expression. More...
class | UrlConnection
A handle class wrapping UrlConnection with automatic ref count management. More...
class | UrlConnectionCore
Class for Url Connection. More...
class | UrlRequest
A handle class wrapping UrlRequest with automatic ref count management. More...
class | UrlRequestCore
Class to perform an url request. More...
class | UrlResponse
A handle class wrapping UrlResponse with automatic ref count management. More...
class | UrlResponseCore
Class containing the Response from an Url request. More...

Typedefs

typedef unsigned __int64 | uptr_t
integer pointer type

Enumerations

enum {
E_SUCCESS = 0x00000000, E_UNKNOWN = 0x80000000, E_INVALID_HANDLE = 0x80000001, E_INVALID_PARAMETER = 0x80000002,
E_INVALID_OPERATION = 0x80000003, E_OBJECT_BUSY = 0x80000004, E_MEMORY_ERROR = 0x80000005, E_INVALID_DATA = 0x80000006,
E_INITIALIZATION_ERROR = 0x80000007, E_TIMEOUT = 0x80000008, E_INVALID_CREATION_SETTINGS = 0x80000009, E_TYPE_REGISTRATION_ERROR = 0x80000010,
E_TASK_NOT_FOUND = 0x80000011, E_CONNECTION_CANCELLED = 0x80000012, E_CONNECTION_NOTHREAD = 0x80000013
}
Error definition namespace. More...

Functions

template<typename GLWEBTOOLS_VALUE >
IndexedValue< GLWEBTOOLS_VALUE > | ByIndex (unsigned int index, GLWEBTOOLS_VALUE &value)
template<typename GLWEBTOOLS_VALUE >
NameValuePair< GLWEBTOOLS_VALUE > | ByName (const std::string &name, GLWEBTOOLS_VALUE &value)
template<typename GLWEBTOOLS_VALUE >
NameValuePair< GLWEBTOOLS_VALUE > | ByName (const char *name, GLWEBTOOLS_VALUE &value)
template<typename GLWEBTOOLS_ITERATOR , typename GLWEBTOOLS_VALUE >
glwebtools::Error | operator<< (JsonWriter &writer, IncludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > value)
template<typename GLWEBTOOLS_ITERATOR , typename GLWEBTOOLS_VALUE >
glwebtools::Error | operator<< (JsonWriter &writer, ExcludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > value)
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error | operator>> (const JsonReader &reader, GLWEBTOOLS_VALUE &value)
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error | operator>> (const JsonReader &reader, NameValuePair< GLWEBTOOLS_VALUE > value)
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error | operator>> (const JsonReader &reader, IndexedValue< GLWEBTOOLS_VALUE > value)
template<typename GLWEBTOOLS_ITERATOR , typename GLWEBTOOLS_VALUE >
glwebtools::Error | operator>> (const JsonReader &reader, IncludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > value)
template<typename GLWEBTOOLS_ITERATOR , typename GLWEBTOOLS_VALUE >
glwebtools::Error | operator>> (const JsonReader &reader, ExcludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > value)
template<typename GLWEBTOOLS_VALUE , size_t N>
glwebtools::Error | operator>> (const JsonReader &reader, GLWEBTOOLS_VALUE(&container)[N])

Detailed Description

glwebtools namespace

GlWebTools main namespace.

Enumeration Type Documentation

anonymous enum

Error definition namespace.

Enumerator:
E_SUCCESS

Operation is successful (no error)

E_UNKNOWN

An unknown error occured.

E_INVALID_HANDLE

Object is not properly initialized for the operation.

E_INVALID_PARAMETER

Parameter are not valid for the operation.

E_INVALID_OPERATION

The object doesn't allow the operation in its current state.

E_OBJECT_BUSY

Object is busy and cannot allow operation (this error is a specialization of E_INVALID_OPERATION)

E_MEMORY_ERROR

An memory operation failed and prevent the operation from completing.

E_INVALID_DATA

Internal object data is not valid for current operation.

E_INITIALIZATION_ERROR

Internal object initialization failed.

E_TIMEOUT

Operation has timed out.

E_INVALID_CREATION_SETTINGS

Creation settings are not valid for the initialization.

E_TYPE_REGISTRATION_ERROR

Too many type registered.

E_TASK_NOT_FOUND

Task is not in task group.

E_CONNECTION_CANCELLED

Connection has been cancelled.

E_CONNECTION_NOTHREAD

No thread available to run the connection.

Function Documentation

template<typename GLWEBTOOLS_VALUE >
IndexedValue<GLWEBTOOLS_VALUE> glwebtools::ByIndex | ( | unsigned int | index,
 |  | GLWEBTOOLS_VALUE & | value
 | ) |  |

IndexedValue generator

Parameters:
index | index of the data to be read
[out] | value | value to contains the read data
template<typename GLWEBTOOLS_VALUE >
NameValuePair<GLWEBTOOLS_VALUE> glwebtools::ByName | ( | const std::string & | name,
 |  | GLWEBTOOLS_VALUE & | value
 | ) |  |

NameValuePair generator

Parameters:
name | name of the data to be read
[out] | value | value to contains the read data
template<typename GLWEBTOOLS_VALUE >
NameValuePair<GLWEBTOOLS_VALUE> glwebtools::ByName | ( | const char * | name,
 |  | GLWEBTOOLS_VALUE & | value
 | ) |  |

NameValuePair generator

Parameters:
name | name of the data to be read
[out] | value | value to contains the read data
template<typename GLWEBTOOLS_ITERATOR , typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::operator<< | ( | JsonWriter & | writer,
 |  | IncludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > | value
 | ) |  |

JsonReader Stream extractor

Parameters:
reader | Json string parser
[out] | value | value to contains the read data
template<typename GLWEBTOOLS_ITERATOR , typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::operator<< | ( | JsonWriter & | writer,
 |  | ExcludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > | value
 | ) |  |

JsonReader Stream extractor

Parameters:
reader | Json string parser
[out] | value | value to contains the read data
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::operator>> | ( | const JsonReader & | reader,
 |  | GLWEBTOOLS_VALUE & | value
 | ) |  |

JsonReader Stream extractor

Parameters:
reader | Json string parser
[out] | value | value to contains the read data
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::operator>> | ( | const JsonReader & | reader,
 |  | NameValuePair< GLWEBTOOLS_VALUE > | value
 | ) |  |

JsonReader Stream extractor

Parameters:
reader | Json string parser
[out] | value | value to contains the read data
template<typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::operator>> | ( | const JsonReader & | reader,
 |  | IndexedValue< GLWEBTOOLS_VALUE > | value
 | ) |  |

JsonReader Stream extractor

Parameters:
reader | Json string parser
[out] | value | value to contains the read data
template<typename GLWEBTOOLS_ITERATOR , typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::operator>> | ( | const JsonReader & | reader,
 |  | IncludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > | value
 | ) |  |

JsonReader Stream extractor

Parameters:
reader | Json string parser
[out] | value | value to contains the read data
template<typename GLWEBTOOLS_ITERATOR , typename GLWEBTOOLS_VALUE >
glwebtools::Error glwebtools::operator>> | ( | const JsonReader & | reader,
 |  | ExcludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > | value
 | ) |  |

JsonReader Stream extractor

Parameters:
reader | Json string parser
[out] | value | value to contains the read data
template<typename GLWEBTOOLS_VALUE , size_t N>
glwebtools::Error glwebtools::operator>> | ( | const JsonReader & | reader,
 |  | GLWEBTOOLS_VALUE(&) | container[N]
 | ) |  |

JsonReader Stream extractor

Parameters:
reader | Json string parser
[out] | container | value to contains the read data


GLWebTools: Namespace Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Typedefs
  • Enumerator
Here is a list of all documented namespace members with links to the namespaces they belong to:
  • ByIndex() : glwebtools
  • ByName() : glwebtools
  • E_CONNECTION_CANCELLED : glwebtools
  • E_CONNECTION_NOTHREAD : glwebtools
  • E_INITIALIZATION_ERROR : glwebtools
  • E_INVALID_CREATION_SETTINGS : glwebtools
  • E_INVALID_DATA : glwebtools
  • E_INVALID_HANDLE : glwebtools
  • E_INVALID_OPERATION : glwebtools
  • E_INVALID_PARAMETER : glwebtools
  • E_MEMORY_ERROR : glwebtools
  • E_OBJECT_BUSY : glwebtools
  • E_SUCCESS : glwebtools
  • E_TASK_NOT_FOUND : glwebtools
  • E_TIMEOUT : glwebtools
  • E_TYPE_REGISTRATION_ERROR : glwebtools
  • E_UNKNOWN : glwebtools
  • operator<<() : glwebtools
  • operator>>() : glwebtools
  • uptr_t : glwebtools


GLWebTools: File List

  • File List
File List
Here is a list of all documented files with brief descriptions:
glwebtools_algorithm.h [code]
glwebtools_argumentwrapper.h [code]
glwebtools_atomic.h [code]
glwebtools_attributeformatter.h [code]
glwebtools_attributevalidator.h [code]
glwebtools_codec.h [code]
glwebtools_common.h [code]
glwebtools_condition.h [code]
glwebtools_console.h [code]
glwebtools_curl.h [code]
glwebtools_customattribute.h [code]
glwebtools_debugger_module.h [code]
glwebtools_default_config.h [code]
glwebtools_error.h [code]
glwebtools_glwebtoolscore.h [code]
glwebtools_glwebtoolshandle.h [code]
glwebtools_handlemanager.h [code]
glwebtools_iostream.h [code]
glwebtools_jsonbase.h [code]
glwebtools_jsonreader.h [code]
glwebtools_jsonwriter.h [code]
glwebtools_macro.h [code]
glwebtools_md5.h [code]
glwebtools_memory.h [code]
glwebtools_memorybarrier.h [code]
glwebtools_mutabledata.h [code]
glwebtools_mutex.h [code]
glwebtools_openssl.h [code]
glwebtools_securedata.h [code]
glwebtools_serversideevent.h [code]
glwebtools_serversideeventparser.h [code]
glwebtools_serversideeventstreamparser.h [code]
glwebtools_sha256.h [code]
glwebtools_sha256_internal.h [code]
glwebtools_socket.h [code]
glwebtools_systemclock.h [code]
glwebtools_taskgroup.h [code]
glwebtools_thread.h [code]
glwebtools_threadpool.h [code]
glwebtools_time.h [code]
glwebtools_types.h [code]
glwebtools_typetraits.h [code]
glwebtools_urlconnection.h [code]
glwebtools_urlhandle.h [code]
glwebtools_urlrequest.h [code]
glwebtools_urlrequest_xmlhttprequest2_helper.h [code]
glwebtools_urlresponse.h [code]
glwebtools_version.h [code]


GLWebTools: Member List

  • glwebtools
  • AttributeFormatter
glwebtools::AttributeFormatter Member List
This is the complete list of members for glwebtools::AttributeFormatter, including all inherited members.
operator()(VALUE value) const | glwebtools::AttributeFormatter | [inline]
operator==(const AttributeFormatter &) const | glwebtools::AttributeFormatter | [inline]
ToString(bool value) | glwebtools::AttributeFormatter | [static]
ToString(int value) | glwebtools::AttributeFormatter | [static]
ToString(unsigned int value) | glwebtools::AttributeFormatter | [static]
ToString(long long value) | glwebtools::AttributeFormatter | [static]
ToString(float value, int precision=2) | glwebtools::AttributeFormatter | [static]
ToString(double value, int precision=2) | glwebtools::AttributeFormatter | [static]
ToString(const char *value) | glwebtools::AttributeFormatter | [inline, static]
ToString(const std::string &value) | glwebtools::AttributeFormatter | [inline, static]


GLWebTools: Member List

  • glwebtools
  • Codec
glwebtools::Codec Member List
This is the complete list of members for glwebtools::Codec, including all inherited members.
DecodeBase64(const char *base64Data, size_t dataSize, void *outData, bool strict=false) | glwebtools::Codec | [static]
DecodeBase64(const glwebtools::String &base64Data, void *outData, bool strict=false) | glwebtools::Codec | [static]
DecodeBase64Custom(const char *base64Data, size_t dataSize, void *outData, const char *customkey) | glwebtools::Codec | [static]
DecodeBase64Custom(const glwebtools::String &base64Data, void *outData, const char *customkey) | glwebtools::Codec | [static]
DecodeBlob(const glwebtools::String &blobbedData, void *outData) | glwebtools::Codec | [static]
DecodeUrl(const glwebtools::String &source, glwebtools::String &dest) | glwebtools::Codec | [static]
DecryptTEA(const void *indata, size_t indataSize, void *outData, size_t outdataSize, const unsigned int *key) | glwebtools::Codec | [static]
DecryptXTEA(const void *indata, size_t indataSize, void *outData, size_t outdataSize, const unsigned int *key) | glwebtools::Codec | [static]
DecryptXXTEA(const void *indata, size_t indataSize, void *outData, size_t outdataSize, const unsigned int *key) | glwebtools::Codec | [static]
EncodeBase64(const unsigned char *src, size_t dataSize, glwebtools::String &dest, MaxLineLength maxLineLength=none) | glwebtools::Codec | [static]
EncodeBase64(const unsigned char *src, size_t dataSize, glwebtools::String &dest, size_t maxLineLength) | glwebtools::Codec | [static]
EncodeBase64Custom(const unsigned char *src, size_t dataSize, glwebtools::String &dest, const char *customkey) | glwebtools::Codec | [static]
EncodeBlob(const unsigned char *src, size_t dataSize, glwebtools::String &dest) | glwebtools::Codec | [static]
EncodeUrlRFC1738(const glwebtools::String &source, glwebtools::String &dest) | glwebtools::Codec | [static]
EncodeUrlRFC3986(const glwebtools::String &source, glwebtools::String &dest) | glwebtools::Codec | [static]
EncryptTEA(const void *indata, size_t indataSize, void *outData, size_t outdataSize, const unsigned int *key) | glwebtools::Codec | [static]
EncryptXTEA(const void *indata, size_t indataSize, void *outData, size_t outdataSize, const unsigned int *key) | glwebtools::Codec | [static]
EncryptXXTEA(const void *indata, size_t indataSize, void *outData, size_t outdataSize, const unsigned int *key) | glwebtools::Codec | [static]
GenerateBase64CustomKey(char *key) | glwebtools::Codec | [static]
GenerateBase64CustomKey(char *key, unsigned int seed1, unsigned int seed2) | glwebtools::Codec | [static]
GenerateMD5(const void *data, size_t size, char *dest) | glwebtools::Codec | [static]
GenerateSHA256(const void *data, size_t size, char *dest) | glwebtools::Codec | [static]
GetDecodedBase64DataSize(const glwebtools::String &base64Data, bool strict=false) | glwebtools::Codec | [static]
GetDecodedBlobDataSize(const glwebtools::String &blobbedData) | glwebtools::Codec | [static]
GetEncryptedTEADataSize(size_t inDataSize) | glwebtools::Codec | [static]
GetEncryptedXTEADataSize(size_t inDataSize) | glwebtools::Codec | [static]
GetEncryptedXXTEADataSize(size_t inDataSize) | glwebtools::Codec | [static]
IsInBase64Alphabet(char data) | glwebtools::Codec | [static]
Random(unsigned int &seed1, unsigned int &seed2) | glwebtools::Codec | [static]


GLWebTools: Member List

  • glwebtools
  • Curl
glwebtools::Curl Member List
This is the complete list of members for glwebtools::Curl, including all inherited members.
Curl() | glwebtools::Curl
~Curl() | glwebtools::Curl


GLWebTools: Member List

  • glwebtools
  • FloatFormatter
glwebtools::FloatFormatter< PRECISION > Member List
This is the complete list of members for glwebtools::FloatFormatter< PRECISION >, including all inherited members.
operator()(float value) const | glwebtools::FloatFormatter< PRECISION > | [inline]
operator()(double value) const | glwebtools::FloatFormatter< PRECISION > | [inline]
operator==(const FloatFormatter< PRECISION > &) const | glwebtools::FloatFormatter< PRECISION > | [inline]


GLWebTools: Member List

  • glwebtools
  • GlWebTools
glwebtools::GlWebTools Member List
This is the complete list of members for glwebtools::GlWebTools, including all inherited members.
AddTaskGroup(const TaskGroupId &id, const TaskGroup::CreationSettings &creationSettings) | glwebtools::GlWebTools
AddTaskGroup(const TaskGroupId &id) | glwebtools::GlWebTools
CreateUrlConnection() | glwebtools::GlWebTools
CreateUrlConnection(UrlConnection::CreationSettings &cs) | glwebtools::GlWebTools
CreateUrlRequest() | glwebtools::GlWebTools
CreateUrlRequest(UrlRequest::CreationSettings &cs) | glwebtools::GlWebTools
GlWebTools() | glwebtools::GlWebTools
GlWebTools(const GlWebTools &rhs) | glwebtools::GlWebTools
Initialize(const GlWebTools::CreationSettings &cs) | glwebtools::GlWebTools
IsInitialized() const | glwebtools::GlWebTools
operator=(const GlWebTools &rhs) | glwebtools::GlWebTools
Release() | glwebtools::GlWebTools
Release(unsigned int milliseconds) | glwebtools::GlWebTools
Shutdown() | glwebtools::GlWebTools
ShutdownInProgress() const | glwebtools::GlWebTools
Terminate() | glwebtools::GlWebTools
Terminate(unsigned int milliseconds) | glwebtools::GlWebTools
Update() | glwebtools::GlWebTools
~GlWebTools() | glwebtools::GlWebTools


GLWebTools: Member List

  • glwebtools
  • GlWebToolsCore
glwebtools::GlWebToolsCore Member List
This is the complete list of members for glwebtools::GlWebToolsCore, including all inherited members.
AddTaskGroup(const TaskGroupId &id, const TaskGroup::CreationSettings &creationSettings) | glwebtools::GlWebToolsCore |
AddTaskGroup(const TaskGroupId &id) | glwebtools::GlWebToolsCore |
~GlWebToolsCore() | glwebtools::GlWebToolsCore | [virtual]


GLWebTools: Member List

  • glwebtools
  • HandleManager
glwebtools::HandleManager Member List
This is the complete list of members for glwebtools::HandleManager, including all inherited members.


GLWebTools: Member List

  • glwebtools
  • JsonReader
glwebtools::JsonReader Member List
This is the complete list of members for glwebtools::JsonReader, including all inherited members.
begin() const | glwebtools::JsonReader |
ByIndex(unsigned int index, GLWEBTOOLS_VALUE &value) | glwebtools::JsonReader | [inline, static]
ByName(const std::string &name, GLWEBTOOLS_VALUE &value) | glwebtools::JsonReader | [inline, static]
ByName(const char *name, GLWEBTOOLS_VALUE &value) | glwebtools::JsonReader | [inline, static]
end() const | glwebtools::JsonReader |
exclude(const char **begin, const char **end, glwebtools::CustomAttributeList &value) const | glwebtools::JsonReader |
exclude(const char **begin, const char **end, glwebtools::JSONObject &value) const | glwebtools::JsonReader |
exclude(size_t *begin, size_t *end, glwebtools::JSONArray &value) const | glwebtools::JsonReader |
include(const char **begin, const char **end, glwebtools::CustomAttributeList &value) const | glwebtools::JsonReader |
include(const char **begin, const char **end, glwebtools::JSONObject &value) const | glwebtools::JsonReader |
include(size_t *begin, size_t *end, glwebtools::JSONArray &value) const | glwebtools::JsonReader |
isArray() const | glwebtools::JsonReader |
isBool() const | glwebtools::JsonReader |
isDouble() const | glwebtools::JsonReader |
isInt() const | glwebtools::JsonReader |
isObject() const | glwebtools::JsonReader |
isString() const | glwebtools::JsonReader |
isUInt() const | glwebtools::JsonReader |
IsValid() const | glwebtools::JsonReader |
JsonReader() | glwebtools::JsonReader |
JsonReader(const std::string &data) | glwebtools::JsonReader | [explicit]
JsonReader(const char *data) | glwebtools::JsonReader | [explicit]
operator[](unsigned int index) const | glwebtools::JsonReader |
operator[](const std::string &name) const | glwebtools::JsonReader |
operator[](const char *name) const | glwebtools::JsonReader |
parse(const std::string &data) | glwebtools::JsonReader |
parse(const char *data) | glwebtools::JsonReader |
read(short &value) const | glwebtools::JsonReader |
read(unsigned short &value) const | glwebtools::JsonReader |
read(int &value) const | glwebtools::JsonReader |
read(unsigned int &value) const | glwebtools::JsonReader |
read(double &value) const | glwebtools::JsonReader |
read(bool &value) const | glwebtools::JsonReader |
read(std::string &value) const | glwebtools::JsonReader |
read(glwebtools::CustomArgument &argument) const | glwebtools::JsonReader |
read(glwebtools::CustomAttributeList &attribute) const | glwebtools::JsonReader |
read(glwebtools::JSONValue &argument) const | glwebtools::JsonReader |
read(glwebtools::JSONObject &value) const | glwebtools::JsonReader |
read(glwebtools::JSONArray &value) const | glwebtools::JsonReader |
read(GLWEBTOOLS_VALUE &value) const | glwebtools::JsonReader | [inline]
read(NameValuePair< GLWEBTOOLS_VALUE > value) const | glwebtools::JsonReader | [inline]
read(NameValuePair< glwebtools::OptionalArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > > value) const | glwebtools::JsonReader | [inline]
read(IndexedValue< GLWEBTOOLS_VALUE > value) const | glwebtools::JsonReader | [inline]
read(IncludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > value) const | glwebtools::JsonReader | [inline]
read(ExcludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > value) const | glwebtools::JsonReader | [inline]
read(IndexedValue< glwebtools::OptionalArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > > value) const | glwebtools::JsonReader | [inline]
read(glwebtools::OptionalArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > &value) const | glwebtools::JsonReader | [inline]
read(glwebtools::RequiredArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > &value) const | glwebtools::JsonReader | [inline]
read(std::vector< GLWEBTOOLS_VALUE, GLWEBTOOLS_ALLOCATOR > &container) const | glwebtools::JsonReader | [inline]
read(std::set< GLWEBTOOLS_VALUE, GLWEBTOOLS_COMPARE, GLWEBTOOLS_ALLOCATOR > &container) const | glwebtools::JsonReader | [inline]
read(std::map< GLWEBTOOLS_KEY, GLWEBTOOLS_VALUE, GLWEBTOOLS_COMPARE, GLWEBTOOLS_ALLOCATOR > &container) const | glwebtools::JsonReader | [inline]
size() const | glwebtools::JsonReader |
ToString() const | glwebtools::JsonReader |
ToString(std::string &result) const | glwebtools::JsonReader |


GLWebTools: Member List

  • glwebtools
  • JsonReader
  • Iterator
glwebtools::JsonReader::Iterator Member List
This is the complete list of members for glwebtools::JsonReader::Iterator, including all inherited members.
index() const | glwebtools::JsonReader::Iterator
Iterator() | glwebtools::JsonReader::Iterator
Iterator(const Iterator &other) | glwebtools::JsonReader::Iterator
name() const | glwebtools::JsonReader::Iterator
operator!=(const Iterator &other) const | glwebtools::JsonReader::Iterator
operator*() const | glwebtools::JsonReader::Iterator
operator++(int) | glwebtools::JsonReader::Iterator
operator++() | glwebtools::JsonReader::Iterator
operator--(int) | glwebtools::JsonReader::Iterator
operator--() | glwebtools::JsonReader::Iterator
operator=(const Iterator &other) | glwebtools::JsonReader::Iterator
operator==(const Iterator &other) const | glwebtools::JsonReader::Iterator


GLWebTools: Member List

  • glwebtools
  • JsonWriter
glwebtools::JsonWriter Member List
This is the complete list of members for glwebtools::JsonWriter, including all inherited members.
append(const GLWEBTOOLS_VALUE &value) | glwebtools::JsonWriter | [inline]
exclude(const char **begin, const char **end, const glwebtools::CustomAttributeList &value) | glwebtools::JsonWriter |
exclude(const char **begin, const char **end, const glwebtools::JSONObject &value) | glwebtools::JsonWriter |
exclude(size_t *begin, size_t *end, const glwebtools::JSONArray &value) | glwebtools::JsonWriter |
include(const char **begin, const char **end, const glwebtools::CustomAttributeList &value) | glwebtools::JsonWriter |
include(const char **begin, const char **end, const glwebtools::JSONObject &value) | glwebtools::JsonWriter |
include(size_t *begin, size_t *end, const glwebtools::JSONArray &value) | glwebtools::JsonWriter |
insert(unsigned int index, const GLWEBTOOLS_VALUE &value) | glwebtools::JsonWriter | [inline]
insert(const std::string &name, const GLWEBTOOLS_VALUE &value) | glwebtools::JsonWriter | [inline]
insert(const char *name, const GLWEBTOOLS_VALUE &value) | glwebtools::JsonWriter | [inline]
isArray() const | glwebtools::JsonWriter |
isBool() const | glwebtools::JsonWriter |
isDouble() const | glwebtools::JsonWriter |
isInt() const | glwebtools::JsonWriter |
isObject() const | glwebtools::JsonWriter |
isString() const | glwebtools::JsonWriter |
isUInt() const | glwebtools::JsonWriter |
IsValid() const | glwebtools::JsonWriter |
JsonWriter() | glwebtools::JsonWriter |
JsonWriter(GLWEBTOOLS_VALUE value) | glwebtools::JsonWriter | [inline, explicit]
operator[](unsigned int index) | glwebtools::JsonWriter |
operator[](const std::string &name) | glwebtools::JsonWriter |
operator[](const char *name) | glwebtools::JsonWriter |
ToPrettyString() const | glwebtools::JsonWriter |
ToPrettyString(std::string &result) const | glwebtools::JsonWriter |
ToString() const | glwebtools::JsonWriter |
ToString(std::string &result) const | glwebtools::JsonWriter |
write(int value) | glwebtools::JsonWriter |
write(unsigned int value) | glwebtools::JsonWriter |
write(double value) | glwebtools::JsonWriter |
write(float value) | glwebtools::JsonWriter |
write(bool value) | glwebtools::JsonWriter |
write(const std::string &value) | glwebtools::JsonWriter |
write(const char *value) | glwebtools::JsonWriter |
write(const GLWEBTOOLS_VALUE &value) | glwebtools::JsonWriter | [inline]
write(NameValuePair< GLWEBTOOLS_VALUE > value) | glwebtools::JsonWriter | [inline]
write(NameValuePair< const glwebtools::OptionalArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > > value) | glwebtools::JsonWriter | [inline]
write(NameValuePair< const glwebtools::RequiredArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > > value) | glwebtools::JsonWriter | [inline]
write(IndexedValue< GLWEBTOOLS_VALUE > value) | glwebtools::JsonWriter | [inline]
write(IndexedValue< const glwebtools::OptionalArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > > value) | glwebtools::JsonWriter | [inline]
write(IndexedValue< const glwebtools::RequiredArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > > value) | glwebtools::JsonWriter | [inline]
write(IncludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > value) | glwebtools::JsonWriter | [inline]
write(ExcludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > value) | glwebtools::JsonWriter | [inline]
write(const glwebtools::OptionalArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > &value) | glwebtools::JsonWriter | [inline]
write(const glwebtools::RequiredArgument< GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER > &value) | glwebtools::JsonWriter | [inline]
write(const glwebtools::CustomArgument &argument) | glwebtools::JsonWriter |
write(const glwebtools::CustomAttributeList &argument) | glwebtools::JsonWriter |
write(const glwebtools::JSONValue &argument) | glwebtools::JsonWriter |
write(NameValuePair< const glwebtools::JSONObject > argument) | glwebtools::JsonWriter |
write(IndexedValue< const glwebtools::JSONArray > argument) | glwebtools::JsonWriter |
write(const glwebtools::JSONObject &argument) | glwebtools::JsonWriter |
write(const glwebtools::JSONArray &argument) | glwebtools::JsonWriter |
write(ITERATOR begin, ITERATOR end) | glwebtools::JsonWriter | [inline]


GLWebTools: Member List

  • glwebtools
  • OpenSSL
glwebtools::OpenSSL Member List
This is the complete list of members for glwebtools::OpenSSL, including all inherited members.
OpenSSL() | glwebtools::OpenSSL
~OpenSSL() | glwebtools::OpenSSL


GLWebTools: Member List

  • glwebtools
  • SAllocator
glwebtools::SAllocator< GLWEBTOOLS_T, Hint > Member List
This is the complete list of members for glwebtools::SAllocator< GLWEBTOOLS_T, Hint >, including all inherited members.
allocate(size_t cnt, const void *hint=0) | glwebtools::SAllocator< GLWEBTOOLS_T, Hint > | [inline]
construct(GLWEBTOOLS_T *ptr, const GLWEBTOOLS_T &e) | glwebtools::SAllocator< GLWEBTOOLS_T, Hint > | [inline]
deallocate(GLWEBTOOLS_T *ptr, size_type) | glwebtools::SAllocator< GLWEBTOOLS_T, Hint > | [inline]
destroy(GLWEBTOOLS_T *ptr) | glwebtools::SAllocator< GLWEBTOOLS_T, Hint > | [inline]


GLWebTools: Member List

  • glwebtools
  • SecureDataFormatter
glwebtools::SecureDataFormatter< FORMATTER > Member List
This is the complete list of members for glwebtools::SecureDataFormatter< FORMATTER >, including all inherited members.
operator()(GLWEBTOOLS_T value) const | glwebtools::SecureDataFormatter< FORMATTER > | [inline]
operator==(const SecureDataFormatter< FORMATTER > &) const | glwebtools::SecureDataFormatter< FORMATTER > | [inline]


GLWebTools: Member List

  • glwebtools
  • UrlConnection
glwebtools::UrlConnection Member List
This is the complete list of members for glwebtools::UrlConnection, including all inherited members.
CancelRequest() | glwebtools::UrlConnection |
GetCreationSettings(UrlConnection::CreationSettings &cs) const | glwebtools::UrlConnection |
GetDownloadedBytes() const | glwebtools::UrlConnection |
GetLastError() const | glwebtools::UrlConnection |
GetOutputDebugString(std::string &outputDebugString) const | glwebtools::UrlConnection |
GetState() const | glwebtools::UrlConnection |
GetUrlResponse() const | glwebtools::UrlConnection |
HasDataPacket() const | glwebtools::UrlConnection |
HasServerSideEvent() const | glwebtools::UrlConnection |
IsError() const | glwebtools::UrlConnection |
IsHandleValid() const | glwebtools::UrlConnection |
IsReadyToRun() const | glwebtools::UrlConnection |
IsRunning() const | glwebtools::UrlConnection |
operator=(const UrlConnection &rhs) | glwebtools::UrlConnection |
PopDataPacket(MutableData &outData) | glwebtools::UrlConnection |
PopServerSideEvent(ServerSideEvent &serverSideEvent) | glwebtools::UrlConnection |
Release() | glwebtools::UrlConnection |
S_ERROR enum value | glwebtools::UrlConnection |
S_IDLE enum value | glwebtools::UrlConnection |
S_INVALID enum value | glwebtools::UrlConnection |
S_RUNNING enum value | glwebtools::UrlConnection |
S_WAITING_TO_RUN enum value | glwebtools::UrlConnection |
StartRequest(UrlRequest &anUrlRequest) | glwebtools::UrlConnection |
State enum name | glwebtools::UrlConnection |
SupportDataPacketQueue() const | glwebtools::UrlConnection |
SupportServerSideEvent() const | glwebtools::UrlConnection |
UrlConnection() | glwebtools::UrlConnection |
UrlConnection(const UrlConnection &rhs) | glwebtools::UrlConnection |
~UrlConnection() | glwebtools::UrlConnection | [virtual]


GLWebTools: Member List

  • glwebtools
  • UrlConnectionCore
glwebtools::UrlConnectionCore Member List
This is the complete list of members for glwebtools::UrlConnectionCore, including all inherited members.
RunRequestStatic(void *caller, void *param) | glwebtools::UrlConnectionCore | [static]
~UrlConnectionCore() | glwebtools::UrlConnectionCore | [virtual]


GLWebTools: Member List

  • glwebtools
  • UrlRequest
glwebtools::UrlRequest Member List
This is the complete list of members for glwebtools::UrlRequest, including all inherited members.
AddData(const std::map< std::string, std::string > &dataMap) | glwebtools::UrlRequest |
AddData(const char *key, const char *value) | glwebtools::UrlRequest |
AddData(const char *key, const std::string &value) | glwebtools::UrlRequest |
AddData(const std::string &key, const std::string &value) | glwebtools::UrlRequest |
AddHeaders(const char *headerField, const char *value) | glwebtools::UrlRequest |
AddHeaders(const char *headerField, const std::string &value) | glwebtools::UrlRequest |
AddHeaders(const std::string &headerField, const std::string &value) | glwebtools::UrlRequest |
ClearData() | glwebtools::UrlRequest |
ClearHeaders() | glwebtools::UrlRequest |
GetCreationSettings(UrlRequest::CreationSettings &cs) const | glwebtools::UrlRequest |
GetMethod() const | glwebtools::UrlRequest |
GetState() const | glwebtools::UrlRequest |
IsError() const | glwebtools::UrlRequest |
IsHandleValid() const | glwebtools::UrlRequest |
IsInitialState() const | glwebtools::UrlRequest |
IsReadyToRun() const | glwebtools::UrlRequest |
IsRunning() const | glwebtools::UrlRequest |
M_DELETE enum value | glwebtools::UrlRequest |
M_GET enum value | glwebtools::UrlRequest |
M_HEAD enum value | glwebtools::UrlRequest |
M_POST enum value | glwebtools::UrlRequest |
Method enum name | glwebtools::UrlRequest |
operator=(const UrlRequest &rhs) | glwebtools::UrlRequest |
Protocol enum name | glwebtools::UrlRequest |
Release() | glwebtools::UrlRequest |
Reset() | glwebtools::UrlRequest |
S_ERROR enum value | glwebtools::UrlRequest |
S_IDLE enum value | glwebtools::UrlRequest |
S_INITIAL enum value | glwebtools::UrlRequest |
S_INVALID enum value | glwebtools::UrlRequest |
S_RUNNING enum value | glwebtools::UrlRequest |
SetData(const std::string &data) | glwebtools::UrlRequest |
SetData(const void *data, size_t dataSize) | glwebtools::UrlRequest |
SetData(const std::map< std::string, std::string > &dataMap) | glwebtools::UrlRequest |
SetHeaders(const std::map< std::string, std::string > &headerMap) | glwebtools::UrlRequest |
SetHTTPSUrl(const char *authority, const char *path=0, unsigned int port=0) | glwebtools::UrlRequest |
SetHTTPSUrl(const std::string &authority, const std::string &path, unsigned int port=0) | glwebtools::UrlRequest |
SetHTTPUrl(const char *authority, const char *path=0, unsigned int port=0) | glwebtools::UrlRequest |
SetHTTPUrl(const std::string &authority, const std::string &path, unsigned int port=0) | glwebtools::UrlRequest |
SetMethod(UrlRequest::Method method) | glwebtools::UrlRequest |
SetUrl(const char *url, unsigned int port=0) | glwebtools::UrlRequest |
SetUrl(const std::string &url, unsigned int port=0) | glwebtools::UrlRequest |
SetUrl(UrlRequest::Protocol protocol, const char *authority, const char *path, unsigned int port=0) | glwebtools::UrlRequest |
SetUrl(UrlRequest::Protocol protocol, const std::string &authority, const std::string &path, unsigned int port=0) | glwebtools::UrlRequest |
State enum name | glwebtools::UrlRequest |
UrlRequest() | glwebtools::UrlRequest |
UrlRequest(const UrlRequest &rhs) | glwebtools::UrlRequest |
~UrlRequest() | glwebtools::UrlRequest | [virtual]


GLWebTools: Member List

  • glwebtools
  • UrlRequestCore
glwebtools::UrlRequestCore Member List
This is the complete list of members for glwebtools::UrlRequestCore, including all inherited members.


GLWebTools: Member List

  • glwebtools
  • UrlResponse
glwebtools::UrlResponse Member List
This is the complete list of members for glwebtools::UrlResponse, including all inherited members.
GetData(const void *&dataPtr, size_t &dataSize) const | glwebtools::UrlResponse |
GetDataAsString(std::string &outString) const | glwebtools::UrlResponse |
GetHeaderField(const char *fieldId) const | glwebtools::UrlResponse |
GetResponseCode() const | glwebtools::UrlResponse |
IsHandleValid() const | glwebtools::UrlResponse |
IsHTTPError() const | glwebtools::UrlResponse |
IsResponseReady() const | glwebtools::UrlResponse |
operator=(const UrlResponse &rhs) | glwebtools::UrlResponse |
Release() | glwebtools::UrlResponse |
UrlResponse() | glwebtools::UrlResponse |
UrlResponse(const UrlResponse &rhs) | glwebtools::UrlResponse |
~UrlResponse() | glwebtools::UrlResponse | [virtual]


GLWebTools: Member List

  • glwebtools
  • UrlResponseCore
glwebtools::UrlResponseCore Member List
This is the complete list of members for glwebtools::UrlResponseCore, including all inherited members.
GetData(const void *&dataPtr, size_t &dataSize) const | glwebtools::UrlResponseCore
GetDataAsString(glwebtools::String &outString) const | glwebtools::UrlResponseCore
GetHeaderField(const char *fieldId) const | glwebtools::UrlResponseCore
GetResponseCode() const | glwebtools::UrlResponseCore


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- j -

  • JsonReader() : glwebtools::JsonReader
  • JsonWriter() : glwebtools::JsonWriter


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- m -

  • m_acceptEncoding : glwebtools::UrlConnection::CreationSettings
  • m_applicationIdentifier : glwebtools::GlWebTools::CreationSettings
  • m_applicationVersion : glwebtools::GlWebTools::CreationSettings
  • m_connectionHysteresis_ms : glwebtools::GlWebTools::CreationSettings
  • m_connectionMaxThreadCount : glwebtools::GlWebTools::CreationSettings
  • m_connectionMinThreadCount : glwebtools::GlWebTools::CreationSettings
  • m_connectionThreadPriority : glwebtools::GlWebTools::CreationSettings
  • m_connectTimeout : glwebtools::UrlConnection::CreationSettings
  • M_DELETE : glwebtools::UrlRequest
  • m_deviceIdentifier : glwebtools::GlWebTools::CreationSettings
  • m_enableAcceptEncoding : glwebtools::UrlConnection::CreationSettings
  • m_follow302 : glwebtools::UrlConnection::CreationSettings
  • M_GET : glwebtools::UrlRequest
  • M_HEAD : glwebtools::UrlRequest
  • m_hysteresis_ms : glwebtools::ThreadPool::CreationSettings
  • m_instanceName : glwebtools::GlWebTools::CreationSettings
  • m_isThreadedUpdate : glwebtools::GlWebTools::CreationSettings
  • m_maxConnections : glwebtools::UrlConnection::CreationSettings
  • m_maxThreadCount : glwebtools::ThreadPool::CreationSettings
  • m_maxThreadStartTime_ms : glwebtools::GlWebTools::CreationSettings , glwebtools::ThreadPool::CreationSettings
  • m_minThreadCount : glwebtools::ThreadPool::CreationSettings
  • m_osIdentifier : glwebtools::GlWebTools::CreationSettings
  • m_osVersion : glwebtools::GlWebTools::CreationSettings
  • m_peerCAFile : glwebtools::UrlConnection::CreationSettings
  • M_POST : glwebtools::UrlRequest
  • m_supportServerSideEvent : glwebtools::UrlConnection::CreationSettings
  • m_taskGroupId : glwebtools::UrlConnection::CreationSettings
  • m_taskStartTimeout : glwebtools::UrlConnection::CreationSettings
  • m_threadedUpdatePeriod : glwebtools::GlWebTools::CreationSettings
  • m_threadPriority : glwebtools::UrlConnection::CreationSettings , glwebtools::ThreadPool::CreationSettings
  • m_timeout : glwebtools::UrlConnection::CreationSettings
  • m_updateThreadPriority : glwebtools::GlWebTools::CreationSettings
  • m_useDataPacketQueue : glwebtools::UrlConnection::CreationSettings
  • m_userAgent : glwebtools::UrlConnection::CreationSettings
  • Method : glwebtools::UrlRequest


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- n -

  • name() : glwebtools::JsonReader::Iterator


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- o -

  • OpenSSL() : glwebtools::OpenSSL
  • operator GLWEBTOOLS_T const &() : glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
  • operator!=() : glwebtools::JsonReader::Iterator
  • operator()()
: glwebtools::AttributeFormatter
, glwebtools::StringValidator
, glwebtools::SecureDataFormatter< FORMATTER >
, glwebtools::FloatFormatter< PRECISION >
, glwebtools::AttributeValidator
  • operator*() : glwebtools::JsonReader::Iterator
  • operator++() : glwebtools::JsonReader::Iterator
  • operator--() : glwebtools::JsonReader::Iterator
  • operator<< : glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
  • operator=()
: glwebtools::GlWebTools
, glwebtools::UrlConnection
, glwebtools::UrlRequest
, glwebtools::UrlResponse
, glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
, glwebtools::JsonReader::Iterator
  • operator==()
: glwebtools::JsonReader::Iterator
, glwebtools::AttributeFormatter
, glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
, glwebtools::FloatFormatter< PRECISION >
, glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
, glwebtools::SecureDataFormatter< FORMATTER >
  • operator[]()
: glwebtools::JsonReader
, glwebtools::JsonWriter
, glwebtools::JsonReader
, glwebtools::JsonWriter


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- ~ -

  • ~Curl() : glwebtools::Curl
  • ~GlWebTools() : glwebtools::GlWebTools
  • ~GlWebToolsCore() : glwebtools::GlWebToolsCore
  • ~OpenSSL() : glwebtools::OpenSSL
  • ~UrlConnection() : glwebtools::UrlConnection
  • ~UrlConnectionCore() : glwebtools::UrlConnectionCore
  • ~UrlRequest() : glwebtools::UrlRequest
  • ~UrlResponse() : glwebtools::UrlResponse


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- b -

  • begin() : glwebtools::JsonReader
  • ByIndex() : glwebtools::JsonReader
  • ByName() : glwebtools::JsonReader


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- c -

  • CancelRequest() : glwebtools::UrlConnection
  • ClearData() : glwebtools::UrlRequest
  • ClearHeaders() : glwebtools::UrlRequest
  • construct() : glwebtools::SAllocator< GLWEBTOOLS_T, Hint >
  • CreateUrlConnection() : glwebtools::GlWebTools
  • CreateUrlRequest() : glwebtools::GlWebTools
  • CreationSettings()
: glwebtools::UrlConnection::CreationSettings
, glwebtools::ThreadPool::CreationSettings
, glwebtools::UrlConnection::CreationSettings
, glwebtools::GlWebTools::CreationSettings
  • Curl() : glwebtools::Curl


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- d -

  • deallocate() : glwebtools::SAllocator< GLWEBTOOLS_T, Hint >
  • DecodeBase64() : glwebtools::Codec
  • DecodeBase64Custom() : glwebtools::Codec
  • DecodeBlob() : glwebtools::Codec
  • DecodeUrl() : glwebtools::Codec
  • DecryptTEA() : glwebtools::Codec
  • DecryptXTEA() : glwebtools::Codec
  • DecryptXXTEA() : glwebtools::Codec
  • destroy() : glwebtools::SAllocator< GLWEBTOOLS_T, Hint >


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- e -

  • EncodeBase64() : glwebtools::Codec
  • EncodeBase64Custom() : glwebtools::Codec
  • EncodeBlob() : glwebtools::Codec
  • EncodeUrlRFC1738() : glwebtools::Codec
  • EncodeUrlRFC3986() : glwebtools::Codec
  • EncryptTEA() : glwebtools::Codec
  • EncryptXTEA() : glwebtools::Codec
  • EncryptXXTEA() : glwebtools::Codec
  • end() : glwebtools::JsonReader
  • exclude()
: glwebtools::JsonReader
, glwebtools::JsonWriter
, glwebtools::JsonReader
, glwebtools::JsonWriter
, glwebtools::JsonReader
, glwebtools::JsonWriter


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- f -

  • Formatter() : glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- g -

  • GenerateBase64CustomKey() : glwebtools::Codec
  • GenerateMD5() : glwebtools::Codec
  • GenerateSHA256() : glwebtools::Codec
  • GetCreationSettings()
: glwebtools::UrlConnection
, glwebtools::UrlRequest
  • GetData()
: glwebtools::UrlResponseCore
, glwebtools::UrlResponse
  • GetDataAsString()
: glwebtools::UrlResponse
, glwebtools::UrlResponseCore
  • GetDecodedBase64DataSize() : glwebtools::Codec
  • GetDecodedBlobDataSize() : glwebtools::Codec
  • GetDownloadedBytes() : glwebtools::UrlConnection
  • GetEncryptedTEADataSize() : glwebtools::Codec
  • GetEncryptedXTEADataSize() : glwebtools::Codec
  • GetEncryptedXXTEADataSize() : glwebtools::Codec
  • GetHeaderField()
: glwebtools::UrlResponse
, glwebtools::UrlResponseCore
  • GetLastError() : glwebtools::UrlConnection
  • GetMethod() : glwebtools::UrlRequest
  • GetOutputDebugString() : glwebtools::UrlConnection
  • GetResponseCode()
: glwebtools::UrlResponse
, glwebtools::UrlResponseCore
  • GetState()
: glwebtools::UrlRequest
, glwebtools::UrlConnection
  • GetUrlResponse() : glwebtools::UrlConnection
  • GlWebTools() : glwebtools::GlWebTools


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- h -

  • HasDataPacket() : glwebtools::UrlConnection
  • HasServerSideEvent() : glwebtools::UrlConnection


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- i -

  • include()
: glwebtools::JsonReader
, glwebtools::JsonWriter
, glwebtools::JsonReader
, glwebtools::JsonWriter
  • index() : glwebtools::JsonReader::Iterator
  • Initialize() : glwebtools::GlWebTools
  • insert() : glwebtools::JsonWriter
  • isArray()
: glwebtools::JsonReader
, glwebtools::JsonWriter
  • isBool()
: glwebtools::JsonReader
, glwebtools::JsonWriter
  • isDouble()
: glwebtools::JsonReader
, glwebtools::JsonWriter
  • IsError()
: glwebtools::UrlConnection
, glwebtools::UrlRequest
  • IsHandleValid()
: glwebtools::UrlConnection
, glwebtools::UrlRequest
, glwebtools::UrlResponse
  • IsHTTPError() : glwebtools::UrlResponse
  • IsInBase64Alphabet() : glwebtools::Codec
  • IsInitialized() : glwebtools::GlWebTools
  • IsInitialState() : glwebtools::UrlRequest
  • isInt()
: glwebtools::JsonReader
, glwebtools::JsonWriter
  • isObject()
: glwebtools::JsonReader
, glwebtools::JsonWriter
  • IsReadyToRun()
: glwebtools::UrlRequest
, glwebtools::UrlConnection
  • IsResponseReady() : glwebtools::UrlResponse
  • IsRunning()
: glwebtools::UrlConnection
, glwebtools::UrlRequest
  • isString()
: glwebtools::JsonWriter
, glwebtools::JsonReader
  • isUInt()
: glwebtools::JsonWriter
, glwebtools::JsonReader
  • IsValid()
: glwebtools::JsonWriter
, glwebtools::JsonReader
, glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
  • Iterator() : glwebtools::JsonReader::Iterator


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- p -

  • parse() : glwebtools::JsonReader
  • PopDataPacket() : glwebtools::UrlConnection
  • PopServerSideEvent() : glwebtools::UrlConnection
  • Protocol : glwebtools::UrlRequest


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- r -

  • Random() : glwebtools::Codec
  • read() : glwebtools::JsonReader
  • Release()
: glwebtools::GlWebTools
, glwebtools::UrlConnection
, glwebtools::UrlRequest
, glwebtools::UrlResponse
, glwebtools::GlWebTools
  • Reset()
: glwebtools::UrlRequest
, glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
  • RunRequestStatic() : glwebtools::UrlConnectionCore


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- s -

  • S_ERROR : glwebtools::UrlConnection , glwebtools::UrlRequest
  • S_IDLE : glwebtools::UrlRequest , glwebtools::UrlConnection
  • S_INITIAL : glwebtools::UrlRequest
  • S_INVALID : glwebtools::UrlConnection , glwebtools::UrlRequest
  • S_RUNNING : glwebtools::UrlConnection , glwebtools::UrlRequest
  • S_WAITING_TO_RUN : glwebtools::UrlConnection
  • SetData() : glwebtools::UrlRequest
  • SetHeaders() : glwebtools::UrlRequest
  • SetHTTPSUrl() : glwebtools::UrlRequest
  • SetHTTPUrl() : glwebtools::UrlRequest
  • SetMember() : glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
  • SetMethod() : glwebtools::UrlRequest
  • SetUrl() : glwebtools::UrlRequest
  • Shutdown() : glwebtools::GlWebTools
  • ShutdownInProgress() : glwebtools::GlWebTools
  • size() : glwebtools::JsonReader
  • StartRequest() : glwebtools::UrlConnection
  • State : glwebtools::UrlRequest , glwebtools::UrlConnection
  • SupportDataPacketQueue() : glwebtools::UrlConnection
  • SupportServerSideEvent() : glwebtools::UrlConnection


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- t -

  • Terminate() : glwebtools::GlWebTools
  • ToPrettyString() : glwebtools::JsonWriter
  • ToString()
: glwebtools::JsonReader
, glwebtools::AttributeFormatter
, glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
, glwebtools::JsonWriter
, glwebtools::JsonReader
, glwebtools::JsonWriter


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- u -

  • Update() : glwebtools::GlWebTools
  • UrlConnection() : glwebtools::UrlConnection
  • UrlRequest() : glwebtools::UrlRequest
  • UrlResponse() : glwebtools::UrlResponse


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- v -

  • Validator() : glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
  • Value() : glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >


GLWebTools: Class Members

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • m
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~
Here is a list of all documented class members with links to the class documentation for each member:

- w -

  • write() : glwebtools::JsonWriter


GLWebTools: Class Members - Enumerations

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • Method : glwebtools::UrlRequest
  • Protocol : glwebtools::UrlRequest
  • State : glwebtools::UrlConnection , glwebtools::UrlRequest


GLWebTools: Class Members - Enumerator

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • M_DELETE : glwebtools::UrlRequest
  • M_GET : glwebtools::UrlRequest
  • M_HEAD : glwebtools::UrlRequest
  • M_POST : glwebtools::UrlRequest
  • S_ERROR : glwebtools::UrlConnection , glwebtools::UrlRequest
  • S_IDLE : glwebtools::UrlRequest , glwebtools::UrlConnection
  • S_INITIAL : glwebtools::UrlRequest
  • S_INVALID : glwebtools::UrlRequest , glwebtools::UrlConnection
  • S_RUNNING : glwebtools::UrlConnection , glwebtools::UrlRequest
  • S_WAITING_TO_RUN : glwebtools::UrlConnection


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- a -

  • AddData() : glwebtools::UrlRequest
  • AddHeaders() : glwebtools::UrlRequest
  • AddTaskGroup()
: glwebtools::GlWebTools
, glwebtools::GlWebToolsCore
, glwebtools::GlWebTools
, glwebtools::GlWebToolsCore
  • allocate() : glwebtools::SAllocator< GLWEBTOOLS_T, Hint >
  • append() : glwebtools::JsonWriter
  • ArgumentWrapper() : glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- j -

  • JsonReader() : glwebtools::JsonReader
  • JsonWriter() : glwebtools::JsonWriter


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- n -

  • name() : glwebtools::JsonReader::Iterator


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- o -

  • OpenSSL() : glwebtools::OpenSSL
  • operator GLWEBTOOLS_T const &() : glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
  • operator!=() : glwebtools::JsonReader::Iterator
  • operator()()
: glwebtools::AttributeFormatter
, glwebtools::StringValidator
, glwebtools::SecureDataFormatter< FORMATTER >
, glwebtools::FloatFormatter< PRECISION >
, glwebtools::AttributeValidator
  • operator*() : glwebtools::JsonReader::Iterator
  • operator++() : glwebtools::JsonReader::Iterator
  • operator--() : glwebtools::JsonReader::Iterator
  • operator=()
: glwebtools::UrlConnection
, glwebtools::UrlRequest
, glwebtools::UrlResponse
, glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
, glwebtools::JsonReader::Iterator
, glwebtools::GlWebTools
  • operator==()
: glwebtools::JsonReader::Iterator
, glwebtools::AttributeFormatter
, glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
, glwebtools::SecureDataFormatter< FORMATTER >
, glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
, glwebtools::FloatFormatter< PRECISION >
  • operator[]() : glwebtools::JsonReader , glwebtools::JsonWriter


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- ~ -

  • ~Curl() : glwebtools::Curl
  • ~GlWebTools() : glwebtools::GlWebTools
  • ~GlWebToolsCore() : glwebtools::GlWebToolsCore
  • ~OpenSSL() : glwebtools::OpenSSL
  • ~UrlConnection() : glwebtools::UrlConnection
  • ~UrlConnectionCore() : glwebtools::UrlConnectionCore
  • ~UrlRequest() : glwebtools::UrlRequest
  • ~UrlResponse() : glwebtools::UrlResponse


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- b -

  • begin() : glwebtools::JsonReader
  • ByIndex() : glwebtools::JsonReader
  • ByName() : glwebtools::JsonReader


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- c -

  • CancelRequest() : glwebtools::UrlConnection
  • ClearData() : glwebtools::UrlRequest
  • ClearHeaders() : glwebtools::UrlRequest
  • construct() : glwebtools::SAllocator< GLWEBTOOLS_T, Hint >
  • CreateUrlConnection() : glwebtools::GlWebTools
  • CreateUrlRequest() : glwebtools::GlWebTools
  • CreationSettings()
: glwebtools::UrlConnection::CreationSettings
, glwebtools::ThreadPool::CreationSettings
, glwebtools::UrlConnection::CreationSettings
, glwebtools::GlWebTools::CreationSettings
  • Curl() : glwebtools::Curl


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- d -

  • deallocate() : glwebtools::SAllocator< GLWEBTOOLS_T, Hint >
  • DecodeBase64() : glwebtools::Codec
  • DecodeBase64Custom() : glwebtools::Codec
  • DecodeBlob() : glwebtools::Codec
  • DecodeUrl() : glwebtools::Codec
  • DecryptTEA() : glwebtools::Codec
  • DecryptXTEA() : glwebtools::Codec
  • DecryptXXTEA() : glwebtools::Codec
  • destroy() : glwebtools::SAllocator< GLWEBTOOLS_T, Hint >


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- e -

  • EncodeBase64() : glwebtools::Codec
  • EncodeBase64Custom() : glwebtools::Codec
  • EncodeBlob() : glwebtools::Codec
  • EncodeUrlRFC1738() : glwebtools::Codec
  • EncodeUrlRFC3986() : glwebtools::Codec
  • EncryptTEA() : glwebtools::Codec
  • EncryptXTEA() : glwebtools::Codec
  • EncryptXXTEA() : glwebtools::Codec
  • end() : glwebtools::JsonReader
  • exclude()
: glwebtools::JsonReader
, glwebtools::JsonWriter
, glwebtools::JsonReader
, glwebtools::JsonWriter
, glwebtools::JsonReader
, glwebtools::JsonWriter


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- f -

  • Formatter() : glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- g -

  • GenerateBase64CustomKey() : glwebtools::Codec
  • GenerateMD5() : glwebtools::Codec
  • GenerateSHA256() : glwebtools::Codec
  • GetCreationSettings()
: glwebtools::UrlConnection
, glwebtools::UrlRequest
  • GetData()
: glwebtools::UrlResponseCore
, glwebtools::UrlResponse
  • GetDataAsString()
: glwebtools::UrlResponse
, glwebtools::UrlResponseCore
  • GetDecodedBase64DataSize() : glwebtools::Codec
  • GetDecodedBlobDataSize() : glwebtools::Codec
  • GetDownloadedBytes() : glwebtools::UrlConnection
  • GetEncryptedTEADataSize() : glwebtools::Codec
  • GetEncryptedXTEADataSize() : glwebtools::Codec
  • GetEncryptedXXTEADataSize() : glwebtools::Codec
  • GetHeaderField()
: glwebtools::UrlResponse
, glwebtools::UrlResponseCore
  • GetLastError() : glwebtools::UrlConnection
  • GetMethod() : glwebtools::UrlRequest
  • GetOutputDebugString() : glwebtools::UrlConnection
  • GetResponseCode()
: glwebtools::UrlResponse
, glwebtools::UrlResponseCore
  • GetState()
: glwebtools::UrlRequest
, glwebtools::UrlConnection
  • GetUrlResponse() : glwebtools::UrlConnection
  • GlWebTools() : glwebtools::GlWebTools


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- h -

  • HasDataPacket() : glwebtools::UrlConnection
  • HasServerSideEvent() : glwebtools::UrlConnection


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- i -

  • include()
: glwebtools::JsonReader
, glwebtools::JsonWriter
, glwebtools::JsonReader
, glwebtools::JsonWriter
  • index() : glwebtools::JsonReader::Iterator
  • Initialize() : glwebtools::GlWebTools
  • insert() : glwebtools::JsonWriter
  • isArray()
: glwebtools::JsonReader
, glwebtools::JsonWriter
  • isBool()
: glwebtools::JsonReader
, glwebtools::JsonWriter
  • isDouble()
: glwebtools::JsonReader
, glwebtools::JsonWriter
  • IsError()
: glwebtools::UrlConnection
, glwebtools::UrlRequest
  • IsHandleValid()
: glwebtools::UrlConnection
, glwebtools::UrlRequest
, glwebtools::UrlResponse
  • IsHTTPError() : glwebtools::UrlResponse
  • IsInBase64Alphabet() : glwebtools::Codec
  • IsInitialized() : glwebtools::GlWebTools
  • IsInitialState() : glwebtools::UrlRequest
  • isInt()
: glwebtools::JsonReader
, glwebtools::JsonWriter
  • isObject()
: glwebtools::JsonReader
, glwebtools::JsonWriter
  • IsReadyToRun()
: glwebtools::UrlRequest
, glwebtools::UrlConnection
  • IsResponseReady() : glwebtools::UrlResponse
  • IsRunning()
: glwebtools::UrlConnection
, glwebtools::UrlRequest
  • isString()
: glwebtools::JsonWriter
, glwebtools::JsonReader
  • isUInt()
: glwebtools::JsonWriter
, glwebtools::JsonReader
  • IsValid()
: glwebtools::JsonWriter
, glwebtools::JsonReader
, glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
  • Iterator() : glwebtools::JsonReader::Iterator


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- p -

  • parse() : glwebtools::JsonReader
  • PopDataPacket() : glwebtools::UrlConnection
  • PopServerSideEvent() : glwebtools::UrlConnection


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- r -

  • Random() : glwebtools::Codec
  • read() : glwebtools::JsonReader
  • Release()
: glwebtools::GlWebTools
, glwebtools::UrlConnection
, glwebtools::UrlRequest
, glwebtools::UrlResponse
, glwebtools::GlWebTools
  • Reset()
: glwebtools::UrlRequest
, glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
  • RunRequestStatic() : glwebtools::UrlConnectionCore


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- s -

  • SetData() : glwebtools::UrlRequest
  • SetHeaders() : glwebtools::UrlRequest
  • SetHTTPSUrl() : glwebtools::UrlRequest
  • SetHTTPUrl() : glwebtools::UrlRequest
  • SetMember() : glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
  • SetMethod() : glwebtools::UrlRequest
  • SetUrl() : glwebtools::UrlRequest
  • Shutdown() : glwebtools::GlWebTools
  • ShutdownInProgress() : glwebtools::GlWebTools
  • size() : glwebtools::JsonReader
  • StartRequest() : glwebtools::UrlConnection
  • SupportDataPacketQueue() : glwebtools::UrlConnection
  • SupportServerSideEvent() : glwebtools::UrlConnection


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- t -

  • Terminate() : glwebtools::GlWebTools
  • ToPrettyString() : glwebtools::JsonWriter
  • ToString()
: glwebtools::JsonReader
, glwebtools::AttributeFormatter
, glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
, glwebtools::JsonWriter
, glwebtools::JsonReader
, glwebtools::JsonWriter


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- u -

  • Update() : glwebtools::GlWebTools
  • UrlConnection() : glwebtools::UrlConnection
  • UrlRequest() : glwebtools::UrlRequest
  • UrlResponse() : glwebtools::UrlResponse


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- v -

  • Validator() : glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >
  • Value() : glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >


GLWebTools: Class Members - Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • a
  • b
  • c
  • d
  • e
  • f
  • g
  • h
  • i
  • j
  • n
  • o
  • p
  • r
  • s
  • t
  • u
  • v
  • w
  • ~

- w -

  • write() : glwebtools::JsonWriter


GLWebTools: Class Members - Related Functions

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • operator<< : glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >


GLWebTools: Class Members - Variables

  • All
  • Functions
  • Variables
  • Enumerations
  • Enumerator
  • Related Functions
  • m

- m -

  • m_acceptEncoding : glwebtools::UrlConnection::CreationSettings
  • m_applicationIdentifier : glwebtools::GlWebTools::CreationSettings
  • m_applicationVersion : glwebtools::GlWebTools::CreationSettings
  • m_connectionHysteresis_ms : glwebtools::GlWebTools::CreationSettings
  • m_connectionMaxThreadCount : glwebtools::GlWebTools::CreationSettings
  • m_connectionMinThreadCount : glwebtools::GlWebTools::CreationSettings
  • m_connectionThreadPriority : glwebtools::GlWebTools::CreationSettings
  • m_connectTimeout : glwebtools::UrlConnection::CreationSettings
  • m_deviceIdentifier : glwebtools::GlWebTools::CreationSettings
  • m_enableAcceptEncoding : glwebtools::UrlConnection::CreationSettings
  • m_follow302 : glwebtools::UrlConnection::CreationSettings
  • m_hysteresis_ms : glwebtools::ThreadPool::CreationSettings
  • m_instanceName : glwebtools::GlWebTools::CreationSettings
  • m_isThreadedUpdate : glwebtools::GlWebTools::CreationSettings
  • m_maxConnections : glwebtools::UrlConnection::CreationSettings
  • m_maxThreadCount : glwebtools::ThreadPool::CreationSettings
  • m_maxThreadStartTime_ms : glwebtools::GlWebTools::CreationSettings , glwebtools::ThreadPool::CreationSettings
  • m_minThreadCount : glwebtools::ThreadPool::CreationSettings
  • m_osIdentifier : glwebtools::GlWebTools::CreationSettings
  • m_osVersion : glwebtools::GlWebTools::CreationSettings
  • m_peerCAFile : glwebtools::UrlConnection::CreationSettings
  • m_supportServerSideEvent : glwebtools::UrlConnection::CreationSettings
  • m_taskGroupId : glwebtools::UrlConnection::CreationSettings
  • m_taskStartTimeout : glwebtools::UrlConnection::CreationSettings
  • m_threadedUpdatePeriod : glwebtools::GlWebTools::CreationSettings
  • m_threadPriority : glwebtools::UrlConnection::CreationSettings , glwebtools::ThreadPool::CreationSettings
  • m_timeout : glwebtools::UrlConnection::CreationSettings
  • m_updateThreadPriority : glwebtools::GlWebTools::CreationSettings
  • m_useDataPacketQueue : glwebtools::UrlConnection::CreationSettings
  • m_userAgent : glwebtools::UrlConnection::CreationSettings


GLWebTools: glwebtools_algorithm.h Source File

  • File List
glwebtools_algorithm.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_ALGORITHM_INCLUDED_
00003 #define _GLWEBTOOLS_ALGORITHM_INCLUDED_
00004
00005 #include <glwebtools/glwebtools_error.h>
00006 #include <string>
00007
00008 namespace glwebtools
00009 {
00010         glwebtools::Error Find(const char** _begin, const char** _end, const std::string& name, bool& result);
00011
00012         template <typename GLWT_ITERATOR, typename GLWT_VALUE>
00013         glwebtools::Error Find(GLWT_ITERATOR _begin, GLWT_ITERATOR _end, GLWT_VALUE value, bool& result)
00014         {
00015                 if (_begin == 0)
00016                         return E_INVALID_PARAMETER;
00017
00018                 if (_end == 0)
00019                         return E_INVALID_PARAMETER;
00020
00021                 result = false;
00022
00023                 for (size_t* it = _begin; it != _end; ++it)
00024                 {
00025                         if ((*it) == value)
00026                         {
00027                                 result = true;
00028                                 return E_SUCCESS;
00029                         }
00030                 }
00031
00032                 return E_SUCCESS;
00033         }
00034
00035 }//glwebtools
00036
00037 #endif //_GLWEBTOOLS_ALGORITHM_INCLUDED_


GLWebTools: glwebtools_argumentwrapper.h Source File

  • File List
glwebtools_argumentwrapper.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_ARGUMENTWRAPPER_INCLUDED_
00003 #define _GLWEBTOOLS_ARGUMENTWRAPPER_INCLUDED_
00004
00005 #include <glwebtools/glwebtools_error.h>
00006 #include <glwebtools/serialization/glwebtools_typetraits.h>
00007 #include <glwebtools/serialization/glwebtools_attributeformatter.h>
00008 #include <glwebtools/serialization/glwebtools_attributevalidator.h>
00009 #include <ostream>
00010 #include <algorithm>
00011
00012 namespace glwebtools
00013 {
00014         template <typename GLWEBTOOLS_T>
00015         struct DefaultFormatter
00016         {
00017                 typedef AttributeFormatter type;
00018         };
00019 }
00020
00021 namespace glwebtools
00022 {
00024         template <typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
00025         struct ArgumentWrapper
00026         {
00027                 typedef GLWEBTOOLS_T value_type;
00028                 typedef ArgumentWrapper<GLWEBTOOLS_T, VALIDATOR, FORMATTER>* PointerType;
00029
00030         public:
00031                 template <typename GLWEBTOOLS_REF, typename GLWEBTOOLS_MEMBER>
00032                 struct Proxy;
00033
00034                 template <typename GLWEBTOOLS_REF, typename GLWEBTOOLS_MEMBER>
00035                 friend
00036                 struct Proxy;
00037
00038                 template <typename GLWEBTOOLS_REF, typename GLWEBTOOLS_MEMBER>
00039                 struct Proxy
00040                 {
00041                         GLWEBTOOLS_REF m_ref;
00042                         GLWEBTOOLS_MEMBER m_member;
00043
00044                         Proxy(GLWEBTOOLS_REF ref, GLWEBTOOLS_MEMBER member)
00045                                 :m_ref(ref), m_member(member)
00046                         {
00047                         }
00048
00049                         template <typename FIELD_T>
00050                         void operator=(FIELD_T value)
00051                         {
00052                                 m_ref->SetMember(m_member, value);
00053                         }
00054                 };
00055
00056         public:
00058                 ArgumentWrapper()
00059                 {
00060                 }
00061
00065                 ArgumentWrapper(const ArgumentWrapper& other)
00066                 {
00067                         assign(other);
00068                 }
00069
00075                 ArgumentWrapper(const GLWEBTOOLS_T& value, VALIDATOR validator, FORMATTER formatter)
00076                 {
00077                         assign(value);
00078                         m_validator = validator;
00079                         m_formatter = formatter;
00080                 }
00081
00086                 ArgumentWrapper(const GLWEBTOOLS_T& value, VALIDATOR validator)
00087                 {
00088                         assign(value);
00089                         m_validator = validator;
00090                 }
00091
00095                 ArgumentWrapper(const GLWEBTOOLS_T& value)
00096                 {
00097                         assign(value);
00098                 }
00099
00103                 ArgumentWrapper& operator=(const ArgumentWrapper& other)
00104                 {
00105                         assign(other);
00106                         return *this;
00107                 }
00108
00112                 ArgumentWrapper& operator=(const GLWEBTOOLS_T& value)
00113                 {
00114                         assign(value);
00115                         return *this;
00116                 }
00117
00122                 bool IsValid() const
00123                 {
00124                         return m_validator(m_value);
00125                 }
00126
00130                 void ToString(std::string& str) const
00131                 {
00132                         return m_formatter(str, m_value);
00133                 }
00134
00138                 std::string ToString() const
00139                 {
00140                         return m_formatter(m_value);
00141                 }
00142
00146                 operator GLWEBTOOLS_T const &() const
00147                 {
00148                         return m_value;
00149                 }
00150
00154                 const GLWEBTOOLS_T& Value() const
00155                 {
00156                         return m_value;
00157                 }
00158
00162                 const VALIDATOR& Validator() const
00163                 {
00164                         return m_validator;
00165                 }
00166
00170                 const FORMATTER& Formatter() const
00171                 {
00172                         return m_formatter;
00173                 }
00174
00180                 friend std::ostream& operator<<(std::ostream& os, const ArgumentWrapper& value)
00181                 {
00182                         os << value.ToString();
00183                         return os;
00184                 }
00185
00188                 bool operator==(const ArgumentWrapper& other) const
00189                 {
00190                         return m_value == other.m_value && m_validator == other.m_validator && m_formatter == other.m_formatter;
00191                 }
00192
00195                 bool operator==(const GLWEBTOOLS_T& other) const
00196                 {
00197                         return m_value == other;
00198                 }
00199
00204                 template <typename GLWEBTOOLS_U, typename FIELD_T, typename VALUE_T>
00205                 void SetMember(FIELD_T GLWEBTOOLS_U::*member, VALUE_T value)
00206                 {
00207                         m_value.*member = value;
00208                 }
00209
00213                 template <typename GLWEBTOOLS_MEMBER>
00214                 Proxy<PointerType, GLWEBTOOLS_MEMBER> SetMember(GLWEBTOOLS_MEMBER member)
00215                 {
00216                         return Proxy<PointerType, GLWEBTOOLS_MEMBER>(this, member);
00217                 }
00218
00219
00222                 void Reset()
00223                 {
00224                         m_value = GLWEBTOOLS_T();
00225                         m_validator = VALIDATOR();
00226                         m_formatter = FORMATTER();
00227                 }
00228
00229         public:
00230                 friend void swap(ArgumentWrapper& left, ArgumentWrapper& right)
00231                 {
00232                         using std::swap;
00233                         swap(left.m_value, right.m_value);
00234                         swap(left.m_validator, right.m_validator);
00235                         swap(left.m_formatter, right.m_formatter);
00236                 }
00237
00238         protected:
00239                 void assign(const GLWEBTOOLS_T& value)
00240                 {
00241                         m_value = value;
00242                 }
00243
00244                 void assign(const ArgumentWrapper& other)
00245                 {
00246                         m_value = other.m_value;
00247                         m_validator = other.m_validator;
00248                         m_formatter = other.m_formatter;
00249                 }
00250
00251         protected:
00252                 GLWEBTOOLS_T m_value;
00253
00254                 VALIDATOR m_validator;
00255                 FORMATTER m_formatter;
00256         };
00257 }
00258
00259 namespace glwebtools
00260 {
00261         template <typename GLWEBTOOLS_T, typename VALIDATOR, typename FORMATTER>
00262         ArgumentWrapper<GLWEBTOOLS_T, VALIDATOR, FORMATTER> Wrap(const GLWEBTOOLS_T& value, VALIDATOR validator, FORMATTER formatter)
00263         {
00264                 return ArgumentWrapper<GLWEBTOOLS_T, VALIDATOR, FORMATTER>(value, validator, formatter);
00265         }
00266
00267         template <typename GLWEBTOOLS_T, typename VALIDATOR>
00268         ArgumentWrapper<GLWEBTOOLS_T, VALIDATOR> Wrap(const GLWEBTOOLS_T& value, VALIDATOR validator)
00269         {
00270                 return ArgumentWrapper<GLWEBTOOLS_T, VALIDATOR>(value, validator);
00271         }
00272
00273         template <typename GLWEBTOOLS_T>
00274         ArgumentWrapper<GLWEBTOOLS_T> Wrap(const GLWEBTOOLS_T& value)
00275         {
00276                 return ArgumentWrapper<GLWEBTOOLS_T>(value);
00277         }
00278 }
00279
00280 namespace glwebtools
00281 {
00282         template <typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
00283         struct OptionalArgument : ArgumentWrapper<GLWEBTOOLS_T, VALIDATOR, FORMATTER>
00284         {
00285                 typedef ArgumentWrapper<GLWEBTOOLS_T, VALIDATOR, FORMATTER> BaseType;
00286                 typedef OptionalArgument<GLWEBTOOLS_T, VALIDATOR, FORMATTER>* PointerType;
00287
00288         public:
00289                 template <typename GLWEBTOOLS_REF, typename GLWEBTOOLS_MEMBER>
00290                 struct Proxy;
00291
00292                 template <typename GLWEBTOOLS_REF, typename GLWEBTOOLS_MEMBER>
00293                 friend
00294                 struct Proxy;
00295
00296                 template <typename GLWEBTOOLS_REF, typename GLWEBTOOLS_MEMBER>
00297                 struct Proxy
00298                 {
00299                         GLWEBTOOLS_REF m_ref;
00300                         GLWEBTOOLS_MEMBER m_member;
00301
00302                         Proxy(GLWEBTOOLS_REF ref, GLWEBTOOLS_MEMBER member)
00303                                 :m_ref(ref), m_member(member)
00304                         {
00305                         }
00306
00307                         template <typename FIELD_T>
00308                         void operator=(FIELD_T value)
00309                         {
00310                                 m_ref->SetMember(m_member, value);
00311                         }
00312                 };
00313
00314         public:
00316                 OptionalArgument()
00317                         :BaseType(), m_set(false)
00318                 {
00319                 }
00320
00324                 OptionalArgument(const OptionalArgument& other)
00325                 {
00326                         assign(other);
00327                 }
00328
00332                 OptionalArgument(const GLWEBTOOLS_T& value)
00333                         :BaseType(value), m_set(true)
00334                 {
00335                 }
00336
00340                 OptionalArgument& operator=(const OptionalArgument& other)
00341                 {
00342                         assign(other);
00343                         return *this;
00344                 }
00345
00349                 OptionalArgument& operator=(const GLWEBTOOLS_T& value)
00350                 {
00351                         assign(value);
00352                         return *this;
00353                 }
00354
00358                 operator GLWEBTOOLS_T const &() const
00359                 {
00360                         return this->m_value;
00361                 }
00362
00367                 bool IsSet() const
00368                 {
00369                         return m_set;
00370                 }
00371
00376                 bool IsValid() const
00377                 {
00378                         return m_set ? BaseType::IsValid() : true;
00379                 }
00380
00386                 friend std::ostream& operator<<(std::ostream& os, const OptionalArgument& value)
00387                 {
00388                         if (value.IsSet())
00389                                 os << value.ToString();
00390
00391                         return os;
00392                 }
00393
00396                 bool operator==(const OptionalArgument& other) const
00397                 {
00398                         return this->m_value == other.m_value && this->m_set == other.m_set && this->m_validator == other.m_validator && this->m_formatter == other.m_formatter;
00399                 }
00400
00403                 bool operator==(const GLWEBTOOLS_T& other) const
00404                 {
00405                         return this->m_value == other;
00406                 }
00407
00412                 template <typename GLWEBTOOLS_U, typename FIELD_T, typename VALUE_T>
00413                 void SetMember(FIELD_T GLWEBTOOLS_U::*member, VALUE_T value)
00414                 {
00415                         this->m_value.*member = value;
00416                         m_set = true;
00417                 }
00418
00423                 template <typename GLWEBTOOLS_MEMBER>
00424                 Proxy<PointerType, GLWEBTOOLS_MEMBER> SetMember(GLWEBTOOLS_MEMBER member)
00425                 {
00426                         return Proxy<PointerType, GLWEBTOOLS_MEMBER>(this, member);
00427                 }
00428
00431                 void Reset()
00432                 {
00433                         BaseType::Reset();
00434                         m_set = false;
00435                 }
00436
00439                 void Unset()
00440                 {
00441                         m_set = false;
00442                 }
00443
00444         public:
00445                 friend void swap(OptionalArgument& left, OptionalArgument& right)
00446                 {
00447                         using std::swap;
00448                         swap(left.m_value, right.m_value);
00449                         swap(left.m_validator, right.m_validator);
00450                         swap(left.m_formatter, right.m_formatter);
00451                         swap(left.m_set, right.m_set);
00452                 }
00453
00454         protected:
00455                 void assign(const GLWEBTOOLS_T& value)
00456                 {
00457                         BaseType::assign(value);
00458                         m_set = true;
00459                 }
00460
00461                 void assign(const OptionalArgument& other)
00462                 {
00463                         BaseType::assign(other);
00464                         m_set = other.m_set;
00465                 }
00466
00467         protected:
00468                 bool m_set;
00469         };
00470 }
00471
00472 namespace glwebtools
00473 {
00474         template <typename GLWEBTOOLS_T, typename VALIDATOR = AttributeValidator, typename FORMATTER = typename DefaultFormatter<GLWEBTOOLS_T>::type>
00475         struct RequiredArgument : ArgumentWrapper<GLWEBTOOLS_T, VALIDATOR, FORMATTER>
00476         {
00477                 typedef ArgumentWrapper<GLWEBTOOLS_T, VALIDATOR, FORMATTER> BaseType;
00478                 typedef ArgumentWrapper<GLWEBTOOLS_T, VALIDATOR, FORMATTER>* PointerType;
00479
00480         public:
00481                 template <typename GLWEBTOOLS_REF, typename GLWEBTOOLS_MEMBER>
00482                 struct Proxy;
00483
00484                 template <typename GLWEBTOOLS_REF, typename GLWEBTOOLS_MEMBER>
00485                 friend
00486                 struct Proxy;
00487
00488                 template <typename GLWEBTOOLS_REF, typename GLWEBTOOLS_MEMBER>
00489                 struct Proxy
00490                 {
00491                         GLWEBTOOLS_REF m_ref;
00492                         GLWEBTOOLS_MEMBER m_member;
00493
00494                         Proxy(GLWEBTOOLS_REF ref, GLWEBTOOLS_MEMBER member)
00495                                 :m_ref(ref), m_member(member)
00496                         {
00497                         }
00498
00499                         template <typename FIELD_T>
00500                         void operator=(FIELD_T value)
00501                         {
00502                                 m_ref->SetMember(m_member, value);
00503                         }
00504                 };
00505
00506         public:
00507
00509                 RequiredArgument()
00510                         :BaseType(), m_set(false)
00511                 {
00512                 }
00513
00517                 RequiredArgument(const RequiredArgument& other)
00518                 {
00519                         assign(other);
00520                 }
00521
00525                 RequiredArgument(const GLWEBTOOLS_T& value)
00526                         :BaseType(), m_set(true)
00527                 {
00528                 }
00529
00533                 RequiredArgument& operator=(const RequiredArgument& other)
00534                 {
00535                         assign(other);
00536                         return *this;
00537                 }
00538
00542                 RequiredArgument& operator=(const GLWEBTOOLS_T& value)
00543                 {
00544                         assign(value);
00545                         return *this;
00546                 }
00547
00551                 operator GLWEBTOOLS_T const &() const
00552                 {
00553                         return this->m_value;
00554                 }
00555
00560                 bool IsSet() const
00561                 {
00562                         return m_set;
00563                 }
00564
00569                 bool IsValid() const
00570                 {
00571                         return m_set ? BaseType::IsValid() : false;
00572                 }
00573
00579                 friend std::ostream& operator<<(std::ostream& os, const RequiredArgument& value)
00580                 {
00581                         if (value.IsSet())
00582                                 os << value.ToString();
00583
00584                         return os;
00585                 }
00586
00589                 bool operator==(const RequiredArgument& other) const
00590                 {
00591                         return this->m_value == other.m_value && this->m_set == other.m_set && this->m_validator == other.m_validator && this->m_formatter == other.m_formatter;
00592                 }
00593
00596                 bool operator==(const GLWEBTOOLS_T& other) const
00597                 {
00598                         return this->m_value == other;
00599                 }
00600
00605                 template <typename GLWEBTOOLS_U, typename FIELD_T, typename VALUE_T>
00606                 void SetMember(FIELD_T GLWEBTOOLS_U::*member, VALUE_T value)
00607                 {
00608                         this->m_value.*member = value;
00609                         m_set = true;
00610                 }
00611
00616                 template <typename GLWEBTOOLS_MEMBER>
00617                 Proxy<PointerType, GLWEBTOOLS_MEMBER> SetMember(GLWEBTOOLS_MEMBER member)
00618                 {
00619                         return Proxy<PointerType, GLWEBTOOLS_MEMBER>(this, member);
00620                 }
00621
00624                 void Reset()
00625                 {
00626                         BaseType::Reset();
00627                         m_set = false;
00628                 }
00629
00632                 void Unset()
00633                 {
00634                         m_set = false;
00635                 }
00636
00637         public:
00638                 friend void swap(RequiredArgument& left, RequiredArgument& right)
00639                 {
00640                         using std::swap;
00641                         swap(left.m_value, right.m_value);
00642                         swap(left.m_validator, right.m_validator);
00643                         swap(left.m_formatter, right.m_formatter);
00644                         swap(left.m_set, right.m_set);
00645                 }
00646         protected:
00647                 void assign(const GLWEBTOOLS_T& value)
00648                 {
00649                         BaseType::assign(value);
00650                         m_set = true;
00651                 }
00652
00653                 void assign(const RequiredArgument& other)
00654                 {
00655                         BaseType::assign(other);
00656                         m_set = other.m_set;
00657                 }
00658
00659         protected:
00660                 bool m_set;
00661         };
00662 }
00663
00664 namespace glwebtools
00665 {
00667         template <typename GLWEBTOOLS_T>
00668         struct IsArgumentWrapped : glwebtools::FalseType
00669         {
00670         };
00671
00672         template <typename GLWEBTOOLS_T, typename VALIDATOR, typename FORMATTER>
00673         struct IsArgumentWrapped<ArgumentWrapper<GLWEBTOOLS_T, VALIDATOR, FORMATTER> > : glwebtools::TrueType
00674         {
00675         };
00676
00677         template <typename GLWEBTOOLS_T, typename VALIDATOR, typename FORMATTER>
00678         struct IsArgumentWrapped<OptionalArgument<GLWEBTOOLS_T, VALIDATOR, FORMATTER> > : glwebtools::TrueType
00679         {
00680         };
00681
00682         template <typename GLWEBTOOLS_T, typename VALIDATOR, typename FORMATTER>
00683         struct IsArgumentWrapped<RequiredArgument<GLWEBTOOLS_T, VALIDATOR, FORMATTER> > : glwebtools::TrueType
00684         {
00685         };
00686 }
00687
00688 namespace glwebtools
00689 {
00691         template <typename GLWEBTOOLS_T>
00692         struct IsArgumentRequired : glwebtools::FalseType
00693         {
00694         };
00695
00696         template <typename GLWEBTOOLS_T, typename VALIDATOR, typename FORMATTER>
00697         struct IsArgumentRequired<RequiredArgument<GLWEBTOOLS_T, VALIDATOR, FORMATTER> > : glwebtools::TrueType
00698         {
00699         };
00700 }
00701
00702 namespace glwebtools
00703 {
00705         template <typename GLWEBTOOLS_T>
00706         struct IsArgumentOptional : glwebtools::FalseType
00707         {
00708         };
00709
00710         template <typename GLWEBTOOLS_T, typename VALIDATOR, typename FORMATTER>
00711         struct IsArgumentOptional<OptionalArgument<GLWEBTOOLS_T, VALIDATOR, FORMATTER> > : glwebtools::TrueType
00712         {
00713         };
00714 }//federation
00715
00716 #endif // _GLWEBTOOLS_ARGUMENTWRAPPER_INCLUDED_


GLWebTools: glwebtools_atomic.h Source File

  • File List
glwebtools_atomic.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_ATOMIC_INCLUDED_
00003 #define _GLWEBTOOLS_ATOMIC_INCLUDED_
00004
00005 #include <glwebtools/internal/glwebtools_common.h>
00006
00007 #if GLWEBTOOLS_USE_GLF_ATOMIC && !GLWEBTOOLS_USE_STD_ATOMIC
00008         #include <glf/core/atomic.h>
00009 #elif GLWEBTOOLS_USE_STD_ATOMIC && !GLWEBTOOLS_USE_GLF_ATOMIC
00010         #include <atomic>
00011 #else
00012         #error One of either GLWEBTOOLS_USE_GLF_ATOMIC or GLWEBTOOLS_USE_STD_ATOMIC must be defined.
00013 #endif
00014
00015
00016 namespace glwebtools
00017 {
00018
00019 template <typename T>
00020 class Atomic
00021 {
00022 public:
00023         Atomic()
00024         {       }
00025         Atomic(const T& value) : m_handler(value)
00026         {       }
00027         virtual ~Atomic()
00028         {       }
00029         T operator++()  // TODO: can't return T&, as m_handler.operator++() returns T
00030         {
00031                 return m_handler.operator++();
00032         }
00033         const T operator++(int i)
00034         {
00035                 return m_handler.operator++(i);
00036         }
00037         T operator--()  // TODO: can't return T&, as m_handler.operator++() returns T
00038         {
00039                 return m_handler.operator--();
00040         }
00041         const T operator--(int i)
00042         {
00043                 return m_handler.operator--(i);
00044         }
00045         operator T() const
00046         {
00047                 return T(m_handler);
00048         }
00049         T operator=(const T& value)
00050         {
00051                 return m_handler = value;
00052         }
00053
00054 private:
00055
00056 #if GLWEBTOOLS_USE_GLF_ATOMIC
00057         glf::Atomic<T> m_handler;
00058 #endif
00059
00060 #if GLWEBTOOLS_USE_STD_ATOMIC
00061         std::atomic<T> m_handler;
00062 #endif
00063
00064 }; // Atomic
00065
00066 } // glwebtools
00067 #endif // _GLWEBTOOLS_ATOMIC_INCLUDED_


GLWebTools: glwebtools_attributeformatter.h Source File

  • File List
glwebtools_attributeformatter.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_ATTRIBUTEFORMATTER_INCLUDED_
00003 #define _GLWEBTOOLS_ATTRIBUTEFORMATTER_INCLUDED_
00004
00005 #include <string>
00006 #include <vector>
00007 #include <list>
00008
00009 #include <glwebtools/serialization/glwebtools_typetraits.h>
00010
00011 namespace glwebtools
00012 {
00014         template <typename GLWEBTOOLS_T>
00015         struct IsList : glwebtools::FalseType
00016         {
00017         };
00018
00019         template <class GLWEBTOOLS_T, class Allocator>
00020         struct IsList<std::vector<GLWEBTOOLS_T, Allocator> > : glwebtools::TrueType
00021         {
00022         };
00023
00024         template <class GLWEBTOOLS_T, class Allocator>
00025         struct IsList<std::list<GLWEBTOOLS_T, Allocator> > : glwebtools::TrueType
00026         {
00027         };
00028
00030         template <typename GLWEBTOOLS_T>
00031         struct IsRange : glwebtools::FalseType
00032         {
00033         };
00034
00036
00038         class AttributeFormatter
00039         {
00040         public:
00045                 template <typename VALUE>
00046                 std::string operator()(VALUE value) const
00047                 {
00048                         return ListToString(value);
00049                 }
00050
00053                 bool operator==(const AttributeFormatter&) const
00054                 {
00055                         return true;
00056                 }
00057
00058         public:
00063                 static std::string ToString(bool value);
00064
00069                 static std::string ToString(int value);
00070
00075                 static std::string ToString(unsigned int value);
00076
00081                 static std::string ToString(long long value);
00082
00088                 static std::string ToString(float value, int precision=2);
00089
00095                 static std::string ToString(double value, int precision=2);
00096
00101                 static std::string ToString(const char* value)
00102                 {
00103                         return value;
00104                 }
00105
00110                 static std::string ToString(const std::string& value)
00111                 {
00112                         return value;
00113                 }
00114
00115                 template <typename VALUE>
00116                 static std::string ToString(VALUE value)
00117                 {
00118                         Assert("Cannot format unknown type.");
00119                         return "Error: Cannot format unknown type.";
00120                 }
00121
00122         protected:
00123                 static void Assert(const std::string& message);
00124
00125
00126         protected:
00127                 template <typename VALUE>
00128                 static std::string ListToString(VALUE value)
00129                 {
00130                         typename IsList<VALUE>::type islist;
00131                         return ListToString(value, islist);
00132                 }
00133
00134                 template <typename VALUE>
00135                 static std::string ListToString(VALUE value, /*IsList*/glwebtools::FalseType)
00136                 {
00137                         typename IsRange<VALUE>::type isrange;
00138                         return RangeToString(value, isrange);
00139                 }
00140
00141                 template <typename VALUE>
00142                 static std::string ListToString(VALUE value, /*IsList*/glwebtools::TrueType)
00143                 {
00144                         std::string str;
00145
00146                         typedef typename VALUE::iterator iterator;
00147                         for (iterator it = value.begin(); it != value.end(); ++it)
00148                         {
00149                                 if (it != value.begin())
00150                                         str+=",";
00151
00152                                 str += ListToString(*it);
00153                         }
00154
00155                         return str;
00156                 }
00157
00158                 template <typename VALUE>
00159                 static std::string RangeToString(VALUE value, /*IsRange*/glwebtools::FalseType)
00160                 {
00161                         return ToString(value);
00162                 }
00163
00164                 template <typename VALUE>
00165                 static std::string RangeToString(VALUE value, /*IsRange*/glwebtools::TrueType)
00166                 {
00167                         return ToString(value.getMinValue())+"-"+ToString(value.getMaxValue());
00168                 }
00169         };
00170
00172
00174         template <int PRECISION>
00175         class FloatFormatter
00176         {
00177         public:
00182                 std::string operator()(float value) const
00183                 {
00184                         return m_formatter.ToString(value, PRECISION);
00185                 }
00186
00191                 std::string operator()(double value) const
00192                 {
00193                         return m_formatter.ToString(value, PRECISION);
00194                 }
00195
00198                 bool operator==(const FloatFormatter<PRECISION>&) const
00199                 {
00200                         return true;
00201                 }
00202         private:
00203                 AttributeFormatter m_formatter;
00204         };
00205 }// glwebtools
00206
00207 #endif // _GLWEBTOOLS_ATTRIBUTEFORMATTER_INCLUDED_
00208


GLWebTools: glwebtools_attributevalidator.h Source File

  • File List
glwebtools_attributevalidator.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_ATTRIBUTEVALIDATOR_INCLUDED_
00003 #define _GLWEBTOOLS_ATTRIBUTEVALIDATOR_INCLUDED_
00004
00005 #include <string>
00006
00007 namespace glwebtools
00008 {
00009         template <typename GLWEBTOOLS_T>
00010         struct BaseValidator
00011         {
00014                 bool operator==(const GLWEBTOOLS_T& ) const
00015                 {
00016                         return true;
00017                 }
00018         };
00019
00021
00023         struct AttributeValidator : BaseValidator<AttributeValidator>
00024         {
00030                 template <typename VALUE>
00031                 bool operator()(VALUE value) const
00032                 {
00033                         return true;
00034                 }
00035         };
00036
00038
00040         struct StringValidator : BaseValidator<AttributeValidator>
00041         {
00047                 bool operator()(const std::string& value) const
00048                 {
00049                         return value.empty() == false;
00050                 }
00051         };
00052 }// glwebtools
00053
00054 #endif // _GLWEBTOOLS_ATTRIBUTEVALIDATOR_INCLUDED_


GLWebTools: glwebtools_codec.h Source File

  • File List
glwebtools_codec.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_CODEC_INCLUDED_
00003 #define _GLWEBTOOLS_CODEC_INCLUDED_
00004
00005 #include <glwebtools/internal/glwebtools_types.h>
00006
00007 namespace glwebtools
00008 {
00009
00011 class Codec
00012 {
00013 public:
00014         enum MaxLineLength
00015         {
00016                 none = 0,
00017                 PEM = 64,
00018                 MIME = 76
00019         };
00020
00021 public:
00023
00030         static bool EncodeBase64(const unsigned char* src, size_t dataSize, glwebtools::String& dest, MaxLineLength maxLineLength=none);
00031
00033
00040         static bool EncodeBase64(const unsigned char* src, size_t dataSize, glwebtools::String& dest, size_t maxLineLength);
00041
00043
00050         static size_t DecodeBase64(const char* base64Data, size_t dataSize, void* outData, bool strict=false);
00051
00053
00059         static size_t DecodeBase64(const glwebtools::String& base64Data, void* outData, bool strict=false);
00060
00062
00066         static bool IsInBase64Alphabet(char data);
00067
00069
00074         static size_t GetDecodedBase64DataSize(const glwebtools::String& base64Data, bool strict=false);
00075
00077
00084         static bool EncodeBase64Custom(const unsigned char* src, size_t dataSize, glwebtools::String& dest, const char* customkey);
00085
00087
00094         static size_t DecodeBase64Custom(const char* base64Data, size_t dataSize, void* outData, const char* customkey);
00095
00097
00103         static size_t DecodeBase64Custom(const glwebtools::String& base64Data, void* outData, const char* customkey);
00104
00106
00109         static void GenerateBase64CustomKey(char* key);
00110
00112
00117         static void GenerateBase64CustomKey(char* key, unsigned int seed1, unsigned int seed2);
00118
00120
00126         static bool EncodeBlob(const unsigned char* src, size_t dataSize, glwebtools::String& dest);
00127
00129
00134         static size_t DecodeBlob(const glwebtools::String& blobbedData, void* outData);
00135
00137
00141         static size_t GetDecodedBlobDataSize(const glwebtools::String& blobbedData);
00142
00144
00149         static bool EncodeUrlRFC1738(const glwebtools::String& source, glwebtools::String& dest);
00150
00152
00157         static bool EncodeUrlRFC3986(const glwebtools::String& source, glwebtools::String& dest);
00158
00160
00165         static bool DecodeUrl(const glwebtools::String& source, glwebtools::String& dest);
00166
00168
00174         static bool GenerateMD5(const void* data, size_t size, char* dest); //dest need to be 32 characters or more
00175
00177
00183         static bool GenerateSHA256(const void* data, size_t size, char* dest); //dest need to be 64 characters or more
00184
00186
00195         static bool EncryptTEA(const void* indata, size_t indataSize, void* outData, size_t outdataSize, const unsigned int* key);
00196
00198
00207         static bool DecryptTEA(const void* indata, size_t indataSize, void* outData, size_t outdataSize, const unsigned int* key);
00209
00213         static size_t GetEncryptedTEADataSize(size_t inDataSize);
00214
00216
00225         static bool EncryptXTEA(const void* indata, size_t indataSize, void* outData, size_t outdataSize, const unsigned int* key);
00227
00236         static bool DecryptXTEA(const void* indata, size_t indataSize, void* outData, size_t outdataSize, const unsigned int* key);
00238
00242         static size_t GetEncryptedXTEADataSize(size_t inDataSize);
00243
00245
00254         static bool EncryptXXTEA(const void* indata, size_t indataSize, void* outData, size_t outdataSize, const unsigned int* key);
00256
00265         static bool DecryptXXTEA(const void* indata, size_t indataSize, void* outData, size_t outdataSize, const unsigned int* key);
00267
00271         static size_t GetEncryptedXXTEADataSize(size_t inDataSize);
00272
00274
00279         static unsigned int Random(unsigned int& seed1, unsigned int& seed2);
00280
00281 private:
00282         static char SSEncDec_GetKeyFromChar(char nChar);
00283         static char Dec64_GetKeyFromChar(char nChar);
00284         static void EncUrl_GetKeysFromChar(char nChar, char& hex1, char& hex2);
00285         static char EncUrl_GetCharFromKeys(const char str[2]);
00286 };
00287
00288 }
00289 #endif //_GLWEBTOOLS_CODEC_INCLUDED_


GLWebTools: glwebtools_common.h Source File

  • File List
glwebtools_common.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_COMMON_INCLUDED_
00003 #define _GLWEBTOOLS_COMMON_INCLUDED_
00004
00005 namespace glwebtools
00006 {
00007
00008 class NonCopyable
00009 {
00010 protected:
00011     NonCopyable() {}
00012     virtual ~NonCopyable() {}
00013 private:
00014     NonCopyable(const NonCopyable& rhs);
00015     const NonCopyable& operator=(const NonCopyable& rhs);
00016 };
00017
00018 class Managed : public NonCopyable
00019 {
00020 public:
00021         Managed():m_refCount(0){}
00022         virtual ~Managed(){}
00023         virtual bool CanDelete() const = 0;
00024         virtual unsigned int Grab(){ return ++m_refCount;}
00025         virtual unsigned int Drop(){return ((m_refCount > 0) ?  --m_refCount : m_refCount);}
00026
00027 protected:
00028         int m_refCount;
00029 };
00030
00031 #if defined(_WIN32)
00032 #define GLWEBTOOLS_STRNCASECMP(GLWEBTOOLS_X1, GLWEBTOOLS_X2, GLWEBTOOLS_N) _strnicmp(GLWEBTOOLS_X1, GLWEBTOOLS_X2, GLWEBTOOLS_N)
00033 #elif defined(__APPLE__) || defined(ANDROID) || defined(__linux__)
00034 #define GLWEBTOOLS_STRNCASECMP(GLWEBTOOLS_X1, GLWEBTOOLS_X2, GLWEBTOOLS_N) strncasecmp(GLWEBTOOLS_X1, GLWEBTOOLS_X2, GLWEBTOOLS_N)
00035 #else
00036 #define GLWEBTOOLS_STRNCASECMP(GLWEBTOOLS_X1, GLWEBTOOLS_X2, GLWEBTOOLS_N) -1
00037 #endif
00038
00039 #if defined(_WIN32)
00040 #define GLWEBTOOLS_STRCASECMP(GLWEBTOOLS_X1, GLWEBTOOLS_X2) _stricmp(GLWEBTOOLS_X1, GLWEBTOOLS_X2)
00041 #elif defined(__APPLE__) || defined(ANDROID) || defined(__linux__)
00042 #define GLWEBTOOLS_STRCASECMP(GLWEBTOOLS_X1, GLWEBTOOLS_X2) strcasecmp(GLWEBTOOLS_X1, GLWEBTOOLS_X2)
00043 #else
00044 #define GLWEBTOOLS_STRCASECMP(GLWEBTOOLS_X1, GLWEBTOOLS_X2) -1
00045 #endif
00046
00047 typedef int Error;
00048
00049 bool IsOperationSuccess(glwebtools::Error code);
00050
00051 #define GLWEBTOOLS_SUCCESS(X) (glwebtools::IsOperationSuccess(X))
00052 #define GLWEBTOOLS_FAIL(X)      (!glwebtools::IsOperationSuccess(X))
00053
00054 #define GLWEBTOOLS_RETURN_ERROR_ON_FAIL(X) {glwebtools::Error err = X; if(GLWEBTOOLS_FAIL(err)){return err;}}
00055
00056 // define int 64 bits and unsigned int 64 bits
00057 #if defined(_WIN32)
00058         typedef __int64 i64;
00059         typedef unsigned __int64 u64;
00060 #elif defined(__APPLE__) || defined(ANDROID) || defined(__linux__)
00061 //#include <stdint.h>
00062 //      typedef int64_t i64;
00063 //      typedef uint64_t u64;
00064         typedef long long i64;
00065         typedef unsigned long long u64;
00066 #else
00067         typedef long long i64;
00068         typedef unsigned long long u64;
00069 #endif
00070
00071 }
00072
00073 #endif //_GLWEBTOOLS_COMMON_INCLUDED_


GLWebTools: glwebtools_condition.h Source File

  • File List
glwebtools_condition.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_CONDITION_INCLUDED_
00003 #define _GLWEBTOOLS_CONDITION_INCLUDED_
00004
00005 #include <glwebtools/internal/glwebtools_common.h>
00006
00007 namespace glwebtools
00008 {
00009         class Mutex;
00010
00011         class Condition : public NonCopyable
00012         {
00013         public:
00014                 Condition(Mutex& mutex);
00015                 ~Condition();
00016
00020                 glwebtools::Error Signal();
00021
00027                 glwebtools::Error Broadcast();
00028
00029
00031                 glwebtools::Error Wait(unsigned int time = 0);
00032
00033         private:
00034                 void* m_handler;
00035         };
00036
00037 }//namespace glwebtools
00038
00039 #endif //_GLWEBTOOLS_CONDITION_INCLUDED_


GLWebTools: glwebtools_console.h Source File

  • File List
glwebtools_console.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_CONSOLE_INCLUDED_
00003
00004 #include <stdarg.h>
00005
00006 #define GLWEBTOOLS_LOG_LEVEL_NULL    0
00007 #define GLWEBTOOLS_LOG_LEVEL_FATAL   1
00008 #define GLWEBTOOLS_LOG_LEVEL_MAJOR   2
00009 #define GLWEBTOOLS_LOG_LEVEL_MINOR   3
00010 #define GLWEBTOOLS_LOG_LEVEL_INFO    4
00011 #define GLWEBTOOLS_LOG_LEVEL_VERBOSE 5
00012
00013 namespace glwebtools
00014 {
00015 class Console;
00016
00017 class ConsoleImplInterface
00018 {
00019 public:
00020         virtual ~ConsoleImplInterface(){}
00021
00022         virtual void Print(unsigned int level, const char* format, va_list arguments)=0;
00023
00024 protected:
00025         static unsigned int s_logLevel;
00026
00027         friend class glwebtools::Console;
00028 };
00029
00030 class Console
00031 {
00032 public:
00033         static void SetConsoleImpl(ConsoleImplInterface* externalConsole);
00034
00035         static void SetLogLevel(unsigned int level);
00036         static void Print(unsigned int level, const char* format, ...);
00037
00038 private:
00039         Console(); //Hide so nobody can call
00040         ~Console();
00041
00042         static void _Print(unsigned int level, const char* format, va_list arguments);
00043
00044         static ConsoleImplInterface* s_impl;
00045         static Console* s_instance;
00046 };
00047 }
00048 #endif


GLWebTools: glwebtools_curl.h Source File

  • File List
glwebtools_curl.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_CURL_INCLUDED_
00003 #define _GLWEBTOOLS_CURL_INCLUDED_
00004
00006 namespace glwebtools
00007 {
00009
00018         class Curl
00019         {
00020         public:
00022                 Curl();
00024                 ~Curl();
00025
00026                 bool IsInitialized() const;
00027
00028         };//class Curl
00029 }//namespace glwebtools
00030
00031 #endif //_GLWEBTOOLS_CURL_INCLUDED_


GLWebTools: glwebtools_customattribute.h Source File

  • File List
glwebtools_customattribute.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_CUSTOMATTRIBUTE_INCLUDED_
00003 #define _GLWEBTOOLS_CUSTOMATTRIBUTE_INCLUDED_
00004
00005 #include <set>
00006 #include <functional>
00007 #include <ostream>
00008
00009 #include <glwebtools/internal/glwebtools_memory.h>
00010 #include <glwebtools/serialization/glwebtools_argumentwrapper.h>
00011 #include <glwebtools/glwebtools_error.h>
00012 #include <glwebtools/internal/glwebtools_common.h>
00013 #include <glwebtools/tool/glwebtools_securedata.h>
00014
00015 namespace glwebtools
00016 {
00017         struct JSONValue;
00018
00019         class CustomArgument
00020         {
00021         public:
00022                 CustomArgument();
00023                 CustomArgument(const CustomArgument& other);
00024
00025                 /*explicit*/ CustomArgument(const std::string& value);
00026                 /*explicit*/ CustomArgument(const char* value);
00027                 /*explicit*/ CustomArgument(const JSONValue& value);
00028
00029                 template <typename VALUE, typename FORMATTER>
00030                 CustomArgument(VALUE value, FORMATTER formatter)
00031                 {
00032                         SetType(value);
00033                         m_value = formatter(value);
00034                 }
00035
00036                 template <typename VALUE>
00037                 /*explicit*/ CustomArgument(VALUE value)
00038                 {
00039                         SetType(value);
00040                         AttributeFormatter formatter;
00041                         m_value = formatter(value);
00042                 }
00043
00044         public:
00045                 CustomArgument& operator=(const CustomArgument& other);
00046
00047         public:
00048                 bool operator==(const CustomArgument& other)const;
00049
00050
00051         public:
00052                 const std::string& ToString() const;
00053                 int ToInt() const;
00054                 unsigned int ToUInt() const;
00055                 float ToFloat() const;
00056                 double ToDouble() const;
00057                 bool ToBool() const;
00058
00059         public:
00060                 glwebtools::Error ToString(std::string& value) const;
00061                 glwebtools::Error ToString(SecureString& value) const;
00062                 glwebtools::Error ToInt(int& value) const;
00063                 glwebtools::Error ToUInt(unsigned int& value) const;
00064                 glwebtools::Error ToFloat(float& value) const;
00065                 glwebtools::Error ToDouble(double& value) const;
00066                 glwebtools::Error ToBool(bool& value) const;
00067
00068         public:
00069                 glwebtools::Error operator>>(std::string& value) const;
00070                 glwebtools::Error operator>>(SecureString& value) const;
00071                 glwebtools::Error operator>>(int& value) const;
00072                 glwebtools::Error operator>>(unsigned int& value) const;
00073                 glwebtools::Error operator>>(float& value) const;
00074                 glwebtools::Error operator>>(double& value) const;
00075                 glwebtools::Error operator>>(bool& value) const;
00076
00077         public:
00078                 template <typename VALUE, typename VALIDATOR, typename FORMATTER>
00079                 glwebtools::Error operator>>(OptionalArgument<VALUE, VALIDATOR, FORMATTER>& value) const
00080                 {
00081                         VALUE inner_value;
00082                         GLWEBTOOLS_RETURN_ERROR_ON_FAIL((*this) >> inner_value);
00083                         value = inner_value;
00084
00085                         return value.IsValid() ? E_SUCCESS : E_INVALID_PARAMETER;
00086                 }
00087
00088                 template <typename VALUE, typename VALIDATOR, typename FORMATTER>
00089                 glwebtools::Error operator>>(RequiredArgument<VALUE, VALIDATOR, FORMATTER>& value) const
00090                 {
00091                         VALUE inner_value;
00092                         GLWEBTOOLS_RETURN_ERROR_ON_FAIL((*this) >> inner_value);
00093                         value = inner_value;
00094
00095                         return value.IsValid() ? E_SUCCESS : E_INVALID_PARAMETER;
00096                 }
00097
00098                 template <typename VALUE>
00099                 glwebtools::Error operator>>(SecureData<VALUE>& value) const
00100                 {
00101                         VALUE inner_value;
00102                         GLWEBTOOLS_RETURN_ERROR_ON_FAIL((*this) >> inner_value);
00103                         value = inner_value;
00104
00105                         return E_SUCCESS;
00106                 }
00107
00108         public:
00109                 template <typename VALUE>
00110                 CustomArgument& Cast()
00111                 {
00112                         if (IsValid())
00113                                 SetType<VALUE>();
00114
00115                         return *this;
00116                 }
00117
00118                 template <typename VALUE>
00119                 CustomArgument Cast() const
00120                 {
00121                         CustomArgument temp = *this;
00122
00123                         if (IsValid())
00124                                 temp.SetType<VALUE>();
00125
00126                         return temp;
00127                 }
00128
00129         public:
00130                 bool IsValid() const;
00131
00132         public:
00133                 bool IsInt() const;
00134                 bool IsUInt() const;
00135                 bool IsFloat() const;
00136                 bool IsDouble() const;
00137                 bool IsBool() const;
00138                 bool IsString() const;
00139                 bool IsJSON() const;
00140
00141         public:
00142                 friend std::ostream& operator<<(std::ostream& os, const CustomArgument& value)
00143                 {
00144                         os << value.ToString();
00145                         return os;
00146                 }
00147
00148         private:
00149                 template <typename VALUE>
00150                 void SetType();
00151
00152
00153                 template <typename VALUE>
00154                 void SetType(VALUE /*value*/)
00155                 {
00156                         SetType<VALUE>();
00157                 }
00158
00159         private:
00160                 enum Type
00161                 {
00162                         T_UNKNOWN,
00163                         T_INT,
00164                         T_UINT,
00165                         T_FLOAT,
00166                         T_DOUBLE,
00167                         T_BOOL,
00168                         T_STRING,
00169                         T_JSON
00170                 };
00171
00172         private:
00173                 std::string m_value;
00174                 enum Type m_type;
00175         };
00176
00177         template <typename VALUE>
00178         CustomArgument& Cast(CustomArgument& argument)
00179         {
00180                 return argument.Cast<VALUE>();
00181         }
00182
00183         template <typename VALUE>
00184         CustomArgument Cast(const CustomArgument& argument)
00185         {
00186                 return argument.Cast<VALUE>();
00187         }
00188
00189         class CustomAttribute
00190         {
00191         public:
00192                 typedef std::string key_type;
00193
00194         public:
00195                 CustomAttribute();
00196
00197                 CustomAttribute(const key_type& key)
00198                         : m_key(key), m_value()
00199                 {
00200                 }
00201
00202                 CustomAttribute(const key_type& key, const CustomArgument& value)
00203                         : m_key(key), m_value(value)
00204                 {
00205                 }
00206
00207                 template <typename VALUE>
00208                 CustomAttribute(const key_type& key, VALUE value)
00209                         : m_key(key), m_value(value)
00210                 {
00211                 }
00212
00213                 template <typename VALUE, typename FORMATTER>
00214                 CustomAttribute(const key_type& key, VALUE value, FORMATTER formatter)
00215                         : m_key(key), m_value(value, formatter)
00216                 {
00217                 }
00218
00219                 const std::string& key() const;
00220                 const CustomArgument& value() const;
00221                 CustomArgument& value();
00222
00223                 bool operator==(const CustomAttribute& other)const;
00224
00225                 void key(const key_type& a_key);
00226
00227                 template <typename VALUE>
00228                 void value(VALUE a_value)
00229                 {
00230                         m_value = a_value;
00231                 }
00232
00233                 template <typename VALUE, typename FORMATTER>
00234                 void value(VALUE value, FORMATTER formatter)
00235                 {
00236                         m_value = CustomArgument(value, formatter);
00237                 }
00238
00239         private:
00240                 key_type m_key;
00241                 CustomArgument m_value;
00242         };
00243 } // federation
00244
00245 namespace std
00246 {
00247         template <>
00248         struct less<glwebtools::CustomAttribute>        : public binary_function<glwebtools::CustomAttribute, glwebtools::CustomAttribute, bool>
00249         {
00250                 bool operator()(const glwebtools::CustomAttribute& _Left, const glwebtools::CustomAttribute& _Right) const
00251                 {       // apply operator< to operands
00252                         return (_Left.key() < _Right.key());
00253                 }
00254         };
00255
00256 } // std
00257
00258 namespace glwebtools
00259 {
00260         class CustomAttributeList
00261         {
00262         public:
00263                 typedef std::set<glwebtools::CustomAttribute, std::less<glwebtools::CustomAttribute>, glwebtools::SAllocator<CustomAttribute> > container_type;
00264                 typedef container_type::const_iterator const_iterator;
00265                 typedef container_type::iterator iterator;
00266                 typedef CustomAttribute::key_type key_type;
00267                 typedef CustomAttribute value_type;
00268                 typedef container_type::size_type size_type;
00269
00270         public:
00271                 iterator begin();
00272                 const_iterator begin() const;
00273                 iterator end();
00274                 const_iterator end() const;
00275
00276         public:
00277                 bool operator==(const CustomAttributeList& other)const;
00278
00279                 bool empty() const;
00280
00281                 size_type size() const;
00282
00283                 iterator insert(const CustomAttribute& attribute)
00284                 {
00285                         return m_attributes.insert(attribute).first;
00286                 }
00287
00288                 iterator insert(const key_type& key)
00289                 {
00290                         return m_attributes.insert(CustomAttribute(key)).first;
00291                 }
00292
00293                 iterator insert(const key_type& key, const CustomArgument& value)
00294                 {
00295                         return m_attributes.insert(CustomAttribute(key, value)).first;
00296                 }
00297
00298                 template <typename GLWEBTOOLS_T>
00299                 iterator insert(const key_type& key, GLWEBTOOLS_T value)
00300                 {
00301                         return m_attributes.insert(CustomAttribute(key, value)).first;
00302                 }
00303
00304                 template <typename GLWEBTOOLS_T, typename FORMATTER>
00305                 iterator insert(const key_type& key, GLWEBTOOLS_T value, FORMATTER formatter)
00306                 {
00307                         return m_attributes.insert(CustomAttribute(key, value, formatter)).first;
00308                 }
00309
00310                 const_iterator find(const key_type& key) const;
00311
00312                 void erase(const key_type& key);
00313
00314                 void swap(CustomAttributeList& other);
00315
00316                 void clear();
00317
00318                 size_type count(const key_type& key) const;
00319
00320         // non-standard interface
00321         public:
00322                 const CustomArgument& operator[](const key_type& key) const;
00323
00324         private:
00325                 container_type m_attributes;
00326
00327         private:
00328                 static const CustomArgument InvalidArgument;
00329         };
00330
00331 } // glwebtools
00332
00333 #endif // _GLWEBTOOLS_CUSTOMATTRIBUTE_INCLUDED_


GLWebTools: glwebtools_debugger_module.h Source File

  • File List
glwebtools_debugger_module.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_DEBUGGER_MODULE_INCLUDED_
00003 #define _GLWEBTOOLS_DEBUGGER_MODULE_INCLUDED_
00004
00005 #include <glwebtools/internal/glwebtools_default_config.h>
00006
00007 #if GLWEBTOOLS_ENABLE_DEBUGGER_MODULE
00008 #include <glf/debugger/debugger.h>
00009 #endif
00010
00011 #include <glwebtools/os/glwebtools_mutex.h>
00012
00013 #include <list>
00014 #include <string>
00015
00016 namespace glf
00017 {
00018         namespace debugger
00019         {
00020                 class PacketReader;
00021         }
00022 }
00023
00024 namespace glwebtools
00025 {
00026         class GlfDebuggerModule
00027 #if GLF_ENABLE_DEBUGGER && GLWEBTOOLS_ENABLE_DEBUGGER_MODULE
00028                 : public glf::debugger::Module
00029 #endif // GLF_ENABLE_DEBUGGER
00030         {
00031         public:
00032                 struct Message
00033                 {
00034                         int m_id;
00035                         std::string m_message;
00036                 };
00037
00038                 virtual void Parse(int type, glf::debugger::PacketReader& in);
00039                 virtual void ConnectionOpened();
00040                 virtual void ConnectionClosed();
00041                 virtual void DebuggerDestroyed();
00042                 virtual void UpdateFrame();
00043
00044                 static GlfDebuggerModule& GetInstance();
00045
00046                 bool IsTracking() const;
00047                 bool IsTrackingData() const;
00048
00049                 void SendConnectionData(std::string& connData);
00050
00051                 void StartSession(const std::string& sessionName, bool sendData=false);
00052                 void StopSession();
00053                 void ExportLastSession();
00054                 void ClearAllSession();
00055
00056                 std::string GetSessionName();
00057
00058                 GlfDebuggerModule();
00059                 virtual ~GlfDebuggerModule(){}
00060
00061         private:
00062                 void ConsumeMessage(GlfDebuggerModule::Message& message);
00063
00064                 bool m_isTracking;
00065                 bool m_isSendingData;
00066
00067                 bool m_isConnected;
00068                 std::list<GlfDebuggerModule::Message> m_messageList;
00069                 std::string m_sessionName;
00070
00071                 mutable glwebtools::Mutex m_mutex;
00072         };
00073 }
00074
00075 #endif //_GLWEBTOOLS_DEBUGGER_MODULE_INCLUDED_


GLWebTools: glwebtools_default_config.h Source File

  • File List
glwebtools_default_config.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_GLWEBTOOLS_DEFAULT_CONFIG_INCLUDED_
00003 #define _GLWEBTOOLS_GLWEBTOOLS_DEFAULT_CONFIG_INCLUDED_
00004
00005 /*******************************************************************************
00006  *
00007  * Here are defined default value for constant.  In most cases, all these
00008  * value can be modified at runtime.  This file is mostly for default value. If
00009  * a value cannot be changed at runtime, it will be mention in its description.
00010  *
00011  ******************************************************************************/
00012
00013 #include <glwebtools_config.h> //if you get an include error on this include in the host projet, you're including something you should not
00014
00015 // The application can disable all console output by setting this define to 0
00016 // Application can also control their console output by changing the warning
00017 // level at runtime
00018 #ifndef GLWEBTOOLS_ENABLE_CONSOLE
00019 #define GLWEBTOOLS_ENABLE_CONSOLE 1
00020 #endif//GLWEBTOOLS_ENABLE_CONSOLE
00021
00022 // The application can provide their own implementation of glwebtools::Mutex by
00023 // disabling the default implementation (glf) (All but android)
00024 #ifndef GLWEBTOOLS_USE_GLF_MUTEX
00025 #if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00026 #define GLWEBTOOLS_USE_GLF_MUTEX 0
00027 #else
00028 #define GLWEBTOOLS_USE_GLF_MUTEX 1
00029 #endif//defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00030 #endif//GLWEBTOOLS_USE_GLF_MUTEX
00031
00032 // std::mutex implementation to replace the default implementation (glf)
00033 // (w8 + wp8)
00034 #ifndef GLWEBTOOLS_USE_STD_MUTEX
00035 #if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00036 #define GLWEBTOOLS_USE_STD_MUTEX 1
00037 #else
00038 #define GLWEBTOOLS_USE_STD_MUTEX 0
00039 #endif//defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00040 #endif//GLWEBTOOLS_USE_STD_MUTEX
00041
00042
00043 // The application can provide their own implementation of glwebtools::Atomic by
00044 // disabling the default implementation (glf) (All but android)
00045 #ifndef GLWEBTOOLS_USE_GLF_ATOMIC
00046 #if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00047 #define GLWEBTOOLS_USE_GLF_ATOMIC 0
00048 #else
00049 #define GLWEBTOOLS_USE_GLF_ATOMIC 1
00050 #endif//defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00051 #endif//GLWEBTOOLS_USE_GLF_ATOMIC
00052
00053 // std::atomic implementation to replace the default implementation (glf)
00054 // (w8 + wp8)
00055 #ifndef GLWEBTOOLS_USE_STD_ATOMIC
00056 #if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00057 #define GLWEBTOOLS_USE_STD_ATOMIC 1
00058 #else
00059 #define GLWEBTOOLS_USE_STD_ATOMIC 0
00060 #endif//defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00061 #endif//GLWEBTOOLS_USE_STD_ATOMIC
00062
00063
00064 // The application can provide their own implementation of glwebtools::Socket by
00065 // disabling the default implementation (glf)
00066 #ifndef GLWEBTOOLS_USE_GLF_SOCKET
00067 #if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00068 #define GLWEBTOOLS_USE_GLF_SOCKET 0
00069 #else
00070 #define GLWEBTOOLS_USE_GLF_SOCKET 1
00071 #endif//defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00072 #endif//GLWEBTOOLS_USE_GLF_SOCKET
00073
00074 #ifndef GLWEBTOOLS_USE_METRO_SOCKET
00075 #if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00076 #define GLWEBTOOLS_USE_METRO_SOCKET 1
00077 #else
00078 #define GLWEBTOOLS_USE_METRO_SOCKET 0
00079 #endif//defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00080 #endif//GLWEBTOOLS_USE_METRO_SOCKET
00081
00082
00083
00084 // The application can provide their own implementation of glwebtools::Thread by
00085 // disabling the default implementation (glf)
00086 #ifndef GLWEBTOOLS_USE_GLF_THREAD
00087 #if defined(ANDROID) || defined (__APPLE__) || defined(_WIN32) || defined(__linux__)
00088 #define GLWEBTOOLS_USE_GLF_THREAD 0
00089 #else//defined(ANDROID) || defined (__APPLE__) || defined(_WIN32) || defined(__linux__)
00090 #define GLWEBTOOLS_USE_GLF_THREAD 1
00091 #endif//defined(ANDROID) || defined (__APPLE__) || defined(_WIN32) || defined(__linux__)
00092 #endif//GLWEBTOOLS_USE_GLF_THREAD
00093
00094 // Posix thread implementation to replace the default implementation (glf)
00095 // (android + apple)
00096 #ifndef GLWEBTOOLS_USE_POSIX_THREAD
00097 #if defined(ANDROID) || defined(__APPLE__) || defined(__linux__)
00098 #define GLWEBTOOLS_USE_POSIX_THREAD 1
00099 #else
00100 #define GLWEBTOOLS_USE_POSIX_THREAD 0
00101 #endif//defined(ANDROID) || defined(__APPLE__) || defined(__linux__)
00102 #endif//GLWEBTOOLS_USE_POSIX_THREAD
00103
00104 // Win32 thread implementation to replace the default implementation (glf)
00105 // (Win32)
00106 #ifndef GLWEBTOOLS_USE_WIN32_THREAD
00107 #if defined(_WIN32) && !defined (WINAPI_FAMILY)
00108 #define GLWEBTOOLS_USE_WIN32_THREAD 1
00109 #else
00110 #define GLWEBTOOLS_USE_WIN32_THREAD 0
00111 #endif//defined(_WIN32) && !defined (WINAPI_FAMILY)
00112 #endif//GLWEBTOOLS_USE_WIN32_THREAD
00113
00114 // std::thread implementation to replace the default implementation (glf)
00115 // (w8 + wp8)
00116 #ifndef GLWEBTOOLS_USE_STD_THREAD
00117 #if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00118 #define GLWEBTOOLS_USE_STD_THREAD 1
00119 #else
00120 #define GLWEBTOOLS_USE_STD_THREAD 0
00121 #endif//defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00122 #endif//GLWEBTOOLS_USE_STD_THREAD
00123
00124 // The application can provide their own implementation of glwebtools::IOStream by
00125 // disabling the default implementation (glf)
00126 #ifndef GLWEBTOOLS_USE_GLF_FILE_IO
00127 #if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00128 #define GLWEBTOOLS_USE_GLF_FILE_IO 0
00129 #else
00130 #define GLWEBTOOLS_USE_GLF_FILE_IO 1
00131 #endif//defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00132 #endif//GLWEBTOOLS_USE_GLF_FILE_IO
00133
00134 // The application can provide their own implementation of glwebtools::IOStream by
00135 // disabling the default implementation
00136 #ifndef GLWEBTOOLS_USE_STD_FILE_IO
00137 #if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00138 #define GLWEBTOOLS_USE_STD_FILE_IO 1
00139 #else
00140 #define GLWEBTOOLS_USE_STD_FILE_IO 0
00141 #endif//defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00142 #endif//GLWEBTOOLS_USE_STD_FILE_IO
00143
00144 // The application can provide their own implementation of glwebtools::MemBar
00145 // by disabling the default implementation (glf)
00146 #ifndef GLWEBTOOLS_USE_GLF_MEMORY_BARRIER
00147 #if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00148 #define GLWEBTOOLS_USE_GLF_MEMORY_BARRIER 0
00149 #else
00150 #define GLWEBTOOLS_USE_GLF_MEMORY_BARRIER 1
00151 #endif//defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00152 #endif//GLWEBTOOLS_USE_GLF_MEMORY_BARRIER
00153
00154 // std memory barrier implementation to replace the default implementation (glf)
00155 // (w8 + wp8)
00156 #ifndef GLWEBTOOLS_USE_STD_MEMORY_BARRIER
00157 #if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00158 #define GLWEBTOOLS_USE_STD_MEMORY_BARRIER 1
00159 #else
00160 #define GLWEBTOOLS_USE_STD_MEMORY_BARRIER 0
00161 #endif//defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00162 #endif//GLWEBTOOLS_USE_STD_MEMORY_BARRIER
00163
00164 // The application can provide their own implementation of http connections
00165 // by disabling the default implementation (IXMLHTTPREQUEST2 on w8/wp8)
00166 #ifndef GLWEBTOOLS_USE_XMLHTTPREQUEST2
00167 #if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00168 #define GLWEBTOOLS_USE_XMLHTTPREQUEST2 1
00169 #else
00170 #define GLWEBTOOLS_USE_XMLHTTPREQUEST2 0
00171 #endif//defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00172 #endif//GLWEBTOOLS_USE_XMLHTTPREQUEST2
00173
00174 // The application can provide their own implementation of glwebtools::SystemClock
00175 // by disabling the default implementation (glf)
00176 #ifndef GLWEBTOOLS_USE_GLF_SYSTEMCLOCK
00177 #if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00178 #define GLWEBTOOLS_USE_GLF_SYSTEMCLOCK 0
00179 #else
00180 #define GLWEBTOOLS_USE_GLF_SYSTEMCLOCK 1
00181 #endif//defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00182 #endif//GLWEBTOOLS_USE_GLF_SYSTEMCLOCK
00183
00184 // The application can provide their own implementation of glwebtools::SystemClock
00185 // by disabling the default implementation (std on w8/wp8)
00186 #ifndef GLWEBTOOLS_USE_STD_SYSTEMCLOCK
00187 #if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00188 #define GLWEBTOOLS_USE_STD_SYSTEMCLOCK 1
00189 #else
00190 #define GLWEBTOOLS_USE_STD_SYSTEMCLOCK 0
00191 #endif//defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00192 #endif//GLWEBTOOLS_USE_STD_SYSTEMCLOCK
00193
00194 // The application can provide their own implementation of glwebtools::Time
00195 // by disabling the default implementation (posix)
00196 #ifndef GLWEBTOOLS_USE_POSIX_TIME
00197 #if defined(_WIN32)
00198 #define GLWEBTOOLS_USE_POSIX_TIME 0
00199 #else
00200 #define GLWEBTOOLS_USE_POSIX_TIME 1
00201 #endif//defined(_WIN32)
00202 #endif//GLWEBTOOLS_USE_POSIX_TIME
00203
00204 // The application can provide their own implementation of glwebtools::Time
00205 // by disabling the default implementation (win32)
00206 #ifndef GLWEBTOOLS_USE_WIN32_TIME
00207 #if defined(_WIN32)
00208 #define GLWEBTOOLS_USE_WIN32_TIME 1
00209 #else
00210 #define GLWEBTOOLS_USE_WIN32_TIME 0
00211 #endif//defined(_WIN32)
00212 #endif//GLWEBTOOLS_USE_WIN32_TIME
00213
00214 #ifndef GLWEBTOOLS_ASSERT
00215 #define GLWEBTOOLS_ASSERT(X)
00216 #endif//GLWEBTOOLS_ASSERT
00217
00218 // The default url connection and request are implemented using CURL.  The
00219 // application could provide an alternate or modified implementation by
00220 // disabling this setting
00221 #ifndef GLWEBTOOLS_USE_CURL
00222 #if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00223 #define GLWEBTOOLS_USE_CURL 0
00224 #else
00225 #define GLWEBTOOLS_USE_CURL 1
00226 #endif//defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00227 #endif//GLWEBTOOLS_USE_CURL
00228
00229 // Set if glwebtools override the allocators for CURL. Set to 0 if the application already provide its own allocators to CURL.
00230 #ifndef GLWEBTOOLS_OVERRIDE_CURL_ALLOCATORS
00231 #define GLWEBTOOLS_OVERRIDE_CURL_ALLOCATORS 0
00232 #endif//GLWEBTOOLS_OVERRIDE_CURL_ALLOCATORS
00233
00234 // By default curl is built with openssl.  As this API is using multithreaded
00235 // connections, we need to create mutexes for OpenSSL.  If your application and
00236 // all the other library using this API are not using secure connection (HTTPS)
00237 // or an alternate version of curl is used without OpenSSL you can disable the
00238 // mutexes creation with this setting.  Disabling this setting when using
00239 // OpenSSL in multithread will cause unwanted behaviour and possibly crashes.
00240 #ifndef GLWEBTOOLS_USE_OPENSSL
00241 #if defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00242 #define GLWEBTOOLS_USE_OPENSSL 0
00243 #else
00244 #define GLWEBTOOLS_USE_OPENSSL 1
00245 #endif//defined(WINAPI_FAMILY) && ((WINAPI_FAMILY==WINAPI_FAMILY_APP) || (WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP))
00246 #endif//GLWEBTOOLS_USE_OPENSSL
00247
00248 // Set if glwebtools override the allocators for openssl. Set to 0 if the application already provide its own allocators to openssl.
00249 #ifndef GLWEBTOOLS_OVERRIDE_OPENSSL_ALLOCATORS
00250 #define GLWEBTOOLS_OVERRIDE_OPENSSL_ALLOCATORS 0
00251 #endif//GLWEBTOOLS_OVERRIDE_OPENSSL_ALLOCATORS
00252
00253
00254 // Default log level, this can be changed at runtime iusing the creation settings
00255 #ifndef GLWEBTOOLS_CONSOLE_DEFAULT_LEVEL
00256 #ifdef GLWEBTOOLS_DEBUG
00257 #define GLWEBTOOLS_CONSOLE_DEFAULT_LEVEL 4
00258 #else
00259 #define GLWEBTOOLS_CONSOLE_DEFAULT_LEVEL 0
00260 #endif//GLWEBTOOLS_DEBUG
00261 #endif//GLWEBTOOLS_CONSOLE_DEFAULT_LEVEL
00262
00263 // Set if the glwebtool singleton run on its own thread or if the application
00264 // call Update avery frame - Threaded mode should be used on all platforms
00265 // supporting threads
00266 #ifndef GLWEBTOOLS_WEBTOOLS_THREADED_UPDATE
00267 #define GLWEBTOOLS_WEBTOOLS_THREADED_UPDATE 1
00268 #endif//GLWEBTOOLS_WEBTOOLS_THREADED_UPDATE
00269
00270 // Default update period, since most internal component use seconds as time
00271 // unit, this doesn't need to be really aggressive
00272 #ifndef GLWEBTOOLS_WEBTOOLS_THREADED_UPDATE_PERIOD
00273 #define GLWEBTOOLS_WEBTOOLS_THREADED_UPDATE_PERIOD 100 //ms doesn't need to be updated frequently, url connection are slow to respond
00274 #endif//GLWEBTOOLS_WEBTOOLS_THREADED_UPDATE_PERIOD
00275
00276 // GlWebTools update thread default priority
00277 #ifndef GLWEBTOOLS_WEBTOOLS_THREADED_UPDATE_PRIORITY
00278 #define GLWEBTOOLS_WEBTOOLS_THREADED_UPDATE_PRIORITY glwebtools::Thread::P_HIGH
00279 #endif//GLWEBTOOLS_WEBTOOLS_THREADED_UPDATE_PRIORITY
00280
00281 // UrlConnection (defaut implementation) default priority.  This should be
00282 // higher or equal to the application thread. While this doesn't require much
00283 // CPU, some part are time sensitive.
00284 #ifndef GLWEBTOOLS_DEFAULT_TASKGROUP_THREAD_PRIORITY
00285 #define GLWEBTOOLS_DEFAULT_TASKGROUP_THREAD_PRIORITY glwebtools::Thread::P_HIGH
00286 #endif//GLWEBTOOLS_DEFAULT_TASKGROUP_THREAD_PRIORITY
00287
00288 // UrlConnection (defaut implementation) default min threads.
00289 // This the initial number of threads in the thread pool for the connections.
00290 #ifndef GLWEBTOOLS_DEFAULT_TASKGROUP_MIN_THREADS
00291 #define GLWEBTOOLS_DEFAULT_TASKGROUP_MIN_THREADS 0
00292 #endif//
00293
00294 // UrlConnection (defaut implementation) default max threads.
00295 // The thread pool for the connections is allowed to grow until it reachs max threads.
00296 #ifndef GLWEBTOOLS_DEFAULT_TASKGROUP_MAX_THREADS
00297 #define GLWEBTOOLS_DEFAULT_TASKGROUP_MAX_THREADS 100
00298 #endif//GLWEBTOOLS_DEFAULT_TASKGROUP_MAX_THREADS
00299
00300 // UrlConnection (defaut implementation) default hysteresis (ms).
00301 // The thread pool for the connections is allowed to shrink by one after the hysteresis time (ms) until it reachs min threads.
00302 #ifndef GLWEBTOOLS_DEFAULT_TASKGROUP_HYSTERESIS
00303 #define GLWEBTOOLS_DEFAULT_TASKGROUP_HYSTERESIS 0
00304 #endif//GLWEBTOOLS_DEFAULT_TASKGROUP_HYSTERESIS
00305
00306 // UrlConnection (defaut implementation) default max starting time for a thread (ms).
00307 // This the time a thread have to start before being declared faulty and removed
00308 #ifndef GLWEBTOOLS_DEFAULT_TASKGROUP_MAX_THREAD_STARTING_TIME
00309 #define GLWEBTOOLS_DEFAULT_TASKGROUP_MAX_THREAD_STARTING_TIME 1000
00310 #endif//GLWEBTOOLS_DEFAULT_TASKGROUP_MAX_THREAD_STARTING_TIME
00311
00312 // UrlConnection (defaut implementation) default task group id.
00313 // This is reserved for the default taskgroup used by glwebtools
00314 #ifndef GLWEBTOOLS_DEFAULT_TASKGROUP_ID
00315 #define GLWEBTOOLS_DEFAULT_TASKGROUP_ID "GlWebTools Default TaskGroup"
00316 #endif//GLWEBTOOLS_DEFAULT_TASKGROUP_ID
00317
00318 // UrlConnection (defaut implementation) default priority.  This should be
00319 // higher or equal to the application thread. While this doesn't require much
00320 // CPU, some part are time sensitive.
00321 #ifndef GLWEBTOOLS_URL_CONNECTION_THREAD_PRIORITY
00322 #define GLWEBTOOLS_URL_CONNECTION_THREAD_PRIORITY glwebtools::Thread::P_HIGH
00323 #endif//GLWEBTOOLS_URL_CONNECTION_THREAD_PRIORITY
00324
00325 // UrlConnection (defaut implementation) default min threads.
00326 // This the initial number of threads in the thread pool for the connections.
00327 #ifndef GLWEBTOOLS_URL_CONNECTION_MIN_THREADS
00328 #define GLWEBTOOLS_URL_CONNECTION_MIN_THREADS 1
00329 #endif//GLWEBTOOLS_URL_CONNECTION_MIN_THREADS
00330
00331 // UrlConnection (defaut implementation) default max threads.
00332 // The thread pool for the connections is allowed to grow until it reachs max threads.
00333 #ifndef GLWEBTOOLS_URL_CONNECTION_MAX_THREADS
00334 #define GLWEBTOOLS_URL_CONNECTION_MAX_THREADS 3
00335 #endif//GLWEBTOOLS_URL_CONNECTION_MAX_THREADS
00336
00337 // UrlConnection (defaut implementation) default hysteresis (ms).
00338 // The thread pool for the connections is allowed to shrink by one after the hysteresis time (ms) until it reachs min threads.
00339 #ifndef GLWEBTOOLS_URL_CONNECTION_HYSTERESIS
00340 #define GLWEBTOOLS_URL_CONNECTION_HYSTERESIS 5000
00341 #endif//GLWEBTOOLS_URL_CONNECTION_HYSTERESIS
00342
00343 // UrlConnection (defaut implementation) default max starting time for a thread (ms).
00344 // This the time a thread have to start before being declared faulty and removed (when there is no task in the queue)
00345 #ifndef GLWEBTOOLS_URL_CONNECTION_MAX_THREAD_STARTING_TIME
00346 #define GLWEBTOOLS_URL_CONNECTION_MAX_THREAD_STARTING_TIME 5000
00347 #endif//GLWEBTOOLS_URL_CONNECTION_MAX_THREAD_STARTING_TIME
00348
00349 // UrlConnection (defaut implementation) default task priority.
00350 // Task of higher priority are scheduled first.
00351 #ifndef GLWEBTOOLS_URL_CONNECTION_TASK_PRIORITY
00352 #define GLWEBTOOLS_URL_CONNECTION_TASK_PRIORITY 0
00353 #endif//GLWEBTOOLS_URL_CONNECTION_TASK_PRIORITY
00354
00355 // UrlConnection (defaut implementation) default timeout for the task to start when no thread is available (ms).
00356 #ifndef GLWEBTOOLS_URL_CONNECTION_TASK_TIMEOUT
00357 #define GLWEBTOOLS_URL_CONNECTION_TASK_TIMEOUT 1000
00358 #endif//GLWEBTOOLS_URL_CONNECTION_TASK_TIMEOUT
00359
00360 // Default maximum open server connection per UrlConnection (default implementation)
00361 #ifndef GLWEBTOOLS_URL_CONNECTION_MAX_CONNECTIONS
00362 #define GLWEBTOOLS_URL_CONNECTION_MAX_CONNECTIONS 1
00363 #endif//GLWEBTOOLS_URL_CONNECTION_MAX_CONNECTIONS
00364
00365 // Default maximum timeout for server connection in seconds
00366 #ifndef GLWEBTOOLS_URL_CONNECTION_CONNECT_TIMEOUT
00367 #define GLWEBTOOLS_URL_CONNECTION_CONNECT_TIMEOUT 120
00368 #endif//GLWEBTOOLS_URL_CONNECTION_CONNECT_TIMEOUT
00369
00370 // Default maximum timeout for data chunk transfer in seconds (0 for infinite)
00371 // If there is more than GLWEBTOOLS_URL_CONNECTION_TIMEOUT between 2 data chunks
00372 // the connection is aborted
00373 #ifndef GLWEBTOOLS_URL_CONNECTION_TIMEOUT
00374 #define GLWEBTOOLS_URL_CONNECTION_TIMEOUT 600
00375 #endif//GLWEBTOOLS_URL_CONNECTION_TIMEOUT
00376
00377 // By default UrlConnection only fail on connection error.  If this is set
00378 // connection will also fail if server return a reponse code 400 or higher.
00379 #ifndef GLWEBTOOLS_URL_CONNECTION_FAIL_ON_RESPONSE_400_AND_HIGHER
00380 #define GLWEBTOOLS_URL_CONNECTION_FAIL_ON_RESPONSE_400_AND_HIGHER false
00381 #endif//GLWEBTOOLS_URL_CONNECTION_FAIL_ON_RESPONSE_400_AND_HIGHER
00382
00383 // Set if connection follow 302 response (redirection)
00384 #ifndef GLWEBTOOLS_URL_CONNECTION_FOLLOW_302
00385 #define GLWEBTOOLS_URL_CONNECTION_FOLLOW_302 true
00386 #endif//GLWEBTOOLS_URL_CONNECTION_FOLLOW_302
00387
00388 // Set if the connection should use content encoding (compression)
00389 #ifndef GLWEBTOOLS_URL_CONNECTION_ENABLE_ACCEPT_ENCODING
00390 #define GLWEBTOOLS_URL_CONNECTION_ENABLE_ACCEPT_ENCODING true
00391 #endif//GLWEBTOOLS_URL_CONNECTION_ENABLE_ACCEPT_ENCODING
00392
00393 // Set encodding supported (default : prefer gzip or deflate otherwise use
00394 // identity else fail)
00395 #ifndef GLWEBTOOLS_URL_CONNECTION_ACCEPT_ENCODING
00396 #define GLWEBTOOLS_URL_CONNECTION_ACCEPT_ENCODING "gzip;q=1.0, deflate;q=1.0, identity;q=0.5, *;q=0"
00397 #endif//GLWEBTOOLS_URL_CONNECTION_ACCEPT_ENCODING
00398
00399 // Set if creation setting should try to get info from application bundle dict.
00400 #ifndef GLWEBTOOLS_DISABLE_AUTOMATIC_APP_INFO_FETCH
00401 #define GLWEBTOOLS_DISABLE_AUTOMATIC_APP_INFO_FETCH 0
00402 #endif//GLWEBTOOLS_DISABLE_AUTOMATIC_APP_INFO_FETCH
00403
00404 // Default maximum timeout before closing in milliseconds
00405 #ifndef GLWEBTOOLS_URL_CONNECTION_SHUTDOWN_TIMEOUT_MS
00406 #define GLWEBTOOLS_URL_CONNECTION_SHUTDOWN_TIMEOUT_MS 500
00407 #endif//GLWEBTOOLS_URL_CONNECTION_SHUTDOWN_TIMEOUT_MS
00408
00409 // Default step in milliseconds when waiting for timeout before closing
00410 #ifndef GLWEBTOOLS_URL_CONNECTION_SHUTDOWN_STEP_MS
00411 #define GLWEBTOOLS_URL_CONNECTION_SHUTDOWN_STEP_MS 10
00412 #endif//GLWEBTOOLS_URL_CONNECTION_SHUTDOWN_STEP_MS
00413
00414 #ifndef GLWEBTOOLS_POSIX_THREAD_STACK_SIZE
00415 #define GLWEBTOOLS_POSIX_THREAD_STACK_SIZE (64 * 1024)
00416 #endif//GLWEBTOOLS_POSIX_THREAD_STACK_SIZE
00417
00418 // Requires GLF to work, do not enable this feature if your application doesn't use glf
00419 #ifndef GLWEBTOOLS_ENABLE_DEBUGGER_MODULE
00420 #define GLWEBTOOLS_ENABLE_DEBUGGER_MODULE 0
00421 #endif //GLWEBTOOLS_ENABLE_DEBUGGER_MODULE
00422
00423 #ifndef GLWEBTOOLS_ENABLE_DUMP_REQUEST
00424 #define GLWEBTOOLS_ENABLE_DUMP_REQUEST 1
00425 #endif //GLWEBTOOLS_ENABLE_DUMP_REQUEST
00426
00427 #ifndef GLWEBTOOLS_URL_CONNECTION_DUMP_REQUEST
00428 #define GLWEBTOOLS_URL_CONNECTION_DUMP_REQUEST false
00429 #endif //GLWEBTOOLS_URL_CONNECTION_DUMP_REQUEST
00430
00431 #endif //_GLWEBTOOLS_GLWEBTOOLS_DEFAULT_CONFIG_INCLUDED_


GLWebTools: glwebtools_error.h Source File

  • File List
glwebtools_error.h
00001 #ifndef _GLWEBTOOLS_ERROR_INCLUDED_
00002 #define _GLWEBTOOLS_ERROR_INCLUDED_
00003
00004 namespace glwebtools
00005 {
00007         enum //Error
00008         {
00009                 E_SUCCESS               =  0x00000000,
00010
00011                 E_UNKNOWN               =  0x80000000,
00012
00013                 E_INVALID_HANDLE        =  0x80000001,
00014                 E_INVALID_PARAMETER     =  0x80000002,
00015                 E_INVALID_OPERATION     =  0x80000003,
00016                 E_OBJECT_BUSY           =  0x80000004,
00017                 E_MEMORY_ERROR          =  0x80000005,
00018                 E_INVALID_DATA          =  0x80000006,
00019                 E_INITIALIZATION_ERROR  =  0x80000007,
00020                 E_TIMEOUT               =  0x80000008,
00021                 E_INVALID_CREATION_SETTINGS  =  0x80000009,
00022                 E_TYPE_REGISTRATION_ERROR    =  0x80000010,
00023                 E_TASK_NOT_FOUND                =  0x80000011,
00024                 E_CONNECTION_CANCELLED  =  0x80000012,
00025                 E_CONNECTION_NOTHREAD  =  0x80000013,
00026
00027                 E_UNSUPPORTED_PROTOCOL  =  0x80000101,
00028                 E_URL_MALFORMAT                 =  0x80000102,
00029                 E_TOO_MANY_REDIRECTS    =  0x80000103,
00030                 E_COULDNT_RESOLVE_HOST  =  0x80000104,
00031                 E_COULDNT_CONNECT               =  0x80000105,
00032                 E_SSL_CONNECT_ERROR             =  0x80000106
00033
00034         };
00035
00036         typedef int Error;
00037 }
00038
00039 #endif //_GLWEBTOOLS_ERROR_INCLUDED_


GLWebTools: glwebtools_glwebtoolscore.h Source File

  • File List
glwebtools_glwebtoolscore.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_GLWEBTOOLS_CORE_INCLUDED_
00003 #define _GLWEBTOOLS_GLWEBTOOLS_CORE_INCLUDED_
00004
00005 #include <glwebtools/internal/glwebtools_types.h>
00006 #include <glwebtools/internal/glwebtools_memory.h>
00007
00008 #include <glwebtools/glwebtools_glwebtoolshandle.h>
00009
00010 #include <glwebtools/os/glwebtools_mutex.h>
00011 //#include <glwebtools/os/glwebtools_thread.h>
00012 #include <glwebtools/os/glwebtools_taskgroup.h>
00013
00014 #include <glwebtools/internal/glwebtools_urlconnection.h>
00015 #include <glwebtools/internal/glwebtools_urlrequest.h>
00016 #include <glwebtools/internal/glwebtools_urlresponse.h>
00017
00018 #include <glwebtools/glwebtools_urlhandle.h>
00019
00020 #include <glwebtools/glwebtools_openssl.h>
00021 #include <glwebtools/glwebtools_curl.h>
00022
00023 #include <vector>
00024 #include <map>
00025
00027 namespace glwebtools
00028 {
00029
00030 typedef std::map<uptr_t, UrlConnectionCore*, std::less<uptr_t>, glwebtools::SAllocator<std::pair<const uptr_t, UrlConnectionCore*> > > UrlConnectionRefMap;
00031 typedef std::map<uptr_t, UrlRequestCore*, std::less<uptr_t>, glwebtools::SAllocator<std::pair<const uptr_t, UrlRequestCore*> > > UrlRequestRefMap;
00032 typedef std::vector<glwebtools::Mutex*, glwebtools::SAllocator<glwebtools::Mutex*> > MutexRefVector;
00033
00034 class GlWebTools;
00035
00037 class GlWebToolsCore : public Managed
00038 {
00039 public:
00040
00041 private:
00043
00046         bool IsInitialized() const;
00047
00048         // Managed override
00050         virtual bool CanDelete() const;
00051
00052         virtual unsigned int Grab();
00053         virtual unsigned int Drop();
00054
00056
00061         static glwebtools::Error CreateInstance(GlWebToolsCore*& glWebToolsCore);
00062
00064
00070         static glwebtools::Error DestroyInstance(GlWebToolsCore* glWebToolsCore);
00071
00073
00080         glwebtools::Error Initialize(const GlWebTools::CreationSettings& cs);
00081
00083
00088         UrlConnection CreateUrlConnection();
00089
00091
00097         UrlConnection CreateUrlConnection(const UrlConnection::CreationSettings& cs);
00098
00100
00105         UrlRequest CreateUrlRequest();
00106
00108
00114         UrlRequest CreateUrlRequest(UrlRequest::CreationSettings& cs);
00115
00117
00122         glwebtools::Error Update();
00123
00125
00128         bool HasRunningConnection();
00129
00131
00135         bool CancelAllConnections();
00136
00138
00142         glwebtools::Error Shutdown();
00143
00145
00150         glwebtools::Error Terminate(unsigned int milliseconds);
00151
00153
00158         glwebtools::Error Terminate();
00159
00161
00164         bool ShutdownInProgress() const;
00165
00166 public:
00167         typedef std::string TaskGroupId;
00168
00169 public:
00179         glwebtools::Error AddTaskGroup(const TaskGroupId& id, const TaskGroup::CreationSettings& creationSettings);
00180
00189         glwebtools::Error AddTaskGroup(const TaskGroupId& id);
00190
00191 private:
00192         glwebtools::Error AddDefaultTaskGroup();
00193         glwebtools::Error UpdateTaskGroups(u64 delta_time_ms);
00194         void ClearTaskGroups();
00195         const TaskGroup* GetTaskGroup(const TaskGroupId& id) const;
00196         TaskGroup* GetTaskGroup(const TaskGroupId& id);
00197
00198 private:
00199         typedef std::map<TaskGroupId, TaskGroup*, std::less<TaskGroupId>, glwebtools::SAllocator<std::pair<const TaskGroupId, TaskGroup*> > > TaskGroupMap;
00200
00201 private:
00202         TaskGroupMap m_taskGroupMap;
00203         TaskGroup m_sseTaskGroup;
00204
00205 private:
00206         u64 UpdateTime();
00207
00208 public:
00210         virtual ~GlWebToolsCore();
00211
00212 private:
00214
00218         GlWebToolsCore();
00219
00220         // No mutex
00221         glwebtools::Error _WaitForCanDelete(unsigned int milliseconds);
00222         // No mutex
00223         glwebtools::Error _CancelAllConnections();
00224         // No mutex
00225         bool _HasRunningConnection();
00226
00227         static void UpdateStatic(void* caller, void* param);
00228
00229         static void SSLProcessLock(int mode, int n, const char*, int);
00230
00231         UrlConnectionRefMap m_urlConnections;
00232         UrlRequestRefMap        m_urlRequests;
00233         MutexRefVector          m_sslMutex;
00234
00235         GlWebTools::CreationSettings m_creationSettings;
00236         glwebtools::String m_userAgent;
00237
00238         mutable glwebtools::Mutex m_mutex;
00239         glwebtools::Thread* m_thread;
00240
00241         bool m_isRunning;
00242         bool m_shutdownInProgress;
00243
00244
00245         // Scoped initialization of openssl
00246         glwebtools::OpenSSL m_openSSL;
00247         // Scoped initialization of Curl
00248         glwebtools::Curl m_curl;
00249
00250         bool m_isInitialized;
00251
00252         u64 m_last_update_time;
00253
00254 private:
00255         static unsigned int s_urlConnectionHandleTypeId;
00256         static unsigned int s_urlRequestHandleTypeId;
00257
00258 private:
00259         friend class GlWebTools;
00260 };
00261
00262 }
00263
00264 #endif


GLWebTools: glwebtools_glwebtoolshandle.h Source File

  • File List
glwebtools_glwebtoolshandle.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_GLWEBTOOLS_INCLUDED_
00003 #define _GLWEBTOOLS_GLWEBTOOLS_INCLUDED_
00004
00005 #include <glwebtools/internal/glwebtools_common.h>
00006 #include <glwebtools/glwebtools_urlhandle.h>
00007 #include <glwebtools/os/glwebtools_taskgroup.h>
00008
00009 namespace glwebtools
00010 {
00011
00012 class GlWebToolsCore;
00013
00015 class GlWebTools
00016 {
00017 public:
00019         struct CreationSettings
00020         {
00022
00025                 CreationSettings();
00026
00027                 bool m_isThreadedUpdate;
00028                 unsigned int m_threadedUpdatePeriod;
00029                 glwebtools::Thread::Priority m_updateThreadPriority;
00030
00031                 unsigned int m_connectionMinThreadCount;
00032                 unsigned int m_connectionMaxThreadCount;
00033                 glwebtools::Thread::Priority m_connectionThreadPriority;
00034                 unsigned int m_connectionHysteresis_ms;
00035                 unsigned int m_maxThreadStartTime_ms;
00036
00037                 std::string m_applicationIdentifier;
00038                 std::string m_applicationVersion;
00039
00040                 std::string m_osIdentifier;
00041                 std::string m_osVersion;
00042
00043                 std::string m_deviceIdentifier;
00044
00045                 std::string m_instanceName;
00046         };
00047
00048 public:
00050         GlWebTools();
00052         ~GlWebTools();
00054         GlWebTools(const GlWebTools& rhs);
00056         GlWebTools& operator=(const GlWebTools& rhs);
00057
00059
00065         glwebtools::Error Release();
00066
00068
00075         glwebtools::Error Release(unsigned int milliseconds);
00076
00077
00079
00083         bool IsInitialized() const;
00084
00086
00100         glwebtools::Error Initialize(const GlWebTools::CreationSettings& cs);
00101
00103
00110         glwebtools::Error Shutdown();
00111
00120         glwebtools::Error Terminate();
00121
00131         glwebtools::Error Terminate(unsigned int milliseconds);
00132
00134
00139         UrlConnection CreateUrlConnection();
00140
00142
00148         UrlConnection CreateUrlConnection(UrlConnection::CreationSettings& cs);
00149
00151
00156         UrlRequest CreateUrlRequest();
00157
00159
00165         UrlRequest CreateUrlRequest(UrlRequest::CreationSettings& cs);
00166
00168
00178         glwebtools::Error Update();
00179
00181
00185         bool ShutdownInProgress() const;
00186
00187 public:
00188         typedef std::string TaskGroupId;
00189
00190 public:
00200         glwebtools::Error AddTaskGroup(const TaskGroupId& id, const TaskGroup::CreationSettings& creationSettings);
00201
00210         glwebtools::Error AddTaskGroup(const TaskGroupId& id);
00211
00212 private:
00213
00214         GlWebToolsCore* m_glWebTools;
00215 };
00216
00217 }
00218
00219 #endif


GLWebTools: glwebtools_handlemanager.h Source File

  • File List
glwebtools_handlemanager.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_HANDLE_MANAGER_INCLUDED_
00003 #define _GLWEBTOOLS_HANDLE_MANAGER_INCLUDED_
00004
00005 #include <glwebtools/internal/glwebtools_common.h>
00006 #include <glwebtools/internal/glwebtools_types.h>
00007 #include <glwebtools/internal/glwebtools_memory.h>
00008
00009 #include <glwebtools/os/glwebtools_mutex.h>
00010
00011 #include <vector>
00012
00013 namespace glwebtools
00014 {
00015
00016 struct HandleManagerNode
00017 {
00018         HandleManagerNode();
00019
00020         unsigned int m_token;
00021         bool m_isEmpty;
00022         uptr_t m_objectPointer;
00023 };
00024
00025 typedef std::vector<HandleManagerNode, glwebtools::SAllocator<HandleManagerNode> > HandleManagerNodeVector;
00026
00028
00038 class HandleManager : public NonCopyable
00039 {
00040 public:
00041         static HandleManager* GetInstance();
00042
00043         bool RegisterNode(unsigned int type, unsigned int counter, void * objectPointer, unsigned int& token);
00044         bool UnregisterNode(unsigned int token);
00045
00046         bool GetObjectPointer(unsigned int token, void*& objectPointer) const;
00047
00048         static bool RegisterType(unsigned int& outType);
00049         static unsigned int GetNextCounterValue();
00050
00051 private:
00052         HandleManager();
00053         HandleManagerNodeVector m_handleNodes;
00054         mutable glwebtools::Mutex m_mutex;
00055
00056         uptr_t m_freeIndex;
00057
00058         static unsigned int s_nextTypeId;
00059         static unsigned int s_nextCounter;
00060         static HandleManager* s_instance;
00061 };
00062
00063 template <typename GLWEBTOOLS_T>
00064 class HandleBase
00065 {
00066 protected:
00067         HandleBase():m_token(0){}
00068         HandleBase(unsigned int token):m_token(token){}
00069
00070         GLWEBTOOLS_T* GetObjectPointer() const
00071         {
00072                 HandleManager* handleManager = HandleManager::GetInstance();
00073                 void* ptr = 0;
00074
00075                 if(handleManager)
00076                 {
00077                         handleManager->GetObjectPointer(m_token, ptr);
00078                 }
00079
00080                 return static_cast<GLWEBTOOLS_T*>(ptr);
00081         }
00082
00083         unsigned int m_token;
00084 };
00085
00086 } //namespace glwebtools
00087
00088 #endif


GLWebTools: glwebtools_iostream.h Source File

  • File List
glwebtools_iostream.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_IOSTREAM_INCLUDED_
00003 #define _GLWEBTOOLS_IOSTREAM_INCLUDED_
00004
00005 #if defined(ANDROID) || defined(__APPLE__) || defined(__linux__)
00006 #include <stddef.h>
00007 #endif
00008
00009 namespace glwebtools
00010 {
00011
00012 class IOStream
00013 {
00014 public:
00015         enum Mode
00016         {
00017                 // action
00018                 M_READ                          =       0x0001,
00019                 M_WRITE                         =       0x0002,
00020                 M_READ_AND_WRITE        =       (M_READ | M_WRITE),
00021
00022                 //location
00023                 M_DATA_PACK                     =       0x0100,
00024                 M_USER_SPACE            =       0x0200
00025         };
00026
00027         enum SeekMode
00028         {
00029                 SM_CUR,
00030                 SM_END,
00031                 SM_SET
00032         };
00033
00034         IOStream();
00035         virtual ~IOStream();
00036
00037         virtual bool    Open(const char* streamName, Mode mode = M_READ);
00038         virtual bool    Close();
00039
00040         virtual bool    IsOpened();
00041
00042         virtual size_t  Read(void* buffer, size_t bytes);
00043         virtual size_t  Write(const void* buffer, size_t bytes);
00044
00045         virtual int             Seek(long offset, SeekMode origin = SM_SET);
00046         virtual long    Tell();
00047
00048         virtual size_t  GetSize() const;
00049         virtual bool    Reserve(size_t size);
00050
00051 private:
00052
00053         void* m_handler;
00054 };
00055
00056 }//namespace glwebtools
00057
00058 inline glwebtools::IOStream::Mode operator|(glwebtools::IOStream::Mode lhs, glwebtools::IOStream::Mode rhs){unsigned int l = lhs; unsigned int r = rhs; return static_cast<glwebtools::IOStream::Mode>(l | r);}
00059 inline glwebtools::IOStream::Mode operator&(glwebtools::IOStream::Mode lhs, glwebtools::IOStream::Mode rhs){unsigned int l = lhs; unsigned int r = rhs; return static_cast<glwebtools::IOStream::Mode>(l & r);}
00060 inline glwebtools::IOStream::Mode operator^(glwebtools::IOStream::Mode lhs, glwebtools::IOStream::Mode rhs){unsigned int l = lhs; unsigned int r = rhs; return static_cast<glwebtools::IOStream::Mode>(l ^ r);}
00061 inline glwebtools::IOStream::Mode operator|=(glwebtools::IOStream::Mode& lhs, glwebtools::IOStream::Mode rhs){unsigned int l = lhs; unsigned int r = rhs; lhs = static_cast<glwebtools::IOStream::Mode>(l | r); return lhs;}
00062 inline glwebtools::IOStream::Mode operator&=(glwebtools::IOStream::Mode& lhs, glwebtools::IOStream::Mode rhs){unsigned int l = lhs; unsigned int r = rhs; lhs = static_cast<glwebtools::IOStream::Mode>(l & r); return lhs;}
00063 inline glwebtools::IOStream::Mode operator^=(glwebtools::IOStream::Mode& lhs, glwebtools::IOStream::Mode rhs){unsigned int l = lhs; unsigned int r = rhs; lhs = static_cast<glwebtools::IOStream::Mode>(l ^ r); return lhs;}
00064 inline glwebtools::IOStream::Mode operator~(glwebtools::IOStream::Mode lhs){unsigned int l = lhs; return static_cast<glwebtools::IOStream::Mode>(~l);}
00065
00066
00067 #endif //_GLWEBTOOLS_IOSTREAM_INCLUDED_


GLWebTools: glwebtools_jsonbase.h Source File

  • File List
glwebtools_jsonbase.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_JSONBASE_INCLUDED_
00003 #define _GLWEBTOOLS_JSONBASE_INCLUDED_
00004
00005 #include <glwebtools/glwebtools_error.h>
00006 #include <string>
00007 #include <vector>
00008
00009 namespace glwebtools
00010 {
00011         struct JSONValue
00012         {
00013                 JSONValue();
00014                 JSONValue(const std::string& value);
00015
00016                 operator const std::string&() const;
00017
00018                 std::string m_value;
00019         };
00020
00021         struct JSONObject
00022         {
00023                 typedef std::string key_type;
00024                 typedef const std::string& key_const_ref_type;
00025                 typedef std::vector<std::pair<key_type, JSONValue> > list_type;
00026
00027                 glwebtools::Error Set(key_const_ref_type key, const JSONValue& value);
00028                 glwebtools::Error Get(key_const_ref_type key, JSONValue& value) const;
00029
00030                 JSONValue& operator[](key_const_ref_type key);
00031                 const JSONValue& operator[](key_const_ref_type key) const;
00032
00033                 void Clear();
00034
00035                 list_type::iterator begin();
00036                 list_type::const_iterator begin() const;
00037                 list_type::iterator end();
00038                 list_type::const_iterator end() const;
00039
00040         private:
00041                 struct MatchKey
00042                 {
00043                         key_type m_key;
00044
00045                         MatchKey(key_const_ref_type key)
00046                                 :m_key(key)
00047                         {
00048                         }
00049
00050                         bool operator()(const std::pair<key_type, JSONValue>& item)
00051                         {
00052                                 return item.first == m_key;
00053                         }
00054                 };
00055
00056         private:
00057                 list_type m_values;
00058
00059                 static JSONValue s_invalid_value;
00060
00061         private:
00062                 list_type::iterator Find(key_const_ref_type key);
00063                 list_type::const_iterator Find(key_const_ref_type key) const;
00064         };
00065
00066         struct JSONArray
00067         {
00068                 typedef unsigned int key_type;
00069                 typedef unsigned int key_const_ref_type;
00070                 typedef std::vector<std::pair<key_type, JSONValue> > list_type;
00071
00072                 glwebtools::Error Set(key_const_ref_type key, const JSONValue& value);
00073                 glwebtools::Error Get(key_const_ref_type key, JSONValue& value) const;
00074
00075                 JSONValue& operator[](key_const_ref_type key);
00076                 const JSONValue& operator[](key_const_ref_type key) const;
00077
00078                 void Clear();
00079
00080                 list_type::iterator begin();
00081                 list_type::const_iterator begin() const;
00082                 list_type::iterator end();
00083                 list_type::const_iterator end() const;
00084
00085         private:
00086                 struct MatchKey
00087                 {
00088                         key_type m_key;
00089
00090                         MatchKey(key_const_ref_type key)
00091                                 :m_key(key)
00092                         {
00093                         }
00094
00095                         bool operator()(const std::pair<key_type, JSONValue>& item)
00096                         {
00097                                 return item.first == m_key;
00098                         }
00099                 };
00100
00101         private:
00102                 list_type m_values;
00103
00104                 static JSONValue s_invalid_value;
00105
00106         private:
00107                 list_type::iterator Find(key_const_ref_type key);
00108                 list_type::const_iterator Find(key_const_ref_type key) const;
00109         };
00110
00111
00113         template <typename GLWEBTOOLS_VALUE>
00114         struct NameValuePair
00115         {
00116                 std::string m_name;
00117                 GLWEBTOOLS_VALUE* m_valueRef;
00118
00119                 NameValuePair(const std::string& name, GLWEBTOOLS_VALUE& value)
00120                         :m_name(name), m_valueRef(&value)
00121                 {
00122                 }
00123
00124                 NameValuePair(const char* name, GLWEBTOOLS_VALUE& value)
00125                         :m_name(name), m_valueRef(&value)
00126                 {
00127                 }
00128
00129                 const std::string& Key() const
00130                 {
00131                         return m_name;
00132                 }
00133
00134                 GLWEBTOOLS_VALUE& Value()
00135                 {
00136                         return *m_valueRef;
00137                 }
00138         };
00139
00141         template <typename GLWEBTOOLS_VALUE>
00142         struct IndexedValue
00143         {
00144                 unsigned int m_index;
00145                 GLWEBTOOLS_VALUE* m_valueRef;
00146
00147                 IndexedValue(unsigned int index, GLWEBTOOLS_VALUE& value)
00148                         :m_index(index), m_valueRef(&value)
00149                 {
00150                 }
00151
00152                 unsigned int Key() const
00153                 {
00154                         return m_index;
00155                 }
00156
00157                 GLWEBTOOLS_VALUE& Value()
00158                 {
00159                         return *m_valueRef;
00160                 }
00161         };
00162
00164         template <typename GLWEBTOOLS_ITERATOR, typename GLWEBTOOLS_VALUE>
00165         struct IncludedItems
00166         {
00167                 GLWEBTOOLS_ITERATOR m_begin;
00168                 GLWEBTOOLS_ITERATOR m_end;
00169                 GLWEBTOOLS_VALUE* m_value;
00170         };
00171
00172
00173         template <typename GLWEBTOOLS_KEY, size_t N, typename GLWEBTOOLS_VALUE>
00174         IncludedItems<GLWEBTOOLS_KEY*, GLWEBTOOLS_VALUE> IncludeItems(GLWEBTOOLS_KEY (&container)[N], GLWEBTOOLS_VALUE& value)
00175         {
00176                 IncludedItems<GLWEBTOOLS_KEY*, GLWEBTOOLS_VALUE>  items;
00177                 items.m_begin = (GLWEBTOOLS_KEY*)container;
00178                 items.m_end = (GLWEBTOOLS_KEY*)container+N;
00179                 items.m_value = &value;
00180
00181                 return items;
00182         }
00183
00185         template <typename GLWEBTOOLS_ITERATOR, typename GLWEBTOOLS_VALUE>
00186         struct ExcludedItems
00187         {
00188                 GLWEBTOOLS_ITERATOR m_begin;
00189                 GLWEBTOOLS_ITERATOR m_end;
00190                 GLWEBTOOLS_VALUE* m_value;
00191         };
00192
00193         template <typename GLWEBTOOLS_KEY, size_t N, typename GLWEBTOOLS_VALUE>
00194         ExcludedItems<GLWEBTOOLS_KEY*, GLWEBTOOLS_VALUE> ExcludeItems(GLWEBTOOLS_KEY (&container)[N], GLWEBTOOLS_VALUE& value)
00195         {
00196                 ExcludedItems<GLWEBTOOLS_KEY*, GLWEBTOOLS_VALUE>  items;
00197                 items.m_begin = (GLWEBTOOLS_KEY*)container;
00198                 items.m_end = (GLWEBTOOLS_KEY*)container+N;
00199                 items.m_value = &value;
00200
00201                 return items;
00202         }
00203
00204 }//glwebtools
00205
00206 #endif // _GLWEBTOOLS_JSONBASE_INCLUDED_


GLWebTools: glwebtools_jsonreader.h Source File

  • File List
glwebtools_jsonreader.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_JSONREADER_INCLUDED_
00003 #define _GLWEBTOOLS_JSONREADER_INCLUDED_
00004
00005 #include <glwebtools/serialization/jsoncpp/glwebtools_json.h>
00006 #include <string>
00007 #include <vector>
00008 #include <set>
00009 #include <map>
00010
00011 #include <glwebtools/glwebtools_error.h>
00012 #include <glwebtools/serialization/glwebtools_argumentwrapper.h>
00013 #include <glwebtools/internal/glwebtools_common.h>
00014 #include <glwebtools/serialization/glwebtools_jsonbase.h>
00015
00016 namespace glwebtools
00017 {
00018         class CustomArgument;
00019         class CustomAttributeList;
00020
00022         class JsonReader
00023         {
00024         public:
00026                 class Iterator
00027                 {
00028                 public:
00029                         typedef unsigned int size_t;
00030                         typedef int difference_type;
00031                         typedef JsonReader reference;
00032
00033                 public:
00035                         Iterator();
00037                         Iterator(const Iterator& other);
00039                         Iterator& operator=(const Iterator& other);
00040
00042                         Iterator operator++( int );
00044                         Iterator operator--( int );
00046                         Iterator& operator--();
00048                         Iterator& operator++();
00049
00051                         bool operator==( const Iterator& other ) const;
00053                         bool operator!=( const Iterator& other ) const;
00055                         reference operator*() const;
00056
00057                 public:
00059                         std::string name() const;
00061                         unsigned int index() const;
00062
00063                 private:
00064                         explicit Iterator(glwebtools::Json::Value::iterator iterator);
00065
00066                 private:
00068                         glwebtools::Json::Value::iterator m_iterator;
00069
00070                         friend class JsonReader;
00071                 };
00072
00073         public:
00074                 typedef Iterator const_iterator;
00075
00076         public:
00078                 JsonReader();
00079
00083                 explicit JsonReader(const std::string& data);
00084
00088                 explicit JsonReader(const char* data);
00089
00090         public:
00096                 glwebtools::Error parse(const std::string& data);
00097
00103                 glwebtools::Error parse(const char* data);
00104
00105         public:
00112                 glwebtools::Error read(short& value) const;
00113
00120                 glwebtools::Error read(unsigned short& value) const;
00121
00128                 glwebtools::Error read(int& value) const;
00129
00136                 glwebtools::Error read(unsigned int& value) const;
00137
00144                 glwebtools::Error read(double& value) const;
00145
00152                 glwebtools::Error read(bool& value) const;
00153
00160                 glwebtools::Error read(std::string& value) const;
00161
00168                 glwebtools::Error read(glwebtools::CustomArgument& argument) const;
00169
00176                 glwebtools::Error read(glwebtools::CustomAttributeList& attribute) const;
00177
00184                 glwebtools::Error read(glwebtools::JSONValue& argument) const;
00185
00192                 glwebtools::Error read(glwebtools::JSONObject& value) const;
00193
00200                 glwebtools::Error read(glwebtools::JSONArray& value) const;
00201
00208                 template <typename GLWEBTOOLS_VALUE>
00209                 glwebtools::Error read(GLWEBTOOLS_VALUE& value) const
00210                 {
00211                         if (IsValid() == false)
00212                                 return E_INVALID_OPERATION;
00213
00214                         return value.read(*this);
00215                 }
00216
00223                 template <typename GLWEBTOOLS_VALUE>
00224                 glwebtools::Error read(NameValuePair<GLWEBTOOLS_VALUE> value) const
00225                 {
00226                         if (IsValid() == false)
00227                                 return E_INVALID_OPERATION;
00228
00229                         if (isObject() == false)
00230                                 return E_INVALID_OPERATION;
00231
00232                         if (m_root.isMember(value.Key()) == false)
00233                                 return E_INVALID_PARAMETER;
00234
00235                         JsonReader reader(m_root[value.Key()]);
00236                         return reader >> value.Value();
00237                 }
00238
00245                 template <typename GLWEBTOOLS_VALUE, typename GLWEBTOOLS_VALIDATOR, typename GLWEBTOOLS_FORMATTER>
00246                 glwebtools::Error read(NameValuePair<glwebtools::OptionalArgument<GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER> > value) const
00247                 {
00248                         if (IsValid() == false)
00249                                 return E_SUCCESS;
00250
00251                         if (isObject() == false)
00252                                 return E_SUCCESS;
00253
00254                         if (m_root.isMember(value.Key()) == false)
00255                                 return E_SUCCESS;
00256
00257                         JsonReader reader(m_root[value.Key()]);
00258                         return reader >> value.Value();
00259                 }
00260
00267                 template <typename GLWEBTOOLS_VALUE>
00268                 glwebtools::Error read(IndexedValue<GLWEBTOOLS_VALUE> value) const
00269                 {
00270                         if (IsValid() == false)
00271                                 return E_INVALID_OPERATION;
00272
00273                         if (isArray() == false)
00274                                 return E_INVALID_OPERATION;
00275
00276                         if (m_root.isValidIndex(value.Key()) == false)
00277                                 return E_INVALID_PARAMETER;
00278
00279                         JsonReader reader(m_root[value.Key()]);
00280                         return reader >> value.Value();
00281                 }
00282
00289                 template <typename GLWEBTOOLS_ITERATOR, typename GLWEBTOOLS_VALUE>
00290                 glwebtools::Error read(IncludedItems<GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE> value) const
00291                 {
00292                         return include(value.m_begin, value.m_end, *value.m_value);
00293                 }
00294
00301                 template <typename GLWEBTOOLS_ITERATOR, typename GLWEBTOOLS_VALUE>
00302                 glwebtools::Error read(ExcludedItems<GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE> value) const
00303                 {
00304                         return exclude(value.m_begin, value.m_end, *value.m_value);
00305                 }
00306
00313                 template <typename GLWEBTOOLS_VALUE, typename GLWEBTOOLS_VALIDATOR, typename GLWEBTOOLS_FORMATTER>
00314                 glwebtools::Error read(IndexedValue<glwebtools::OptionalArgument<GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER> > value) const
00315                 {
00316                         if (IsValid() == false)
00317                                 return E_SUCCESS;
00318
00319                         if (isArray() == false)
00320                                 return E_SUCCESS;
00321
00322                         if (m_root.isValidIndex(value.Key()) == false)
00323                                 return E_SUCCESS;
00324
00325                         JsonReader reader(m_root[value.Key()]);
00326                         return reader >> value.Value();
00327                 }
00328
00335                 template <typename GLWEBTOOLS_VALUE, typename GLWEBTOOLS_VALIDATOR, typename GLWEBTOOLS_FORMATTER>
00336                 glwebtools::Error read(glwebtools::OptionalArgument<GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER>& value) const
00337                 {
00338                         if (IsValid() == false)
00339                                 return E_SUCCESS;
00340
00341                         GLWEBTOOLS_VALUE raw_value;
00342                         GLWEBTOOLS_RETURN_ERROR_ON_FAIL((*this) >> raw_value);
00343                         value = raw_value;
00344
00345                         return E_SUCCESS;
00346                 }
00347
00354                 template <typename GLWEBTOOLS_VALUE, typename GLWEBTOOLS_VALIDATOR, typename GLWEBTOOLS_FORMATTER>
00355                 glwebtools::Error read(glwebtools::RequiredArgument<GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER>& value) const
00356                 {
00357                         GLWEBTOOLS_VALUE raw_value;
00358                         GLWEBTOOLS_RETURN_ERROR_ON_FAIL((*this) >> raw_value);
00359                         value = raw_value;
00360
00361                         return E_SUCCESS;
00362                 }
00363
00370                 template <typename GLWEBTOOLS_VALUE, typename GLWEBTOOLS_ALLOCATOR>
00371                 glwebtools::Error read(std::vector<GLWEBTOOLS_VALUE, GLWEBTOOLS_ALLOCATOR>& container) const
00372                 {
00373                         container.clear();
00374                         for (glwebtools::JsonReader::const_iterator it = begin(); it != end(); ++it)
00375                         {
00376                                 GLWEBTOOLS_VALUE item;
00377                                 GLWEBTOOLS_RETURN_ERROR_ON_FAIL((*it) >> item);
00378
00379                                 container.push_back(item);
00380                         }
00381
00382                         return glwebtools::E_SUCCESS;
00383                 }
00384
00391                 template <typename GLWEBTOOLS_VALUE, typename GLWEBTOOLS_COMPARE, typename GLWEBTOOLS_ALLOCATOR>
00392                 glwebtools::Error read(std::set<GLWEBTOOLS_VALUE, GLWEBTOOLS_COMPARE, GLWEBTOOLS_ALLOCATOR>& container) const
00393                 {
00394                         container.clear();
00395                         for (glwebtools::JsonReader::const_iterator it = begin(); it != end(); ++it)
00396                         {
00397                                 GLWEBTOOLS_VALUE item;
00398                                 GLWEBTOOLS_RETURN_ERROR_ON_FAIL((*it) >> item);
00399
00400                                 container.insert(item);
00401                         }
00402
00403                         return glwebtools::E_SUCCESS;
00404                 }
00405
00412                 template <typename GLWEBTOOLS_KEY, typename GLWEBTOOLS_VALUE, typename GLWEBTOOLS_COMPARE, typename GLWEBTOOLS_ALLOCATOR>
00413                 glwebtools::Error read(std::map<GLWEBTOOLS_KEY, GLWEBTOOLS_VALUE, GLWEBTOOLS_COMPARE, GLWEBTOOLS_ALLOCATOR>& container) const
00414                 {
00415                         container.clear();
00416                         for (glwebtools::JsonReader::const_iterator it = begin(); it != end(); ++it)
00417                         {
00418                                 GLWEBTOOLS_VALUE item;
00419                                 GLWEBTOOLS_RETURN_ERROR_ON_FAIL((*it) >> item);
00420
00421                                 container[it.name()] = item;
00422                         }
00423
00424                         return glwebtools::E_SUCCESS;
00425                 }
00426
00427         public:
00434                 glwebtools::Error include(const char** begin, const char** end, glwebtools::CustomAttributeList& value) const;
00435
00442                 glwebtools::Error include(const char** begin, const char** end, glwebtools::JSONObject& value) const;
00443
00450                 glwebtools::Error include(size_t* begin, size_t* end, glwebtools::JSONArray& value) const;
00451
00458                 glwebtools::Error exclude(const char** begin, const char** end, glwebtools::CustomAttributeList& value) const;
00459
00466                 glwebtools::Error exclude(const char** begin, const char** end, glwebtools::JSONObject& value) const;
00467
00474                 glwebtools::Error exclude(size_t* begin, size_t* end, glwebtools::JSONArray& value) const;
00475
00476         public:
00481                 JsonReader operator[](unsigned int index) const;
00482
00487                 JsonReader operator[](const std::string& name) const;
00488
00493                 JsonReader operator[](const char* name) const;
00494
00495         public:
00500                 bool IsValid() const;
00501
00502         public:
00507                 bool isInt() const;
00508
00513                 bool isUInt() const;
00514
00515
00520                 bool isDouble() const;
00521
00526                 bool isBool() const;
00527
00532                 bool isString() const;
00533
00538                 bool isObject() const;
00539
00544                 bool isArray() const;
00545
00546         public:
00551                 Iterator begin() const;
00552
00557                 Iterator end() const;
00558
00562                 size_t size() const;
00563
00564         public:
00569                 template <typename GLWEBTOOLS_VALUE>
00570                 static IndexedValue<GLWEBTOOLS_VALUE> ByIndex(unsigned int index, GLWEBTOOLS_VALUE& value)
00571                 {
00572                         return IndexedValue<GLWEBTOOLS_VALUE>(index, value);
00573                 }
00574
00579                 template <typename GLWEBTOOLS_VALUE>
00580                 static NameValuePair<GLWEBTOOLS_VALUE> ByName(const std::string& name, GLWEBTOOLS_VALUE& value)
00581                 {
00582                         return NameValuePair<GLWEBTOOLS_VALUE>(name, value);
00583                 }
00584
00589                 template <typename GLWEBTOOLS_VALUE>
00590                 static NameValuePair<GLWEBTOOLS_VALUE> ByName(const char* name, GLWEBTOOLS_VALUE& value)
00591                 {
00592                         return NameValuePair<GLWEBTOOLS_VALUE>(name, value);
00593                 }
00594
00595         public:
00599                 std::string ToString() const;
00600
00604                 void ToString(std::string& result) const;
00605
00606         private:
00607                 explicit JsonReader(const glwebtools::Json::Value& root);
00608
00609         private:
00611                 glwebtools::Json::Value m_root;   // will contains the root value after parsing.
00612
00613                 friend class Iterator;
00614         };
00615
00620         template <typename GLWEBTOOLS_VALUE>
00621         glwebtools::Error operator>>(const JsonReader& reader, GLWEBTOOLS_VALUE& value)
00622         {
00623                 return reader.read(value);
00624         }
00625
00630         template <typename GLWEBTOOLS_VALUE>
00631         glwebtools::Error operator>>(const JsonReader& reader, NameValuePair<GLWEBTOOLS_VALUE> value)
00632         {
00633                 return reader.read(value);
00634         }
00635
00640         template <typename GLWEBTOOLS_VALUE>
00641         glwebtools::Error operator>>(const JsonReader& reader, IndexedValue<GLWEBTOOLS_VALUE> value)
00642         {
00643                 return reader.read(value);
00644         }
00645
00646
00651         template <typename GLWEBTOOLS_ITERATOR, typename GLWEBTOOLS_VALUE>
00652         glwebtools::Error operator>>(const JsonReader& reader, IncludedItems<GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE> value)
00653         {
00654                 return reader.read(value);
00655         }
00656
00661         template <typename GLWEBTOOLS_ITERATOR, typename GLWEBTOOLS_VALUE>
00662         glwebtools::Error operator>>(const JsonReader& reader, ExcludedItems<GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE> value)
00663         {
00664                 return reader.read(value);
00665         }
00666
00671         template <typename GLWEBTOOLS_VALUE, size_t N>
00672         glwebtools::Error operator>>(const JsonReader& reader, GLWEBTOOLS_VALUE (&container)[N])
00673         {
00674                 if (reader.size()>N)
00675                         return E_INVALID_PARAMETER;
00676
00677                 GLWEBTOOLS_VALUE* pContainer = &container[0];
00678
00679                 for (glwebtools::JsonReader::const_iterator it = reader.begin(); it != reader.end(); ++it)
00680                 {
00681                         GLWEBTOOLS_VALUE item;
00682                         GLWEBTOOLS_RETURN_ERROR_ON_FAIL((*it) >> item);
00683
00684                         *pContainer++ = item;
00685                 }
00686
00687                 return glwebtools::E_SUCCESS;
00688         }
00689
00694         template <typename GLWEBTOOLS_VALUE>
00695         IndexedValue<GLWEBTOOLS_VALUE> ByIndex(unsigned int index, GLWEBTOOLS_VALUE& value)
00696         {
00697                 return JsonReader::ByIndex(index, value);
00698         }
00699
00704         template <typename GLWEBTOOLS_VALUE>
00705         NameValuePair<GLWEBTOOLS_VALUE> ByName(const std::string& name, GLWEBTOOLS_VALUE& value)
00706         {
00707                 return JsonReader::ByName(name, value);
00708         }
00709
00714         template <typename GLWEBTOOLS_VALUE>
00715          NameValuePair<GLWEBTOOLS_VALUE> ByName(const char* name, GLWEBTOOLS_VALUE& value)
00716         {
00717                 return JsonReader::ByName(name, value);
00718         }
00719
00720 }//glwebtools
00721
00722
00723 #endif//_GLWEBTOOLS_JSONREADER_INCLUDED_


GLWebTools: glwebtools_jsonwriter.h Source File

  • File List
glwebtools_jsonwriter.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_JSONWRITER_INCLUDED_
00003 #define _GLWEBTOOLS_JSONWRITER_INCLUDED_
00004
00005 #include <glwebtools/serialization/jsoncpp/glwebtools_json.h>
00006 #include <string>
00007 #include <vector>
00008 #include <set>
00009 #include <map>
00010
00011 #include <glwebtools/glwebtools_error.h>
00012 #include <glwebtools/internal/glwebtools_common.h>
00013 #include <glwebtools/serialization/glwebtools_argumentwrapper.h>
00014 #include <glwebtools/serialization/glwebtools_jsonbase.h>
00015
00016 namespace glwebtools
00017 {
00018         class CustomArgument;
00019         class CustomAttributeList;
00020
00022         class JsonWriter
00023         {
00024         public:
00026                 JsonWriter();
00027
00031                 template <typename GLWEBTOOLS_VALUE>
00032                 explicit JsonWriter(GLWEBTOOLS_VALUE value)
00033                 {
00034                         write(value);
00035                 }
00036
00037         public:
00042                 glwebtools::Error write(int value);
00043
00048                 glwebtools::Error write(unsigned int value);
00049
00054                 glwebtools::Error write(double value);
00055
00060                 glwebtools::Error write(float value);
00061
00066                 glwebtools::Error write(bool value);
00067
00072                 glwebtools::Error write(const std::string& value);
00073
00078                 glwebtools::Error write(const char* value);
00079
00084                 template <typename GLWEBTOOLS_VALUE>
00085                 glwebtools::Error write(const GLWEBTOOLS_VALUE& value)
00086                 {
00087                         GetRoot() = glwebtools::Json::Value();
00088                         return value.write(*this);
00089                 }
00090
00095                 template <typename GLWEBTOOLS_VALUE>
00096                 glwebtools::Error write(NameValuePair<GLWEBTOOLS_VALUE> value)
00097                 {
00098                         return insert(value.Key(), value.Value());
00099                 }
00100
00105                 template <typename GLWEBTOOLS_VALUE, typename GLWEBTOOLS_VALIDATOR, typename GLWEBTOOLS_FORMATTER>
00106                 glwebtools::Error write(NameValuePair<const glwebtools::OptionalArgument<GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER> > value)
00107                 {
00108                         if (value.Value().IsSet() == false)
00109                                 return E_SUCCESS;
00110
00111                         return insert(value.Key(), value.Value());
00112                 }
00113
00118                 template <typename GLWEBTOOLS_VALUE, typename GLWEBTOOLS_VALIDATOR, typename GLWEBTOOLS_FORMATTER>
00119                 glwebtools::Error write(NameValuePair<const glwebtools::RequiredArgument<GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER> > value)
00120                 {
00121                         if (value.Value().IsSet() == false)
00122                                 return E_INVALID_PARAMETER;
00123
00124                         return insert(value.Key(), value.Value());
00125                 }
00126
00131                 template <typename GLWEBTOOLS_VALUE>
00132                 glwebtools::Error write(IndexedValue<GLWEBTOOLS_VALUE> value)
00133                 {
00134                         return insert(value.Key(), value.Value());
00135                 }
00136
00141                 template <typename GLWEBTOOLS_VALUE, typename GLWEBTOOLS_VALIDATOR, typename GLWEBTOOLS_FORMATTER>
00142                 glwebtools::Error write(IndexedValue<const glwebtools::OptionalArgument<GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER> > value)
00143                 {
00144                         if (value.Value().IsSet() == false)
00145                                 return E_SUCCESS;
00146
00147                         return insert(value.Key(), value.Value());
00148                 }
00149
00154                 template <typename GLWEBTOOLS_VALUE, typename GLWEBTOOLS_VALIDATOR, typename GLWEBTOOLS_FORMATTER>
00155                 glwebtools::Error write(IndexedValue<const glwebtools::RequiredArgument<GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER> > value)
00156                 {
00157                         if (value.Value().IsSet() == false)
00158                                 return E_INVALID_PARAMETER;
00159
00160                         return insert(value.Key(), value.Value());
00161                 }
00162
00167                 template <typename GLWEBTOOLS_ITERATOR, typename GLWEBTOOLS_VALUE>
00168                 glwebtools::Error write(IncludedItems<GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE> value)
00169                 {
00170                         return include(value.m_begin, value.m_end, *value.m_value);
00171                 }
00172
00177                 template <typename GLWEBTOOLS_ITERATOR, typename GLWEBTOOLS_VALUE>
00178                 glwebtools::Error write(ExcludedItems<GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE> value)
00179                 {
00180                         return exclude(value.m_begin, value.m_end, *value.m_value);
00181                 }
00182
00187                 template <typename GLWEBTOOLS_VALUE, typename GLWEBTOOLS_VALIDATOR, typename GLWEBTOOLS_FORMATTER>
00188                 glwebtools::Error write(const glwebtools::OptionalArgument<GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER>& value)
00189                 {
00190                         if (value.IsSet() == false)
00191                                 return E_SUCCESS;
00192
00193                         return (*this) << value.Value();
00194                 }
00195
00200                 template <typename GLWEBTOOLS_VALUE, typename GLWEBTOOLS_VALIDATOR, typename GLWEBTOOLS_FORMATTER>
00201                 glwebtools::Error write(const glwebtools::RequiredArgument<GLWEBTOOLS_VALUE, GLWEBTOOLS_VALIDATOR, GLWEBTOOLS_FORMATTER>& value)
00202                 {
00203                         if (value.IsSet() == false)
00204                                 return E_INVALID_PARAMETER;
00205
00206                         return (*this) << value.Value();
00207                 }
00208
00213                 glwebtools::Error write(const glwebtools::CustomArgument& argument);
00214
00219                 glwebtools::Error write(const glwebtools::CustomAttributeList& argument);
00220
00225                 glwebtools::Error write(const glwebtools::JSONValue& argument);
00226
00231                 glwebtools::Error write(NameValuePair<const glwebtools::JSONObject> argument);
00232
00237                 glwebtools::Error write(IndexedValue<const glwebtools::JSONArray> argument);
00238
00243                 glwebtools::Error write(const glwebtools::JSONObject& argument);
00244
00249                 glwebtools::Error write(const glwebtools::JSONArray& argument);
00250
00256                 template <typename ITERATOR>
00257                 glwebtools::Error write(ITERATOR begin, ITERATOR end)
00258                 {
00259                         for (ITERATOR it = begin; it!= end; ++it)
00260                         {
00261                                 GLWEBTOOLS_RETURN_ERROR_ON_FAIL(append(*it));
00262                         }
00263
00264                         return E_SUCCESS;
00265                 }
00266
00267                 template <typename GLWEBTOOLS_VALUE, typename ALLOCATOR>
00268                 glwebtools::Error write(const std::vector<GLWEBTOOLS_VALUE, ALLOCATOR>& container)
00269                 {
00270                         return write(container.begin(), container.end());
00271                 }
00272
00273                 template <typename GLWEBTOOLS_VALUE, typename GLWEBTOOLS_COMPARE, typename ALLOCATOR>
00274                 glwebtools::Error write(const std::set<GLWEBTOOLS_VALUE, GLWEBTOOLS_COMPARE, ALLOCATOR>& container)
00275                 {
00276                         return write(container.begin(), container.end());
00277                 }
00278
00279                 template <typename GLWEBTOOLS_KEY, typename GLWEBTOOLS_VALUE, typename GLWEBTOOLS_COMPARE, typename GLWEBTOOLS_ALLOCATOR>
00280                 glwebtools::Error write(const std::map<GLWEBTOOLS_KEY, GLWEBTOOLS_VALUE, GLWEBTOOLS_COMPARE, GLWEBTOOLS_ALLOCATOR>& container)
00281                 {
00282                         typedef std::map<GLWEBTOOLS_KEY, GLWEBTOOLS_VALUE, GLWEBTOOLS_COMPARE, GLWEBTOOLS_ALLOCATOR> map_type;
00283                         typedef typename std::map<GLWEBTOOLS_KEY, GLWEBTOOLS_VALUE, GLWEBTOOLS_COMPARE, GLWEBTOOLS_ALLOCATOR>::const_iterator const_iterator;
00284
00285                         for (const_iterator it = container.begin(); it !=  container.end(); ++it)
00286                         {
00287                                 GLWEBTOOLS_RETURN_ERROR_ON_FAIL(insert(it->first, it->second));
00288                         }
00289
00290                         return E_SUCCESS;
00291                 }
00292
00293         public:
00294
00300                 glwebtools::Error include(const char** begin, const char** end, const glwebtools::CustomAttributeList& value);
00301
00307                 glwebtools::Error include(const char** begin, const char** end, const glwebtools::JSONObject& value);
00308
00314                 glwebtools::Error include(size_t* begin, size_t* end, const glwebtools::JSONArray& value);
00315
00321                 glwebtools::Error exclude(const char** begin, const char** end, const glwebtools::CustomAttributeList& value);
00322
00328                 glwebtools::Error exclude(const char** begin, const char** end, const glwebtools::JSONObject& value);
00329
00335                 glwebtools::Error exclude(size_t* begin, size_t* end, const glwebtools::JSONArray& value);
00336
00337         public:
00342                 template <typename GLWEBTOOLS_VALUE>
00343                 glwebtools::Error append(const GLWEBTOOLS_VALUE& value)
00344                 {
00345                         if (isArray() == false)
00346                         {
00347                                 GetRoot() = glwebtools::Json::Value(glwebtools::Json::arrayValue);
00348                         }
00349
00350                         glwebtools::JsonWriter writer;
00351                         GLWEBTOOLS_RETURN_ERROR_ON_FAIL(writer << value);
00352
00353                         GetRoot().append(writer.GetRoot());
00354
00355                         return E_SUCCESS;
00356                 }
00357
00358         public:
00364                 template <typename GLWEBTOOLS_VALUE>
00365                 glwebtools::Error insert(unsigned int index, const GLWEBTOOLS_VALUE& value)
00366                 {
00367                         if (isArray() == false)
00368                         {
00369                                 GetRoot() = glwebtools::Json::Value(glwebtools::Json::arrayValue);
00370                         }
00371
00372                         glwebtools::JsonWriter writer;
00373                         GLWEBTOOLS_RETURN_ERROR_ON_FAIL(writer << value);
00374
00375                         GetRoot()[index] = writer.GetRoot();
00376
00377                         return E_SUCCESS;
00378                 }
00379
00385                 template <typename GLWEBTOOLS_VALUE>
00386                 glwebtools::Error insert(const std::string& name, const GLWEBTOOLS_VALUE& value)
00387                 {
00388                         if (isObject() == false)
00389                         {
00390                                 GetRoot() = glwebtools::Json::Value(glwebtools::Json::objectValue);
00391                         }
00392
00393                         glwebtools::JsonWriter writer;
00394                         GLWEBTOOLS_RETURN_ERROR_ON_FAIL(writer << value);
00395
00396                         GetRoot()[name] = writer.GetRoot();
00397
00398                         return E_SUCCESS;
00399                 }
00400
00406                 template <typename GLWEBTOOLS_VALUE>
00407                 glwebtools::Error insert(const char* name, const GLWEBTOOLS_VALUE& value)
00408                 {
00409                         if (isObject() == false)
00410                         {
00411                                 GetRoot() = glwebtools::Json::Value(glwebtools::Json::objectValue);
00412                         }
00413
00414                         glwebtools::JsonWriter writer;
00415                         GLWEBTOOLS_RETURN_ERROR_ON_FAIL(writer << value);
00416
00417                         GetRoot()[name] = writer.GetRoot();
00418
00419                         return E_SUCCESS;
00420                 }
00421
00422         public:
00427                 JsonWriter operator[](unsigned int index) ;
00428
00433                 JsonWriter operator[](const std::string& name) ;
00434
00439                 JsonWriter operator[](const char* name) ;
00440
00441         public:
00446                 bool IsValid() const;
00447
00448         public:
00453                 bool isInt() const;
00454
00459                 bool isUInt() const;
00460
00461
00466                 bool isDouble() const;
00467
00472                 bool isBool() const;
00473
00478                 bool isString() const;
00479
00484                 bool isObject() const;
00485
00490                 bool isArray() const;
00491
00492
00493         public:
00497                 std::string ToString() const;
00498
00502                 void ToString(std::string& result) const;
00503
00504         public:
00508                 std::string ToPrettyString() const;
00509
00513                 void ToPrettyString(std::string& result) const;
00514
00515
00516         public:
00517                 template <typename GLWEBTOOLS_VALUE>
00518                 static IndexedValue<const GLWEBTOOLS_VALUE> ByIndex(unsigned int index, const GLWEBTOOLS_VALUE& value)
00519                 {
00520                         return IndexedValue<const GLWEBTOOLS_VALUE>(index, value);
00521                 }
00522
00523                 template <typename GLWEBTOOLS_VALUE>
00524                 static NameValuePair<const GLWEBTOOLS_VALUE> ByName(const std::string& name, const GLWEBTOOLS_VALUE& value)
00525                 {
00526                         return NameValuePair<const GLWEBTOOLS_VALUE>(name, value);
00527                 }
00528
00529                 template <typename GLWEBTOOLS_VALUE>
00530                 static NameValuePair<const GLWEBTOOLS_VALUE> ByName(const char* name, const GLWEBTOOLS_VALUE& value)
00531                 {
00532                         return NameValuePair<const GLWEBTOOLS_VALUE>(name, value);
00533                 }
00534
00535         private:
00536                 explicit JsonWriter(glwebtools::Json::Value& root);
00537
00538         private:
00539                 glwebtools::Json::Value& GetRoot();
00540                 const glwebtools::Json::Value& GetRoot() const;
00541
00542         private:
00543                 glwebtools::Json::Value m_root;
00544                 glwebtools::Json::Value* m_currentRoot;
00545         };
00546
00547         template <typename GLWEBTOOLS_VALUE>
00548         glwebtools::Error operator<<(JsonWriter& writer, const GLWEBTOOLS_VALUE& value)
00549         {
00550                 return writer.write(value);
00551         }
00552
00553         template <typename GLWEBTOOLS_VALUE, size_t N>
00554         glwebtools::Error operator<<(JsonWriter& writer, const GLWEBTOOLS_VALUE (&container)[N])
00555         {
00556                 return writer.write(container, container+N);
00557         }
00558
00559         glwebtools::Error operator<<(JsonWriter& writer, const char* value);
00560
00561         template <typename GLWEBTOOLS_VALUE>
00562         glwebtools::Error operator<<(JsonWriter& writer, NameValuePair<GLWEBTOOLS_VALUE> value)
00563         {
00564                 return writer.write(value);
00565         }
00566
00567         template <typename GLWEBTOOLS_VALUE>
00568         glwebtools::Error operator<<(JsonWriter& writer, IndexedValue<GLWEBTOOLS_VALUE> value)
00569         {
00570                 return writer.write(value);
00571         }
00572
00577         template <typename GLWEBTOOLS_ITERATOR, typename GLWEBTOOLS_VALUE>
00578         glwebtools::Error operator<<(JsonWriter& writer, IncludedItems<GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE> value)
00579         {
00580                 return writer.write(value);
00581         }
00582
00587         template <typename GLWEBTOOLS_ITERATOR, typename GLWEBTOOLS_VALUE>
00588         glwebtools::Error operator<<(JsonWriter& writer, ExcludedItems<GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE> value)
00589         {
00590                 return writer.write(value);
00591         }
00592
00593         template <typename GLWEBTOOLS_VALUE>
00594         IndexedValue<const GLWEBTOOLS_VALUE> ByIndex(unsigned int index, const GLWEBTOOLS_VALUE& value)
00595         {
00596                 return JsonWriter::ByIndex(index, value);
00597         }
00598
00599         template <typename GLWEBTOOLS_VALUE>
00600         NameValuePair<const GLWEBTOOLS_VALUE> ByName(const std::string& name, const GLWEBTOOLS_VALUE& value)
00601         {
00602                 return JsonWriter::ByName(name, value);
00603         }
00604
00605         template <typename GLWEBTOOLS_VALUE>
00606          NameValuePair<const GLWEBTOOLS_VALUE> ByName(const char* name, const GLWEBTOOLS_VALUE& value)
00607         {
00608                 return JsonWriter::ByName(name, value);
00609         }
00610
00611
00612 }//glwebtools
00613
00614
00615 #endif//_GLWEBTOOLS_JSONWRITER_INCLUDED_


GLWebTools: glwebtools_macro.h Source File

  • File List
glwebtools_macro.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_MACRO_INCLUDED_
00003 #define _GLWEBTOOLS_MACRO_INCLUDED_
00004
00005 #include <glwebtools/internal/glwebtools_default_config.h>
00006 #include <glwebtools/os/glwebtools_console.h>
00007
00008 #if GLWEBTOOLS_ENABLE_CONSOLE
00009 #define GLWEBTOOLS_LOG_FATAL_ERROR(X, ...) glwebtools::Console::Print(1, X, __VA_ARGS__)
00010 #define GLWEBTOOLS_LOG_MAJOR_ERROR(X, ...) glwebtools::Console::Print(2, X, __VA_ARGS__)
00011 #define GLWEBTOOLS_LOG_MINOR_ERROR(X, ...) glwebtools::Console::Print(3, X, __VA_ARGS__)
00012 #define GLWEBTOOLS_LOG_INFO(X, ...)        glwebtools::Console::Print(4, X, __VA_ARGS__)
00013 #define GLWEBTOOLS_LOG_VERBOSE(X, ...)     glwebtools::Console::Print(5, X, __VA_ARGS__)
00014 #else
00015 #define GLWEBTOOLS_LOG_FATAL_ERROR(...)
00016 #define GLWEBTOOLS_LOG_MAJOR_ERROR(...)
00017 #define GLWEBTOOLS_LOG_MINOR_ERROR(...)
00018 #define GLWEBTOOLS_LOG_INFO(...)
00019 #define GLWEBTOOLS_LOG_VERBOSE(...)
00020 #endif // GLWEBTOOLS_ENABLE_CONSOLE
00021
00022 #ifndef  GLWEBTOOLS_DEBUG
00023 #define GLWEBTOOLS_INTERNAL_ASSERT(X)     ((void)0)
00024 #else // GLWEBTOOLS_DEBUG
00025 #include <cassert>
00026 #define GLWEBTOOLS_INTERNAL_ASSERT(X)     assert(X)
00027 #endif // GLWEBTOOLS_DEBUG
00028
00029 // assert pre-condition
00030 #define GLWEBTOOLS_PRE(X) GLWEBTOOLS_INTERNAL_ASSERT(X)
00031 // assert post-condition
00032 #define GLWEBTOOLS_POST(X) GLWEBTOOLS_INTERNAL_ASSERT(X)
00033
00034 #endif


GLWebTools: glwebtools_md5.h Source File

  • File List
glwebtools_md5.h
00001 /*
00002   Copyright (C) 1999, 2002 Aladdin Enterprises.  All rights reserved.
00003
00004   This software is provided 'as-is', without any express or implied
00005   warranty.  In no event will the authors be held liable for any damages
00006   arising from the use of this software.
00007
00008   Permission is granted to anyone to use this software for any purpose,
00009   including commercial applications, and to alter it and redistribute it
00010   freely, subject to the following restrictions:
00011
00012   1. The origin of this software must not be misrepresented; you must not
00013      claim that you wrote the original software. If you use this software
00014      in a product, an acknowledgment in the product documentation would be
00015      appreciated but is not required.
00016   2. Altered source versions must be plainly marked as such, and must not be
00017      misrepresented as being the original software.
00018   3. This notice may not be removed or altered from any source distribution.
00019
00020   L. Peter Deutsch
00021   ghost@aladdin.com
00022
00023  */
00024 /* $Id: md5.h,v 1.4 2002/04/13 19:20:28 lpd Exp $ */
00025 /*
00026   Independent implementation of MD5 (RFC 1321).
00027
00028   This code implements the MD5 Algorithm defined in RFC 1321, whose
00029   text is available at
00030         http://www.ietf.org/rfc/rfc1321.txt
00031   The code is derived from the text of the RFC, including the test suite
00032   (section A.5) but excluding the rest of Appendix A.  It does not include
00033   any code or documentation that is identified in the RFC as being
00034   copyrighted.
00035
00036   The original and principal author of md5.h is L. Peter Deutsch
00037   <ghost@aladdin.com>.  Other authors are noted in the change history
00038   that follows (in reverse chronological order):
00039
00040   2002-04-13 lpd Removed support for non-ANSI compilers; removed
00041         references to Ghostscript; clarified derivation from RFC 1321;
00042         now handles byte order either statically or dynamically.
00043   1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
00044   1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5);
00045         added conditionalization for C++ compilation from Martin
00046         Purschke <purschke@bnl.gov>.
00047   1999-05-03 lpd Original version.
00048  */
00049
00050 /*
00051   2011-09-09 AB Modified to "cpp" sith namespace to avoid clash with other
00052     libraries
00053 */
00054
00055 #ifndef _GLWEBTOOLS_MD5_INCLUDED_
00056 #define _GLWEBTOOLS_MD5_INCLUDED_
00057
00058 namespace glwebtools
00059 {
00060
00061 /*
00062  * This package supports both compile-time and run-time determination of CPU
00063  * byte order.  If ARCH_IS_BIG_ENDIAN is defined as 0, the code will be
00064  * compiled to run only on little-endian CPUs; if ARCH_IS_BIG_ENDIAN is
00065  * defined as non-zero, the code will be compiled to run only on big-endian
00066  * CPUs; if ARCH_IS_BIG_ENDIAN is not defined, the code will be compiled to
00067  * run on either big- or little-endian CPUs, but will run slightly less
00068  * efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined.
00069  */
00070
00071 typedef unsigned char md5_byte_t; /* 8-bit byte */
00072 typedef unsigned int md5_word_t; /* 32-bit word */
00073
00074 /* Define the state of the MD5 Algorithm. */
00075 typedef struct md5_state_s {
00076     md5_word_t count[2];        /* message length in bits, lsw first */
00077     md5_word_t abcd[4];         /* digest buffer */
00078     md5_byte_t buf[64];         /* accumulate block */
00079 } md5_state_t;
00080
00081 //#ifdef __cplusplus
00082 //extern "C"
00083 //{
00084 //#endif
00085
00086 /* Initialize the algorithm. */
00087 void md5_init(md5_state_t *pms);
00088
00089 /* Append a string to the message. */
00090 void md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes);
00091
00092 /* Finish the message and return the digest. */
00093 void md5_finish(md5_state_t *pms, md5_byte_t digest[16]);
00094
00095 //#ifdef __cplusplus
00096 //}  /* end extern "C" */
00097 //#endif
00098
00099 } //namespace
00100 #endif /* _GLWEBTOOLS_MD5_INCLUDED_ */


GLWebTools: glwebtools_memory.h Source File

  • File List
glwebtools_memory.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_MEMORY_INCLUDED_
00003 #define _GLWEBTOOLS_MEMORY_INCLUDED_
00004
00005 #ifdef GLWEBTOOLS_NEW
00006 #undef GLWEBTOOLS_NEW
00007 #endif
00008
00009 #ifdef GLWEBTOOLS_DELETE
00010 #undef GLWEBTOOLS_DELETE
00011 #endif
00012
00013 namespace glwebtools
00014 {
00015         enum MemHint
00016         {
00017                 MH_ALIGN_ANY = sizeof(void*)
00018         };
00019 }
00020
00021 #ifdef GLWEBTOOLS_DEBUG
00022         #define GLWEBTOOLS_ALLOC(SIZE) Glwt2Alloc(SIZE, glwebtools::MH_ALIGN_ANY, __FILE__, __FUNCTION__, __LINE__)
00023         #define GLWEBTOOLS_ALLOC_ALIGN(SIZE, ALIGNMENT) Glwt2Alloc(SIZE, ALIGNMENT, __FILE__, __FUNCTION__, __LINE__)
00024
00025         #define GLWEBTOOLS_REALLOC(PTR, SIZE) Glwt2Realloc(PTR, SIZE, glwebtools::MH_ALIGN_ANY, __FILE__, __FUNCTION__, __LINE__)
00026         #define GLWEBTOOLS_REALLOC_ALIGN(PTR, SIZE,ALIGNMENT) Glwt2Realloc(PTR, SIZE, ALIGNMENT, __FILE__, __FUNCTION__, __LINE__)
00027
00028         #define GLWEBTOOLS_FREE(PTR) Glwt2Free(PTR)
00029         #define GLWEBTOOLS_NEW new(glwebtools::MH_ALIGN_ANY, __FILE__, __FUNCTION__, __LINE__)
00030
00031 #else // GLWEBTOOLS_DEBUG
00032         #define GLWEBTOOLS_ALLOC(SIZE) Glwt2Alloc(SIZE, glwebtools::MH_ALIGN_ANY, "", "", 0)
00033         #define GLWEBTOOLS_ALLOC_ALIGN(SIZE, ALIGNMENT) Glwt2Alloc(SIZE, ALIGNMENT, "", "", 0)
00034
00035         #define GLWEBTOOLS_REALLOC(PTR, SIZE) Glwt2Realloc(PTR, SIZE, glwebtools::MH_ALIGN_ANY, "", "", 0)
00036         #define GLWEBTOOLS_REALLOC_ALIGN(PTR, SIZE,ALIGNMENT) Glwt2Realloc(PTR, SIZE, ALIGNMENT, "", "", 0)
00037
00038         #define GLWEBTOOLS_FREE(PTR) Glwt2Free(PTR)
00039         #define GLWEBTOOLS_NEW new(glwebtools::MH_ALIGN_ANY, "", "", 0)
00040
00041 #endif // GLWEBTOOLS_DEBUG
00042
00043
00044 namespace glwebtools
00045 {
00046 template <class GLWEBTOOLS_T> void Destruct(GLWEBTOOLS_T* x)
00047 {
00048     static_cast<void>(x);// to avoid warning
00049         x->~GLWEBTOOLS_T();
00050 }
00051
00052 }
00053 #define GLWEBTOOLS_DELETE(PTR) if(PTR != 0){glwebtools::Destruct(PTR); GLWEBTOOLS_FREE(static_cast<void*>(PTR));}
00054
00055 #include <new>
00056 #include <string.h>
00057 #include <stdlib.h>
00058
00059 #if defined(_WIN32)
00060 #pragma warning( disable : 4290 )
00061 #pragma warning( disable : 4291 )
00062 #endif
00063
00064 extern "C" void* Glwt2Alloc(std::size_t size, glwebtools::MemHint memhint, const char* filename, const char* function, int line);
00065 extern "C" void* Glwt2Realloc(void* ptr, std::size_t size, glwebtools::MemHint memhint, const char* filename, const char* function, int line);
00066 extern "C" void Glwt2Free(void* ptr);
00067
00068 inline
00069 void* operator new(std::size_t blocksize, glwebtools::MemHint hint, const char* in_pszFileName, const char* in_pszFuncName, const int in_nLineNumber)
00070 {
00071         return Glwt2Alloc(blocksize, hint, in_pszFileName, in_pszFuncName, in_nLineNumber);
00072 }
00073
00074 namespace glwebtools
00075 {
00077 template<typename GLWEBTOOLS_T, glwebtools::MemHint Hint = glwebtools::MH_ALIGN_ANY>
00078 class SAllocator
00079 {
00080 public:
00081
00082         // STL allocator compliance defs
00083
00084         typedef std::size_t size_type;
00085         typedef std::ptrdiff_t difference_type;
00086         typedef GLWEBTOOLS_T* pointer;
00087         typedef const GLWEBTOOLS_T* const_pointer;
00088         typedef GLWEBTOOLS_T& reference;
00089         typedef const GLWEBTOOLS_T& const_reference;
00090         typedef GLWEBTOOLS_T value_type;
00091
00092         template <typename GLWEBTOOLS_T1>
00093         struct rebind
00094         {
00095                 typedef SAllocator<GLWEBTOOLS_T1> other;
00096         };
00097
00098         SAllocator()
00099         {
00100         }
00101
00102         template <typename GLWEBTOOLS_T2>
00103         SAllocator(const SAllocator<GLWEBTOOLS_T2>& /*other*/)
00104         {
00105         }
00106
00107         pointer address(reference r) const
00108         {
00109                 return &r;
00110         }
00111
00112         const_pointer address(const_reference r) const
00113         {
00114                 return &r;
00115         }
00116
00118         GLWEBTOOLS_T* allocate(size_t cnt, const void* hint = 0)
00119         {
00120         static_cast<void>(hint);
00121                 return (GLWEBTOOLS_T*)internal_new(cnt* sizeof(GLWEBTOOLS_T));
00122         }
00123
00124         size_type max_size() const
00125         {
00126                 return size_type(-1) / sizeof(GLWEBTOOLS_T);
00127         }
00128
00130         void deallocate(GLWEBTOOLS_T* ptr, size_type /*n = 0*/)
00131         {
00132                 internal_delete(ptr);
00133         }
00134
00136         void construct(GLWEBTOOLS_T* ptr, const GLWEBTOOLS_T& e)
00137         {
00138                 new ((void*)ptr) GLWEBTOOLS_T(e);
00139         }
00140
00142         void destroy(GLWEBTOOLS_T* ptr)
00143         {
00144         static_cast<void>(ptr);// to avoid warning
00145                 ptr->~GLWEBTOOLS_T();
00146         }
00147
00148         // Below operators are required by some STL implementations
00149
00150         bool operator == (const SAllocator& /*rhs*/) const
00151         {
00152                 return true;
00153         }
00154
00155         bool operator != (const SAllocator& /*rhs*/) const
00156         {
00157                 return false;
00158         }
00159
00160 protected:
00161
00162         void* internal_new(std::size_t cnt)
00163         {
00164                 return GLWEBTOOLS_ALLOC_ALIGN(cnt, Hint);
00165         }
00166
00167         void internal_delete(void* ptr)
00168         {
00169                 GLWEBTOOLS_FREE(ptr);//delete(ptr);
00170         }
00171
00172 }; // end class SAllocator<T>
00173
00174
00175         // callbacks for external libs
00176         struct ExternalAlloc
00177         {
00178                 static void* Malloc(size_t size);
00179
00180                 static void Free(void *ptr)     ;
00181
00182                 static void* Realloc(void *ptr, size_t size);
00183
00184                 static char* Strdup(const char *str);
00185
00186                 static void* Calloc(size_t nmemb, size_t size);
00187         };
00188
00189 } //namespace glwebtools
00190
00191
00192 #endif


GLWebTools: glwebtools_memorybarrier.h Source File

  • File List
glwebtools_memorybarrier.h
00001 #ifndef _GLWEBTOOLS_MEMORY_BARRIER_INCLUDED_
00002 #define _GLWEBTOOLS_MEMORY_BARRIER_INCLUDED_
00003
00004 namespace glwebtools
00005 {
00006
00007 void MemBar();
00008
00009 }
00010
00011 #endif


GLWebTools: glwebtools_mutabledata.h Source File

  • File List
glwebtools_mutabledata.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_MUTABLE_DATA_INCLUDED_
00003 #define _GLWEBTOOLS_MUTABLE_DATA_INCLUDED_
00004
00005 #include <glwebtools/internal/glwebtools_common.h>
00006 #include <glwebtools/internal/glwebtools_types.h>
00007
00008 namespace glwebtools
00009 {
00010
00011 class MutableData : public NonCopyable
00012 {
00013 public:
00014         MutableData(size_t minAllocationSize=16);
00015         ~MutableData();
00016
00017         size_t GetSize();
00018         size_t GetAllocatedSize();
00019
00020         bool Resize(size_t newSize);
00021         bool Reserve(size_t reserveSize);
00022         bool Purge();
00023
00024         bool GetData(const void*& dataPtr, size_t& dataSize ) const;
00025         bool GetMutableData(void*& dataPtr, size_t& dataSize );
00026
00027         bool AppendData(const void* data, size_t size);
00028
00029         bool Swap(MutableData& data);
00030
00031 private:
00032         size_t m_dataSize;
00033         size_t m_allocatedSize;
00034
00035         size_t m_minAllocationSize;
00036
00037         void* m_data;
00038 };
00039
00040 } //namespace glwebtools
00041
00042 #endif //_GLWEBTOOLS_MUTABLE_DATA_INCLUDED_


GLWebTools: glwebtools_mutex.h Source File

  • File List
glwebtools_mutex.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_MUTEX_INCLUDED_
00003 #define _GLWEBTOOLS_MUTEX_INCLUDED_
00004
00005 #include <glwebtools/internal/glwebtools_common.h>
00006
00007 namespace glwebtools
00008 {
00009
00010 class Condition;
00011
00012 class Mutex : public NonCopyable
00013 {
00014 public:
00015         Mutex();
00016         ~Mutex();
00017
00018         void Lock();
00019         void Unlock();
00020
00021         bool TryLock();
00022
00023 private:
00024         void* m_handler;
00025
00026         friend class Condition;
00027 };
00028
00029 struct LockScope : public NonCopyable
00030 {
00031         LockScope(glwebtools::Mutex& mutex)
00032         :m_mutex(mutex)
00033         {
00034                 m_mutex.Lock();
00035         }
00036
00037         ~LockScope()
00038         {
00039                 m_mutex.Unlock();
00040         }
00041
00042         glwebtools::Mutex& m_mutex;
00043 };
00044
00045 }
00046
00047 #endif //_GLWEBTOOLS_MUTEX_INCLUDED_
00048


GLWebTools: glwebtools_openssl.h Source File

  • File List
glwebtools_openssl.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_OPENSSL_INCLUDED_
00003 #define _GLWEBTOOLS_OPENSSL_INCLUDED_
00004
00006 namespace glwebtools
00007 {
00009
00018         class OpenSSL
00019         {
00020         public:
00022                 OpenSSL();
00024                 ~OpenSSL();
00025
00026                 bool IsInitialized() const;
00027
00028         };//class OpenSSL
00029 }//namespace glwebtools
00030
00031 #endif //_GLWEBTOOLS_OPENSSL_INCLUDED_


GLWebTools: glwebtools_securedata.h Source File

  • File List
glwebtools_securedata.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_SECURE_DATA_INCLUDED_
00003 #define _GLWEBTOOLS_SECURE_DATA_INCLUDED_
00004
00005 #include <string>
00006 #include <vector>
00007 #include <glwebtools/internal/glwebtools_common.h>
00008 #include <glwebtools/internal/glwebtools_types.h>
00009 #include <glwebtools/serialization/glwebtools_jsonreader.h>
00010 #include <glwebtools/serialization/glwebtools_jsonwriter.h>
00011
00012 namespace glwebtools
00013 {
00014         template <size_t size>
00015         struct Mask
00016         {
00017         };
00018
00019         template <>
00020         struct Mask<1>
00021         {
00022                 typedef uint8_t mask_type;
00023                 static const mask_type mask = 0xF0;
00024                 static const unsigned char rotate_size = 5;
00025         };
00026
00027         template <>
00028         struct Mask<2>
00029         {
00030                 typedef uint16_t mask_type;
00031                 static const mask_type mask = 0xF0AA;
00032                 static const unsigned char rotate_size = 11;
00033         };
00034
00035
00036         template <>
00037         struct Mask<4>
00038         {
00039                 typedef uint32_t mask_type;
00040                 static const mask_type mask = 0xF0AACC47;
00041                 static const unsigned char rotate_size = 26;
00042         };
00043
00044
00045         template <>
00046         struct Mask<8>
00047         {
00048                 typedef uint64_t mask_type;
00049                 static const mask_type mask = 0xF0AACC473F29288EULL;
00050                 static const unsigned char rotate_size = 41;
00051         };
00052
00053
00054         template <typename GLWEBTOOLS_T>
00055         struct SecureData
00056         {
00057         private:
00058                 typedef typename Mask<sizeof(GLWEBTOOLS_T)>::mask_type mask_type;
00059
00060         private:
00061                 // use a union to avoid reinterpret_cast problem with double
00062                 union data_type
00063                 {
00064                         GLWEBTOOLS_T m_value;
00065                         mask_type m_masked;
00066                 };
00067
00068                 data_type m_data;
00069
00070         public:
00071                 SecureData() : m_data(encrypt(GLWEBTOOLS_T()))
00072                 {
00073                 }
00074
00075                 SecureData(GLWEBTOOLS_T data) : m_data(encrypt(data))
00076                 {
00077                 }
00078
00079                 SecureData(const SecureData& other)
00080                 {
00081                         m_data = other.m_data;
00082                 }
00083
00084                 SecureData& operator=(const SecureData& other)
00085                 {
00086                         m_data = other.m_data;
00087                         return *this;
00088                 }
00089
00090                 ~SecureData()
00091                 {
00092                         m_data.m_value = GLWEBTOOLS_T(); // do not encrypt default value to make harder to decipher
00093                 }
00094
00095                 GLWEBTOOLS_T Get() const
00096                 {
00097                         return decrypt(m_data);
00098                 }
00099
00100                 void Set(GLWEBTOOLS_T data)
00101                 {
00102                         m_data = encrypt(data);
00103                 }
00104
00105                 operator GLWEBTOOLS_T() const
00106                 {
00107                         return decrypt(m_data);
00108                 }
00109
00110                 friend void swap(SecureData& left, SecureData& right)
00111                 {
00112                         using std::swap;
00113
00114                         swap(left.m_data.m_value, right.m_data.m_value);
00115                 }
00116
00117         public:
00119
00124                 glwebtools::Error read(const glwebtools::JsonReader& reader)
00125                 {
00126                         return reader >> m_data.m_value;
00127                 }
00128
00130
00135                 glwebtools::Error write(glwebtools::JsonWriter& writer) const
00136                 {
00137                         return writer << m_data.m_value;
00138                 }
00139
00140         private:
00141                 static data_type encrypt(GLWEBTOOLS_T data)
00142                 {
00143                         const unsigned char data_size = sizeof(GLWEBTOOLS_T);
00144                         data_type result;
00145                         result.m_value = data;
00146                         const unsigned char rotate_size = Mask<data_size>::rotate_size;
00147                         const unsigned char bit_size = data_size<<3;
00148                         result.m_masked = result.m_masked << (rotate_size) | result.m_masked >> (bit_size-rotate_size);
00149                         const mask_type mask = Mask<data_size>::mask;
00150                         result.m_masked = result.m_masked ^ mask;
00151                         return result;
00152                 }
00153
00154                 static GLWEBTOOLS_T decrypt(data_type data)
00155                 {
00156                         const unsigned char data_size = sizeof(GLWEBTOOLS_T);
00157                         data_type result = data;
00158                         const mask_type mask = Mask<data_size>::mask;
00159                         result.m_masked = result.m_masked ^ mask;
00160                         const unsigned char rotate_size = Mask<data_size>::rotate_size;
00161                         const unsigned char bit_size = data_size<<3;
00162                         result.m_masked = result.m_masked >> (rotate_size) | result.m_masked << (bit_size-rotate_size);
00163                         return result.m_value;
00164                 }
00165         };
00166
00167         struct SecureString
00168         {
00169         public:
00170                 typedef std::string data_type;
00171                 typedef const std::string& data_cref_type;
00172                 typedef const char* const_buffer_type;
00173                 typedef std::string hash_type;
00174                 typedef unsigned int seed_type;
00175                 typedef std::string crypted_data_type;
00176                 typedef const std::string& crypted_data_cref_type;
00177
00178         private:
00179                 seed_type m_seeds[2];
00180                 crypted_data_type m_data;
00181                 hash_type m_hash;
00182
00183         public:
00184                 SecureString()
00185                 {
00186                         Set(0, 0);
00187                 }
00188
00189                 SecureString(/*data_cref_type*/const std::string& data)
00190                 {
00191                         Set(data);
00192                 }
00193
00194                 SecureString(/*const_buffer_type*/const char* data, size_t size)
00195                 {
00196                         Set(data, size);
00197                 }
00198
00199                 SecureString(/*crypted_data_cref_type*/const std::string& data, seed_type seed1, seed_type seed2)
00200                 {
00201                         Set(data, seed1, seed2);
00202                 }
00203
00204                 SecureString(const SecureString& other)
00205                 {
00206                         m_seeds[0] = other.m_seeds[0];
00207                         m_seeds[1] = other.m_seeds[1];
00208                         m_data = other.m_data;
00209                         m_hash = other.m_hash;
00210                 }
00211
00212                 SecureString& operator=(const SecureString& other)
00213                 {
00214                         m_seeds[0] = other.m_seeds[0];
00215                         m_seeds[1] = other.m_seeds[1];
00216                         m_data = other.m_data;
00217                         m_hash = other.m_hash;
00218                         return *this;
00219                 }
00220
00221                 ~SecureString()
00222                 {
00223                         clear();
00224                 }
00225
00226                 data_type Get() const
00227                 {
00228                         return decrypt(m_data, m_seeds);
00229                 }
00230
00231                 void Set(/*const_buffer_type*/const char* data, size_t size);
00232
00233                 void Set(/*data_cref_type*/const std::string& data)
00234                 {
00235                         if (data.empty())
00236                                 Set(0, 0);
00237                         else
00238                                 Set(&data[0], data.size());
00239                 }
00240
00241                 void Set(/*crypted_data_cref_type*/const std::string& data, seed_type seed1, seed_type seed2);
00242
00243                 operator data_type() const
00244                 {
00245                         return decrypt(m_data, m_seeds);
00246                 }
00247
00248                 bool IsValid() const
00249                 {
00250                         return m_hash == hash(m_data);
00251                 }
00252
00253         public:
00255
00260                 glwebtools::Error read(const glwebtools::JsonReader& reader);
00261
00263
00268                 glwebtools::Error write(glwebtools::JsonWriter& writer) const;
00269
00270         public:
00271                 std::string PrintDebug() const;
00272
00273         public:
00274                 void clear()
00275                 {
00276                         Set(0, 0);
00277                 }
00278
00279                 size_t size() const;
00280
00281                 bool empty() const
00282                 {
00283                         return size() == 0;
00284                 }
00285
00286                 friend void swap(SecureString& left, SecureString& right)
00287                 {
00288                         using std::swap;
00289
00290                         swap(left.m_seeds[0], right.m_seeds[0]);
00291                         swap(left.m_seeds[1], right.m_seeds[1]);
00292                         swap(left.m_data, right.m_data);
00293                         swap(left.m_hash, right.m_hash);
00294                 }
00295
00296                 friend bool operator==(const SecureString& left, const SecureString& right)
00297                 {
00298                         return left.Get() == right.Get();
00299                 }
00300
00301                 friend bool operator==(const std::string& left, const SecureString& right)
00302                 {
00303                         return left == right.Get();
00304                 }
00305
00306                 friend bool operator==(const SecureString& left, const std::string& right)
00307                 {
00308                         return left.Get() == right;
00309                 }
00310
00311                 friend bool operator==(const char* left, const SecureString& right)
00312                 {
00313                         return left == right.Get();
00314                 }
00315
00316                 friend bool operator==(const SecureString& left, const char* right)
00317                 {
00318                         return left.Get() == right;
00319                 }
00320
00321         private:
00322                 static crypted_data_type encrypt(const_buffer_type data, size_t size, const seed_type ( &seeds )[2]);
00323                 static data_type decrypt(crypted_data_cref_type data, const seed_type ( &seeds )[2]);
00324                 static hash_type hash(crypted_data_cref_type data);
00325
00326         };
00327
00329
00331         template <typename FORMATTER = AttributeFormatter>
00332         class SecureDataFormatter
00333         {
00334         public:
00339                 template <typename GLWEBTOOLS_T>
00340                 std::string operator()(GLWEBTOOLS_T value) const
00341                 {
00342                         return m_formatter.ToString(value.Get());
00343                 }
00344
00347                 bool operator==(const SecureDataFormatter<FORMATTER>&) const
00348                 {
00349                         return true;
00350                 }
00351         private:
00352                 FORMATTER m_formatter;
00353         };
00354
00355
00356         template <typename GLWEBTOOLS_T>
00357         struct DefaultFormatter<SecureData<GLWEBTOOLS_T> >
00358         {
00359                 typedef SecureDataFormatter<> type;
00360         };
00361
00362         struct SecureBuffer
00363         {
00364         public:
00365                 typedef std::vector<unsigned char> data_type;
00366                 typedef const std::vector<unsigned char>& data_cref_type;
00367                 typedef const unsigned char* const_buffer_type;
00368                 typedef std::string hash_type;
00369                 typedef unsigned int seed_type;
00370                 typedef std::string crypted_data_type;
00371                 typedef const std::string& crypted_data_cref_type;
00372
00373         private:
00374                 seed_type m_seeds[2];
00375                 crypted_data_type m_data;
00376                 hash_type m_hash;
00377
00378         public:
00379                 SecureBuffer()
00380                 {
00381                         Set(0, 0);
00382                 }
00383
00384                 SecureBuffer(/*data_cref_type*/const std::vector<unsigned char>& data)
00385                 {
00386                         Set(data);
00387                 }
00388
00389                 SecureBuffer(/*const_buffer_type*/const unsigned char* data, size_t size)
00390                 {
00391                         Set(data, size);
00392                 }
00393
00394                 SecureBuffer(/*crypted_data_cref_type*/const std::string& data, seed_type seed1, seed_type seed2)
00395                 {
00396                         Set(data, seed1, seed2);
00397                 }
00398
00399                 SecureBuffer(const SecureBuffer& other)
00400                 {
00401                         m_seeds[0] = other.m_seeds[0];
00402                         m_seeds[1] = other.m_seeds[1];
00403                         m_data = other.m_data;
00404                         m_hash = other.m_hash;
00405                 }
00406
00407                 SecureBuffer& operator=(const SecureBuffer& other)
00408                 {
00409                         m_seeds[0] = other.m_seeds[0];
00410                         m_seeds[1] = other.m_seeds[1];
00411                         m_data = other.m_data;
00412                         m_hash = other.m_hash;
00413                         return *this;
00414                 }
00415
00416                 ~SecureBuffer()
00417                 {
00418                         clear();
00419                 }
00420
00421                 data_type Get() const
00422                 {
00423                         return decrypt(m_data, m_seeds);
00424                 }
00425
00426                 void Set(/*data_cref_type*/const std::vector<unsigned char>& data)
00427                 {
00428                         if (data.empty())
00429                                 Set(0, 0);
00430                         else
00431                                 Set(&data[0], data.size());
00432                 }
00433
00434                 void Set(/*const_buffer_type*/const unsigned char* data, size_t size);
00435
00436                 void Set(/*crypted_data_cref_type*/const std::string& data, seed_type seed1, seed_type seed2);
00437
00438                 operator data_type() const
00439                 {
00440                         return decrypt(m_data, m_seeds);
00441                 }
00442
00443                 bool IsValid() const
00444                 {
00445                         return m_hash == hash(m_data);
00446                 }
00447
00448         public:
00450
00455                 glwebtools::Error read(const glwebtools::JsonReader& reader);
00456
00458
00463                 glwebtools::Error write(glwebtools::JsonWriter& writer) const;
00464
00465         public:
00466                 void clear()
00467                 {
00468                         Set(0,0);
00469                 }
00470
00471                 size_t size() const;
00472
00473                 bool empty() const
00474                 {
00475                         return size() == 0;
00476                 }
00477
00478                 friend void swap(SecureBuffer& left, SecureBuffer& right)
00479                 {
00480                         using std::swap;
00481
00482                         swap(left.m_seeds[0], right.m_seeds[0]);
00483                         swap(left.m_seeds[1], right.m_seeds[1]);
00484                         swap(left.m_data, right.m_data);
00485                         swap(left.m_hash, right.m_hash);
00486                 }
00487
00488                 friend bool operator==(const SecureBuffer& left, const SecureBuffer& right)
00489                 {
00490                         return left.Get() == right.Get();
00491                 }
00492
00493         private:
00494                 static crypted_data_type encrypt(const_buffer_type data, size_t size, const seed_type ( &seeds )[2]);
00495                 static data_type decrypt(crypted_data_cref_type data, const seed_type ( &seeds )[2]);
00496                 static hash_type hash(crypted_data_cref_type data);
00497
00498         };
00499
00500 } //namespace glwebtools
00501
00502 #endif //_GLWEBTOOLS_SECURE_DATA_INCLUDED_


GLWebTools: glwebtools_serversideevent.h Source File

  • File List
glwebtools_serversideevent.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_SERVERSIDEEVENT_INCLUDED_
00003 #define _GLWEBTOOLS_SERVERSIDEEVENT_INCLUDED_
00004
00005 #include <string>
00006 #include <glwebtools/glwebtools_error.h>
00007 #include <glwebtools/serialization/glwebtools_argumentwrapper.h>
00008
00009 namespace glwebtools
00010 {
00011         class ServerSideEvent
00012         {
00013         public:
00014                 glwebtools::Error SetEventName(const std::string& name);
00015                 glwebtools::Error AddData(const std::string& data);
00016                 glwebtools::Error SetLastEventId(const std::string& lastEventId);
00017                 glwebtools::Error SetRetry(unsigned int retry);
00018
00019         public:
00020                 const std::string& GetEventName() const;
00021                 const std::string& GetData() const;
00022                 const std::string& GetLastEventId() const;
00023                 unsigned int GetRetry() const;
00024
00025         public:
00026                 friend void swap(ServerSideEvent& left, ServerSideEvent& right)
00027                 {
00028                         using std::swap;
00029                         swap(left.m_eventName, right.m_eventName);
00030                         swap(left.m_data, right.m_data);
00031                         swap(left.m_lastEventId, right.m_lastEventId);
00032                         swap(left.m_retry, right.m_retry);
00033                 }
00034
00035                 friend std::ostream& operator<<(std::ostream& out, const ServerSideEvent& sse)
00036                 {
00037                         out << sse.ToString();
00038                         return out;
00039                 }
00040
00041         public:
00042                 void Clear();
00043
00044         public:
00045                 bool IsValid() const;
00046
00047         public:
00048                 glwebtools::Error ToString(std::string& output) const;
00049                 std::string ToString() const;
00050
00051         private:
00052                 OptionalArgument<std::string> m_eventName;
00053                 RequiredArgument<std::string> m_data;
00054                 OptionalArgument<std::string> m_lastEventId;
00055                 OptionalArgument<unsigned int> m_retry;
00056         };
00057 }
00058
00059 #endif //_GLWEBTOOLS_SERVERSIDEEVENT_INCLUDED_


GLWebTools: glwebtools_serversideeventparser.h Source File

  • File List
glwebtools_serversideeventparser.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_SERVERSIDEEVENTPARSER_INCLUDED_
00003 #define _GLWEBTOOLS_SERVERSIDEEVENTPARSER_INCLUDED_
00004
00005 #include <string>
00006 #include <vector>
00007 #include <glwebtools/glwebtools_error.h>
00008 #include <glwebtools/glwebtools_error.h>
00009
00010 namespace glwebtools
00011 {
00012         class ServerSideEvent;
00013
00014         class ServerSideEventParser
00015         {
00016         public:
00017                 glwebtools::Error PushField(const std::string& value);
00018                 glwebtools::Error PopEvent(ServerSideEvent& value);
00019                 bool HasEvent() const;
00020
00021         public:
00022                 void Clear();
00023
00024         private:
00025                 struct Field
00026                 {
00027                         glwebtools::Error Parse(const std::string& value);
00028                         bool IsValid() const;
00029
00030                         glwebtools::Error ToString(std::string& output) const;
00031                         std::string ToString() const;
00032
00033                         std::string m_name;
00034                         std::string m_value;
00035                 };
00036
00037         private:
00038                 typedef std::vector<Field> field_list;
00039                 field_list m_fields;
00040         };
00041 }
00042
00043 #endif //_GLWEBTOOLS_SERVERSIDEEVENTPARSER_INCLUDED_


GLWebTools: glwebtools_serversideeventstreamparser.h Source File

  • File List
glwebtools_serversideeventstreamparser.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_SERVERSIDEEVENTSTREAMPARSER_INCLUDED_
00003 #define _GLWEBTOOLS_SERVERSIDEEVENTSTREAMPARSER_INCLUDED_
00004
00005 #include <string>
00006 #include <deque>
00007 #include <glwebtools/glwebtools_error.h>
00008 #include <glwebtools/sse/glwebtools_serversideeventparser.h>
00009 #include <glwebtools/sse/glwebtools_serversideevent.h>
00010
00011 namespace glwebtools
00012 {
00013         class ServerSideEventStreamParser
00014         {
00015         public:
00016                 ServerSideEventStreamParser();
00017
00018         public:
00019                 glwebtools::Error PushStream(const std::string& value);
00020                 glwebtools::Error PopEvent(ServerSideEvent& value);
00021                 bool HasEvent() const;
00022
00023         public:
00024                 void Clear();
00025
00026         private:
00027                 glwebtools::Error Push(char value);
00028                 glwebtools::Error PushField();
00029                 glwebtools::Error PushEvent();
00030
00031         private:
00032                 void ClearBuffer();
00033
00034         private:
00035                 bool IsFeeding() const;
00036
00037         private:
00038                 ServerSideEventParser m_eventParser;
00039                 std::string m_buffer;
00040                 std::deque<ServerSideEvent> m_eventQueue;
00041                 char m_lastChar;
00042         };
00043 }
00044
00045 #endif //_GLWEBTOOLS_SERVERSIDEEVENTSTREAMPARSER_INCLUDED_


GLWebTools: glwebtools_sha256.h Source File

  • File List
glwebtools_sha256.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_SHA256_INCLUDED_
00003 #define _GLWEBTOOLS_SHA256_INCLUDED_
00004
00005 #if defined(ANDROID) || defined(__APPLE__) || defined(__linux__)
00006 #include <stddef.h>
00007 #endif
00008
00009 namespace glwebtools
00010 {
00011         struct SHA256_CTX
00012         {
00013                 SHA256_CTX();
00014                 ~SHA256_CTX();
00015                 void* m_implData;
00016
00017                 static const unsigned int digest_length = 32;
00018                 static const unsigned int digest_string_length = digest_length*2+1;
00019         };
00020
00021         int SHA256_Init(glwebtools::SHA256_CTX& c);
00022         int SHA256_Update(glwebtools::SHA256_CTX& c, const void *data, size_t len);
00023         int SHA256_Final(unsigned char *md, glwebtools::SHA256_CTX& c);
00024 }
00025
00026 #endif


GLWebTools: glwebtools_sha256_internal.h Source File

  • File List
glwebtools_sha256_internal.h
00001 /*
00002  * FILE:        sha2.h
00003  * AUTHOR:      Aaron D. Gifford - http://www.aarongifford.com/
00004  *
00005  * Copyright (c) 2000-2001, Aaron D. Gifford
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions
00010  * are met:
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in the
00015  *    documentation and/or other materials provided with the distribution.
00016  * 3. Neither the name of the copyright holder nor the names of contributors
00017  *    may be used to endorse or promote products derived from this software
00018  *    without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND
00021  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00022  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00023  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE
00024  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00025  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00026  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00027  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00028  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00029  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00030  * SUCH DAMAGE.
00031  *
00032  * $Id: sha2.h,v 1.1 2001/11/08 00:02:01 adg Exp adg $
00033  */
00034
00035 #ifndef __GLWEBTOOLS_SHA2_H__
00036 #define __GLWEBTOOLS_SHA2_H__
00037
00038 /*
00039  * Import u_intXX_t size_t type definitions from system headers.  You
00040  * may need to change this, or define these things yourself in this
00041  * file.
00042  */
00043 #include <sys/types.h>
00044
00045 #ifdef GLWEBTOOLS_SHA2_USE_INTTYPES_H
00046
00047 #include <inttypes.h>
00048
00049 #endif /* GLWEBTOOLS_SHA2_USE_INTTYPES_H */
00050
00051 namespace glwebtools
00052 {
00053         namespace internal
00054         {
00055
00056                 /*** SHA-256/384/512 Various Length Definitions ***********************/
00057                 #define GLWEBTOOLS_SHA256_BLOCK_LENGTH          64
00058                 #define GLWEBTOOLS_SHA256_DIGEST_LENGTH         32
00059                 #define GLWEBTOOLS_SHA256_DIGEST_STRING_LENGTH  (GLWEBTOOLS_SHA256_DIGEST_LENGTH * 2 + 1)
00060
00061
00062                 /*** SHA-256/384/512 Context Structures *******************************/
00063                 /* NOTE: If your architecture does not define either u_intXX_t types or
00064                  * uintXX_t (from inttypes.h), you may need to define things by hand
00065                  * for your system:
00066                  */
00067                 typedef unsigned char u_int8_t;         /* 1-byte  (8-bits)  */
00068                 typedef unsigned int u_int32_t;         /* 4-bytes (32-bits) */
00069                 typedef unsigned long long u_int64_t;   /* 8-bytes (64-bits) */
00070                 /*
00071                  * Most BSD systems already define u_intXX_t types, as does Linux.
00072                  * Some systems, however, like Compaq's Tru64 Unix instead can use
00073                  * uintXX_t types defined by very recent ANSI C standards and included
00074                  * in the file:
00075                  *
00076                  *   #include <inttypes.h>
00077                  *
00078                  * If you choose to use <inttypes.h> then please define:
00079                  *
00080                  *   #define SHA2_USE_INTTYPES_H
00081                  *
00082                  * Or on the command line during compile:
00083                  *
00084                  *   cc -DSHA2_USE_INTTYPES_H ...
00085                  */
00086                 #ifdef GLWEBTOOLS_SHA2_USE_INTTYPES_H
00087
00088                 typedef struct _SHA256_CTX {
00089                         uint32_t        state[8];
00090                         uint64_t        bitcount;
00091                         uint8_t buffer[GLWEBTOOLS_SHA256_BLOCK_LENGTH];
00092                 } SHA256_CTX;
00093
00094                 #else /* GLWEBTOOLS_SHA2_USE_INTTYPES_H */
00095
00096                 typedef struct _SHA256_CTX {
00097                         u_int32_t       state[8];
00098                         u_int64_t       bitcount;
00099                         u_int8_t        buffer[GLWEBTOOLS_SHA256_BLOCK_LENGTH];
00100                 } SHA256_CTX;
00101
00102                 #endif /* GLWEBTOOLS_SHA2_USE_INTTYPES_H */
00103
00104
00105                 /*** SHA-256/384/512 Function Prototypes ******************************/
00106                 #ifndef GLWEBTOOLS_NOPROTO
00107                 #ifdef GLWEBTOOLS_SHA2_USE_INTTYPES_H
00108
00109                 void SHA256_Init(SHA256_CTX *);
00110                 void SHA256_Update(SHA256_CTX*, const uint8_t*, size_t);
00111                 void SHA256_Final(uint8_t[GLWEBTOOLS_SHA256_DIGEST_LENGTH], SHA256_CTX*);
00112                 char* SHA256_End(SHA256_CTX*, char[GLWEBTOOLS_SHA256_DIGEST_STRING_LENGTH]);
00113                 char* SHA256_Data(const uint8_t*, size_t, char[GLWEBTOOLS_SHA256_DIGEST_STRING_LENGTH]);
00114
00115                 #else /* GLWEBTOOLS_SHA2_USE_INTTYPES_H */
00116
00117                 void SHA256_Init(SHA256_CTX *);
00118                 void SHA256_Update(SHA256_CTX*, const u_int8_t*, size_t);
00119                 void SHA256_Final(u_int8_t[GLWEBTOOLS_SHA256_DIGEST_LENGTH], SHA256_CTX*);
00120                 char* SHA256_End(SHA256_CTX*, char[GLWEBTOOLS_SHA256_DIGEST_STRING_LENGTH]);
00121                 char* SHA256_Data(const u_int8_t*, size_t, char[GLWEBTOOLS_SHA256_DIGEST_STRING_LENGTH]);
00122
00123                 #endif /* GLWEBTOOLS_SHA2_USE_INTTYPES_H */
00124
00125                 #else /* GLWEBTOOLS_NOPROTO */
00126
00127                 void SHA256_Init();
00128                 void SHA256_Update();
00129                 void SHA256_Final();
00130                 char* SHA256_End();
00131                 char* SHA256_Data();
00132
00133                 #endif /* GLWEBTOOLS_NOPROTO */
00134
00135
00136         }// namespace internal
00137 }// namespace glwebtools
00138
00139
00140 #endif /* __GLWEBTOOLS_SHA2_H__ */
00141


GLWebTools: glwebtools_socket.h Source File

  • File List
glwebtools_socket.h
00001 #pragma once
00002 #ifndef _GLWT_SOCKET_INCLUDED_
00003 #define _GLWT_SOCKET_INCLUDED_
00004
00005 #include <glwebtools/internal/glwebtools_common.h>
00006 #include <glwebtools/internal/glwebtools_memory.h>
00007 #include <vector>
00008 #include <string>
00009
00010 namespace glwebtools
00011 {
00012
00013 struct AddrIpv4 {
00014         union {
00015                 unsigned long ulongAddr;
00016                 unsigned short ushortArrayAddr[2];
00017                 unsigned char ucharArrayAddr[4];
00018                 struct {
00019                         unsigned char Addr1;
00020                         unsigned char Addr2;
00021                         unsigned char Addr3;
00022                         unsigned char Addr4;
00023                 } uChar;
00024                 struct {
00025                         unsigned char Addr1;
00026                         unsigned char Addr2;
00027                 } uShort;
00028         } Addr;
00029         unsigned short port;
00030         unsigned short vport;
00031 };
00032
00033 struct NetInterfaceInfo
00034 {
00035         std::string m_interfaceName;
00036         std::string m_macAddress;
00037 };
00038
00039 typedef std::vector<glwebtools::NetInterfaceInfo, glwebtools::SAllocator<glwebtools::NetInterfaceInfo> > NetInterfaceInfoArray;
00040
00041 class Socket : public NonCopyable
00042 {
00043 public:
00044         enum Type {
00045                 T_STREAM,
00046                 T_DATAGRAM
00047         };
00048
00049         enum Proto {
00050                 P_UDP,
00051                 P_TCP
00052         };
00053
00054         enum Option {
00055                 O_NONE      = 0,
00056                 O_BROADCAST = 1<<0,
00057                 O_REUSEADDR = 1<<1,
00058                 O_USECRYPTO = 1<<2,
00059                 O_BLOCKING  = 1<<3,
00060                 O_NODELAY   = 1<<4
00061         };
00062
00063         enum Error {
00064                 E_INPROGRESS = -1, //not really an error
00065                 E_NONE = 0,
00066                 E_NOTINITIALIZED,
00067                 E_NOTOPENED,
00068                 E_ALREADYCONNECTED,
00069                 E_ISALREADYCONNECTING,
00070                 E_TIMEOUT,
00071                 E_CLOSED,
00072                 E_UNKNOWN,
00073                 E_COUNT
00074         };
00075
00076         static Socket::Error Init();
00077         static Socket::Error Deinit();
00078         static std::string GetHostName();
00079         static const char *GetAddrIP(const AddrIpv4 &addr);
00080         static AddrIpv4 MakeAddr(const char *ip, int port);
00081         static int ResolveHostTCP(const char* host, int port, glwebtools::AddrIpv4 &address);
00082
00083         Socket();
00084         ~Socket();
00085
00086         bool IsOpened() const;
00087
00088         bool OpenTcp(Option option = O_NONE);
00089         bool OpenUdp(Option option = O_NONE);
00090
00091         bool Open(Type type, Proto protocol, Option option = O_NONE);
00092
00093         void Close();
00094
00095         bool Connect(const AddrIpv4& addr);
00096         bool IsConnected() const;
00097
00098         bool Bind(const AddrIpv4& addr);
00099         bool Listen(int backlog);
00100         int Accept(AddrIpv4& addr);
00101         bool Reject(int id);
00102
00103         int Send(const void* buf, int size, int id = 0);
00104         int SendTo(const AddrIpv4& addr, const void* buf, int size);
00105
00106         bool IsReadable(int id = 0) const;
00107         int Receive(void* buf_out, int size, int id = 0);
00108         int ReceiveFrom(AddrIpv4& addr_out, void* buf_out, int size);
00109
00110         bool GetAddress(AddrIpv4& addr);
00111
00112         Socket::Error GetLastError() const;
00113         void ClearError();
00114
00115         static bool GetMacAddressFromIndex(size_t index, std::string& macAddress);
00116         static bool GetMacAddressFromName(const std::string& interfaceName, std::string& macAddress);
00117         static bool GetNetInterfaceInfoArray(glwebtools::NetInterfaceInfoArray& interfaceArray);
00118
00119 private:
00120         void* m_handler;
00121 };
00122
00123 }
00124
00125 #endif //_GLWT_SOCKET_INCLUDED_
00126


GLWebTools: glwebtools_systemclock.h Source File

  • File List
glwebtools_systemclock.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_SYSTEMCLOCK_INCLUDED_
00003 #define _GLWEBTOOLS_SYSTEMCLOCK_INCLUDED_
00004
00005 #include <glwebtools/internal/glwebtools_common.h>
00006
00007 namespace glwebtools
00008 {
00009
00010 class SystemClock
00011 {
00012 public:
00013         static u64 GetMilliseconds();
00014 };
00015
00016 }
00017
00018 #endif  //_GLWEBTOOLS_SYSTEMCLOCK_INCLUDED_


GLWebTools: glwebtools_taskgroup.h Source File

  • File List
glwebtools_taskgroup.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_TASKGROUP_INCLUDED_
00003 #define _GLWEBTOOLS_TASKGROUP_INCLUDED_
00004
00005 #include <glwebtools/os/glwebtools_threadpool.h>
00006 #include <list>
00007
00008 namespace glwebtools
00009 {
00010         struct Task
00011         {
00012         public:
00013                 typedef unsigned long Id;
00014                 typedef int Priority;
00015
00016         public:
00017                 Task();
00018
00019         public:
00020                 Job m_job;
00021                 Id m_id;
00022                 Priority m_priority;
00023         };
00024
00025         class TaskQueue
00026         {
00027         public:
00028                 typedef std::list<Task> QueueType;
00029
00030         public:
00032                 glwebtools::Error PushTask(const Task& task);
00034                 glwebtools::Error Reschedule(QueueType::const_iterator begin, QueueType::const_iterator end);
00036                 glwebtools::Error PopTask(Task& task);
00038                 glwebtools::Error RemoveTask(Task::Id id);
00040                 bool IsScheduled(Task::Id id) const;
00042                 void Clear();
00045                 size_t Size() const;
00047                 bool Empty() const;
00048
00049         private:
00050                 QueueType m_tasks;
00051         };
00052
00053         class TaskGroup
00054         {
00055         public:
00056                 typedef ThreadPool::CreationSettings CreationSettings;
00057
00058         public:
00060                 TaskGroup();
00061
00063                 ~TaskGroup();
00064
00066                 glwebtools::Error Initialize(const CreationSettings& creationSettings);
00067
00069                 void Terminate();
00070
00074                 glwebtools::Error Update(u64 delta_time_ms);
00075
00077                 bool IsInitialized() const;
00078
00085                 glwebtools::Error PushTask(Task::Id* id, const Job& job, Task::Priority priority = 0);
00086
00088                 glwebtools::Error RemoveTask(Task::Id id);
00089
00091                 bool IsScheduled(Task::Id id) const;
00092
00095                 size_t Size() const;
00096
00098                 bool Empty() const;
00099
00103                 bool Completed() const;
00104
00106                 bool SomeThreadStarted() const;
00107
00108         private:
00110                 TaskQueue m_tasks;
00112                 ThreadPool m_threadpool;
00114                 mutable Mutex m_mutex;
00116                 Task::Id m_task_count;
00117         };
00118
00119 }//namespace glwebtools
00120
00121 #endif  //_GLWEBTOOLS_TASKGROUP_INCLUDED_


GLWebTools: glwebtools_thread.h Source File

  • File List
glwebtools_thread.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_THREAD_INCLUDED_
00003 #define _GLWEBTOOLS_THREAD_INCLUDED_
00004
00005 namespace glwebtools
00006 {
00007
00008 typedef void (*glwtThreadUpdateFunc) (void* caller, void* param);
00009
00010 class Thread
00011 {
00012 public:
00013
00014         enum Priority
00015         {
00016                 P_MAXIMUM,
00017                 P_HIGH,
00018                 P_NORMAL,
00019                 P_LOW,
00020                 P_MINIMUM
00021         };
00022
00023         enum State
00024         {
00025                 S_INITIAL,
00026                 S_IDLE,
00027                 S_RUNNING,
00028                 S_ERROR
00029         };
00030
00031         Thread(glwtThreadUpdateFunc updateFunc, void* caller, void* param, const char* name=0);
00032         ~Thread();
00033
00034         void Start(glwebtools::Thread::Priority threadPriority);
00035         void Join();
00036
00037         glwebtools::Thread::State GetState();
00038
00039         static void RunStatic(glwebtools::Thread* runningThread);
00040         static void Sleep(unsigned int ms);
00041
00042 public:
00043         const char* GetName() const
00044         {
00045                 return m_threadName;
00046         }
00047
00048 private:
00049
00050         void RunInstance();
00051
00052         glwtThreadUpdateFunc m_userUpdateFunc;
00053         void* m_userCaller;
00054         void* m_userParam;
00055         char* m_threadName;
00056
00057         glwebtools::Thread::State m_state;
00058
00059         void* m_handler;
00060 };
00061
00062 }
00063
00064 #endif  //_GLWEBTOOLS_THREAD_INCLUDED_


GLWebTools: glwebtools_threadpool.h Source File

  • File List
glwebtools_threadpool.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_THREADPOOL_INCLUDED_
00003 #define _GLWEBTOOLS_THREADPOOL_INCLUDED_
00004
00005 #include <glwebtools/os/glwebtools_thread.h>
00006 #include <glwebtools/os/glwebtools_mutex.h>
00007 #include <glwebtools/os/glwebtools_condition.h>
00008 #include <glwebtools/internal/glwebtools_types.h>
00009 #include <list>
00010
00011 namespace glwebtools
00012 {
00013         struct Job
00014         {
00015         public:
00016                 glwtThreadUpdateFunc m_userUpdateFunc;
00017                 void* m_userCaller;
00018                 void* m_userParam;
00019
00020         public:
00024                 Job();
00025
00029                 void Reset();
00030
00032                 bool  IsSet() const;
00033
00035                 void operator()();
00036         };
00037
00038
00039         class JobRunner
00040         {
00041         public:
00042                 enum State
00043                 {
00044                         TR_IDLE,
00045                         TR_WAITING,
00046                         TR_RUNNING,
00047                         TR_ENDING
00048                 };
00049
00050         public:
00054                 explicit JobRunner(const std::string& name);
00055
00059                 ~JobRunner();
00060
00065                 glwebtools::Error Start(glwebtools::Thread::Priority threadPriority);
00066
00070                 glwebtools::Error Join();
00071
00076                 glwebtools::Error Signal(const Job& job);
00077
00079                 bool IsIdle() const;
00080
00082                 bool IsWaiting() const;
00083
00085                 bool IsRunning() const;
00086
00088                 bool IsEnding() const;
00089
00091                 const char* GetName() const;
00092
00096                 glwebtools::Error Update(u64 delta_time_ms);
00097
00101                 bool IsIdleForMoreThan(u64 max_idle_time) const;
00102
00103         private:
00105                 static void RunStatic(void* caller, void* param);
00107                 void Run();
00108
00109         private:
00111                 Job m_localJob;
00113                 Thread m_thread;
00115                 volatile State m_state;
00117                 mutable Mutex m_mutex;
00119                 Condition m_condition;
00121                 u64 m_idle_time_ms;
00123                 //u64 m_debug_start_time_ms;
00124
00125         };
00126
00127         class ThreadPool
00128         {
00129         public:
00130                 typedef std::list<JobRunner*> PoolType;
00131
00132         public:
00134                 struct CreationSettings
00135                 {
00137                         CreationSettings();
00144                         CreationSettings(unsigned int minThreadCount, unsigned int maxThreadCount, glwebtools::Thread::Priority threadPriority, unsigned int hysteresis_ms, unsigned int maxThreadStartTime_ms);
00145
00146                         unsigned int m_minThreadCount;
00147                         unsigned int m_maxThreadCount;
00148                         glwebtools::Thread::Priority m_threadPriority;
00149                         unsigned int m_hysteresis_ms;
00150                         unsigned int m_maxThreadStartTime_ms;
00151                 };
00152
00153         public:
00155                 ThreadPool();
00156
00158                 ~ThreadPool();
00159
00166                 glwebtools::Error Initialize(const CreationSettings& creationSettings);
00167
00169                 void Terminate();
00170
00172                 bool IsInitialized() const;
00173
00181                 glwebtools::Error Signal(const Job& job);
00182
00186                 size_t AvailableThreadCount() const;
00187
00190                 size_t WaitingThreadCount() const;
00191
00194                 size_t StartedThreadCount() const;
00195
00198                 size_t Size() const;
00199
00202                 bool Idle() const;
00203
00208                 glwebtools::Error Update(u64 delta_time_ms, bool doCleanUp);
00209
00210         private:
00211                 glwebtools::Error AddThread();
00212
00213         private:
00215                 PoolType m_pool;
00216                 CreationSettings m_creationSettings;
00217
00218                 u64 m_accumulator_ms;
00219                 unsigned int m_usedThreads;
00220
00221         };
00222
00223
00224 }//namespace glwebtools
00225
00226 #endif  //_GLWEBTOOLS_THREADPOOL_INCLUDED_


GLWebTools: glwebtools_time.h Source File

  • File List
glwebtools_time.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_TIME_INCLUDED_
00003 #define _GLWEBTOOLS_TIME_INCLUDED_
00004
00005 #include <time.h>
00006 #include <glwebtools/glwebtools_error.h>
00007
00008 namespace glwebtools
00009 {
00010
00011 class Time
00012 {
00013 public:
00014         static time_t GetCurrentTimestamp();
00015
00016         static glwebtools::Error ConvertISOTimeUTCToTimestamp(const char* timeStr, time_t& result);
00017         static glwebtools::Error ConvertRFC1123ToTimestamp(const char* timeStr, time_t& result);
00018         static glwebtools::Error ConvertRFC1036ToTimestamp(const char* timeStr, time_t& result);
00019
00020         static glwebtools::Error ConvertDateToTimestamp(const char* timeStr, time_t& result);
00021
00022 };
00023
00024 }//glwebtools
00025
00026 #endif  //_GLWEBTOOLS_TIME_INCLUDED_


GLWebTools: glwebtools_types.h Source File

  • File List
glwebtools_types.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_TYPES_INCLUDED_
00003 #define _GLWEBTOOLS_TYPES_INCLUDED_
00004
00005 #include <glwebtools/internal/glwebtools_memory.h>
00006 #include <glwebtools/internal/glwebtools_common.h>
00007
00008 #include <string>
00009 #include <map>
00010 #include <functional>
00011
00012 // include definition uintptr_t for linux
00013 #if defined(__linux__)
00014 #include <stdint.h>
00015 #endif
00016
00017 // include definition strcasecmp for linux
00018 #if defined(__linux__)
00019 #include <strings.h>
00020 #endif
00021
00022 namespace glwebtools
00023 {
00024
00025 #ifdef _WIN32
00026 #ifdef  _WIN64
00027         typedef unsigned __int64    uptr_t;
00028 #else
00029         typedef _W64 unsigned __int32   uptr_t;
00030 #endif
00031
00032 #else
00033
00034         typedef uintptr_t uptr_t;
00035 #endif
00036
00037 #ifdef _WIN32
00038         typedef signed char        int8_t;
00039         typedef short              int16_t;
00040         typedef int                int32_t;
00041         typedef long long          int64_t;
00042         typedef unsigned char      uint8_t;
00043         typedef unsigned short     uint16_t;
00044         typedef unsigned int       uint32_t;
00045         typedef unsigned long long uint64_t;
00046 #else
00047         typedef int8_t             int8_t;
00048         typedef int16_t            int16_t;
00049         typedef int32_t            int32_t;
00050         typedef int64_t            int64_t;
00051         typedef uint8_t            uint8_t;
00052         typedef uint16_t           uint16_t;
00053         typedef uint32_t           uint32_t;
00054         typedef uint64_t           uint64_t;
00055 #endif
00056
00057         static const uptr_t uptr_max = ((uptr_t)-1);
00058
00059         typedef std::string String;
00060         typedef std::map<glwebtools::String, glwebtools::String, std::less<glwebtools::String>, glwebtools::SAllocator< std::pair<const glwebtools::String, glwebtools::String> > > PairedStringMap;
00061         typedef std::map<glwebtools::String, int, std::less<glwebtools::String>, glwebtools::SAllocator< std::pair< const glwebtools::String, int> > > IntMap;
00062         typedef std::map<glwebtools::String, double, std::less<glwebtools::String>, glwebtools::SAllocator< std::pair< const glwebtools::String, double> > > DoubleMap;
00063
00064         //Perform a lowercase comparison of strings.
00065         template <typename GLWEBTOOLS_T>
00066         struct StringLowerCaseCompare: std::less<GLWEBTOOLS_T>
00067         {
00068                 bool operator()(const GLWEBTOOLS_T& _Left, const GLWEBTOOLS_T& _Right) const
00069                 {       // apply operator< to operands
00070                         return (GLWEBTOOLS_STRCASECMP(_Left.c_str(), _Right.c_str()) < 0);
00071                 }
00072         };
00073
00074         typedef std::map<glwebtools::String, glwebtools::String, StringLowerCaseCompare<glwebtools::String>, glwebtools::SAllocator< std::pair<const glwebtools::String, glwebtools::String> > > PairedStringMapLowerCaseCompare;
00075
00076 }
00077
00078 #endif


GLWebTools: glwebtools_typetraits.h Source File

  • File List
glwebtools_typetraits.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_TRAITS_INCLUDED_
00003 #define _GLWEBTOOLS_TRAITS_INCLUDED_
00004
00005 //#include <glwebtools/internal/glwebtools_common.h>
00006
00007 namespace glwebtools
00008 {
00010         struct FalseType { typedef FalseType type; enum { value = false }; };
00012         struct TrueType { typedef TrueType type; enum { value = true }; };
00013
00014         namespace Internal
00015         {
00016                 template <typename LEFT, typename RIGHT>
00017                 struct Or : TrueType
00018                 {
00019                 };
00020
00021                 template<>
00022                 struct Or<FalseType, FalseType> : FalseType
00023                 {
00024                 };
00025
00026                 template <typename LEFT>
00027                 struct Not : FalseType
00028                 {
00029                 };
00030
00031                 template<>
00032                 struct Not<FalseType> : TrueType
00033                 {
00034                 };
00035         }
00036
00038         template <typename LEFT, typename RIGHT>
00039         struct Or : Internal::Or<typename LEFT::type, typename RIGHT::type>
00040         {
00041         };
00042
00044         template <typename LEFT>
00045         struct Not : Internal::Not<typename LEFT::type>
00046         {
00047         };
00048 }
00049 #endif //_GLWEBTOOLS_TRAITS_INCLUDED_


GLWebTools: glwebtools_urlconnection.h Source File

  • File List
glwebtools_urlconnection.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_URL_CONNECTION_INCLUDED_
00003 #define _GLWEBTOOLS_URL_CONNECTION_INCLUDED_
00004
00005 #include <glwebtools/internal/glwebtools_types.h>
00006 #include <glwebtools/glwebtools_urlhandle.h>
00007 #include <glwebtools/os/glwebtools_thread.h>
00008 #include <glwebtools/os/glwebtools_mutex.h>
00009 #include <glwebtools/glwebtools_openssl.h>
00010
00011 namespace glwebtools
00012 {
00013
00014 class UrlRequestCore;
00015 class UrlResponse;
00016 class GlWebToolsCore;
00017
00018 class UrlConnection;
00019 class UrlResponseCore;
00020
00021 class TaskGroup;
00022
00023 class ServerSideEvent;
00024
00026 class UrlConnectionCore : public Managed
00027 {
00028 public:
00030         virtual ~UrlConnectionCore();
00031
00032 private: //can only be accessed from handle or glwebtools
00033
00034         // Managed override
00035         virtual bool CanDelete() const;
00036         virtual unsigned int Grab();
00037         virtual unsigned int Drop();
00038
00040
00043         UrlConnection::State GetState() const;
00044
00046
00051         glwebtools::Error AttachRequest(UrlRequestCore* anUrlRequest);
00052
00054
00058         const UrlResponseCore* GetUrlResponse() const;
00059
00061
00065         glwebtools::Error StartRequest();
00066
00068
00073         glwebtools::Error CancelRequest();
00074
00075
00077         glwebtools::Error GetLastError() const;
00078
00080
00085         size_t GetDownloadedBytes() const;
00086
00088         bool SupportServerSideEvent() const;
00089
00091
00094         bool HasServerSideEvent() const;
00095
00097
00102         glwebtools::Error PopServerSideEvent(ServerSideEvent& serverSideEvent);
00103
00105         bool SupportDataPacketQueue() const;
00106
00108
00111         bool HasDataPacket() const;
00112
00114
00119         glwebtools::Error PopDataPacket(MutableData& outData);
00120
00122
00127         glwebtools::Error GetCreationSettings(UrlConnection::CreationSettings& cs) const;
00128
00130         const std::string& GetOutputDebugString() const;
00131
00132 public:
00134
00138         static void RunRequestStatic(void* caller, void* param);
00139
00140 private:
00141         explicit UrlConnectionCore(TaskGroup& taskGroup);
00142         UrlConnectionCore(const UrlConnection::CreationSettings& cs, TaskGroup& taskGroup);
00143
00144         glwebtools::Error RunRequest();
00145
00146         glwebtools::Error InvalidateConnection();
00147         glwebtools::Error InvalidateRequest();
00148         glwebtools::Error SetIntanceName(const std::string& instanceName);
00149
00152         void SetLastError(glwebtools::Error error);
00153
00154         unsigned int GetCounter();
00155         unsigned int GetToken();
00156         void SetToken(unsigned int token);
00157
00158         glwebtools::Error CreateImplData();
00159         glwebtools::Error DestroyImplData();
00160
00164         glwebtools::Error Update(u64 delta_time_ms);
00165
00166         volatile UrlConnection::State m_state;
00167
00168         UrlRequestCore* m_urlRequest;
00169         UrlResponseCore* m_urlResponse;
00170
00171         UrlConnection::CreationSettings m_creationSettings;
00172
00173         void* m_implData;
00174
00175         std::string m_instanceName;
00176
00177         mutable Mutex m_mutex;
00178
00179         unsigned int m_token;
00180
00181         glwebtools::Error m_error;
00182
00183         // Shared taskGoup to run requests
00184         TaskGroup* m_taskGroup;
00185
00186         // Accumulate time when running
00187         u64 m_accumulator_ms;
00188
00189         // last output debug string
00190         std::string m_outputDebugString;
00191
00192         friend class glwebtools::GlWebToolsCore;
00193         friend class glwebtools::UrlConnection;
00194         friend class glwebtools::UrlResponse;
00195 };
00196
00197 }
00198
00199 #endif


GLWebTools: glwebtools_urlhandle.h Source File

  • File List
glwebtools_urlhandle.h
00001 #ifndef _GLWEBTOOLS_URL_HANDLE_INCLUDED_
00002 #define _GLWEBTOOLS_URL_HANDLE_INCLUDED_
00003
00004 #include <glwebtools/internal/glwebtools_common.h>
00005 #include <glwebtools/internal/glwebtools_handlemanager.h>
00006 #include <glwebtools/os/glwebtools_thread.h>
00007 #include <glwebtools/glwebtools_error.h>
00008 #include <glwebtools/os/glwebtools_taskgroup.h>
00009
00010 #include <glwebtools/tool/glwebtools_mutabledata.h>
00011
00012 #include <string>
00013 #include <map>
00014
00015 namespace glwebtools
00016 {
00017
00018 class GlWebToolsCore;
00019
00020 class UrlConnection;
00021 class UrlRequest;
00022 class UrlResponse;
00023
00024 class UrlConnectionCore;
00025 class UrlRequestCore;
00026 class UrlResponse;
00027
00028 class ServerSideEvent;
00029
00031 class UrlConnection : public HandleBase<UrlConnectionCore>
00032 {
00033 public:
00035         enum State
00036         {
00037                 S_INVALID,
00038                 S_IDLE,
00039                 S_WAITING_TO_RUN,
00040                 S_RUNNING,
00041                 S_ERROR
00042         };
00043
00045         struct CreationSettings
00046         {
00048                 CreationSettings();
00050                 CreationSettings(unsigned int maxConnections, bool failOnReponse400andHigher, bool follow302, unsigned int connectTimeout, glwebtools::Thread::Priority threadPriority, bool enableAcceptEncoding, const char* acceptEncoding);
00052                 CreationSettings(unsigned int maxConnections, bool failOnReponse400andHigher, bool follow302, unsigned int connectTimeout, const std::string& taskGroupId, glwebtools::Thread::Priority threadPriority, bool enableAcceptEncoding, const char* acceptEncoding);
00053
00054                 unsigned int m_maxConnections;
00055                 bool m_follow302;
00056                 unsigned int m_connectTimeout;
00057                 unsigned int m_timeout;
00058                 std::string m_taskGroupId;
00059                 glwebtools::Thread::Priority m_threadPriority;
00060                 unsigned int m_taskStartTimeout;
00061
00062                 bool m_enableAcceptEncoding;
00063                 std::string m_acceptEncoding;
00064                 std::string m_userAgent;
00065
00066                 bool m_supportServerSideEvent;
00067                 bool m_useDataPacketQueue;
00068
00069                 std::string m_peerCAFile;
00070
00071                 bool m_dumpRequestForDebug;
00072         };
00073
00074 public:
00076         UrlConnection();
00078         virtual ~UrlConnection();
00080         UrlConnection(const UrlConnection& rhs);
00082         UrlConnection& operator=(const UrlConnection& rhs);
00083
00085
00092         glwebtools::Error Release();
00093
00095
00098         UrlConnection::State GetState() const;
00099
00101
00105         UrlResponse GetUrlResponse() const;
00106
00108
00121         glwebtools::Error StartRequest(UrlRequest& anUrlRequest);
00122
00124
00133         glwebtools::Error CancelRequest();
00134
00136
00139         bool IsHandleValid() const;
00140
00142
00148         bool IsReadyToRun() const;
00149
00151
00156         bool IsRunning() const;
00157
00159
00165         bool IsError() const;
00166
00167
00169         glwebtools::Error GetLastError() const;
00170
00172
00177         size_t GetDownloadedBytes() const;
00178
00180         bool SupportServerSideEvent() const;
00181
00183
00186         bool HasServerSideEvent() const;
00187
00189
00194         glwebtools::Error PopServerSideEvent(ServerSideEvent& serverSideEvent);
00195
00197         bool SupportDataPacketQueue() const;
00198
00200
00203         bool HasDataPacket() const;
00204
00206
00211         glwebtools::Error PopDataPacket(MutableData& outData);
00212
00214
00219         glwebtools::Error GetCreationSettings(UrlConnection::CreationSettings& cs) const;
00220
00222         glwebtools::Error GetOutputDebugString(std::string& outputDebugString) const;
00223
00224 protected:
00225
00226         UrlConnection(unsigned int token);
00227
00228         friend class glwebtools::GlWebToolsCore;
00229 };
00230
00232 class UrlRequest : public HandleBase<UrlRequestCore>
00233 {
00234 public:
00236         enum Method
00237         {
00238                 M_INVALID,
00239                 M_GET,
00240                 M_POST,
00241                 M_HEAD,
00242                 M_DELETE
00243         };
00244
00246         enum Protocol
00247         {
00248                 P_HTTP,
00249                 P_HTTPS
00250         };
00251
00253         enum State
00254         {
00255                 S_INVALID,
00256                 S_INITIAL,
00257                 S_IDLE,
00258                 S_RUNNING,
00259                 S_ERROR
00260         };
00261
00262         struct CreationSettings
00263         {
00264                 CreationSettings();
00265
00266                 glwebtools::String m_outFilename;
00267                 Task::Priority m_priority;
00268         };
00269
00270 public:
00272         UrlRequest();
00274         virtual ~UrlRequest();
00276         UrlRequest(const UrlRequest& rhs);
00278         UrlRequest& operator=(const UrlRequest& rhs);
00279
00281
00288         glwebtools::Error Release();
00289
00291
00294         UrlRequest::Method GetMethod() const;
00295
00297
00300         UrlRequest::State GetState() const;
00301
00303
00310         glwebtools::Error Reset();
00311
00313
00323         glwebtools::Error AddHeaders(const char* headerField, const char* value);
00324
00326
00336         glwebtools::Error AddHeaders(const char* headerField, const std::string& value);
00337
00339
00349         glwebtools::Error AddHeaders(const std::string& headerField, const std::string& value);
00350
00352
00360         glwebtools::Error SetHeaders(const std::map<std::string, std::string> & headerMap);
00361
00363
00373         glwebtools::Error ClearHeaders();
00374
00376
00386         glwebtools::Error SetUrl(const char* url, unsigned int port=0);
00387
00389
00399         glwebtools::Error SetUrl(const std::string& url, unsigned int port=0);
00400
00402
00425         glwebtools::Error SetUrl(UrlRequest::Protocol protocol, const char* authority, const char* path,unsigned int port=0);
00426
00428
00451         glwebtools::Error SetUrl(UrlRequest::Protocol protocol, const std::string& authority, const std::string& path,unsigned int port=0);
00452
00454
00466         glwebtools::Error SetHTTPUrl(const char* authority, const char* path=0,unsigned int port=0);
00467
00469
00481         glwebtools::Error SetHTTPUrl(const std::string& authority, const std::string& path,unsigned int port=0);
00482
00484
00496         glwebtools::Error SetHTTPSUrl(const char* authority, const char* path=0,unsigned int port=0);
00497
00499
00511         glwebtools::Error SetHTTPSUrl(const std::string& authority, const std::string& path,unsigned int port=0);
00512
00514
00522         glwebtools::Error SetMethod(UrlRequest::Method method);
00523
00525
00534         glwebtools::Error SetData(const std::string& data);
00535
00537
00548         glwebtools::Error SetData(const void* data, size_t dataSize);
00549
00551
00560         glwebtools::Error SetData(const std::map<std::string, std::string>& dataMap);
00561
00563
00572         glwebtools::Error AddData(const std::map<std::string, std::string>& dataMap);
00573
00575
00586         glwebtools::Error AddData(const char* key, const char* value);
00587
00589
00600         glwebtools::Error AddData(const char* key, const std::string& value);
00601
00603
00614         glwebtools::Error AddData(const std::string& key, const std::string& value);
00615
00617
00624         glwebtools::Error ClearData();
00625
00627
00630         bool IsHandleValid() const;
00631
00633
00638         bool IsInitialState() const;
00639
00641
00647         bool IsReadyToRun() const;
00648
00650
00655         bool IsRunning() const;
00656
00658
00664         bool IsError() const;
00665
00667
00672         glwebtools::Error GetCreationSettings(UrlRequest::CreationSettings& cs) const;
00673
00674 private:
00675
00676         UrlRequest(unsigned int token);
00677
00678         friend class glwebtools::GlWebToolsCore;
00679         friend class glwebtools::UrlConnection;
00680 };
00681
00683 class UrlResponse : public HandleBase<UrlConnectionCore>
00684 {
00685 public:
00687         UrlResponse();
00689         virtual ~UrlResponse();
00691         UrlResponse(const UrlResponse& rhs);
00693         UrlResponse& operator=(const UrlResponse& rhs);
00694
00696
00703         glwebtools::Error Release();
00704
00706
00717         glwebtools::Error GetData(const void*& dataPtr, size_t& dataSize) const;
00718
00720
00730         glwebtools::Error GetDataAsString(std::string& outString) const;
00731
00733
00736         long GetResponseCode() const;
00737
00739
00743         const char* GetHeaderField(const char* fieldId) const;
00744
00746
00749         bool IsHandleValid() const;
00750
00752
00757         bool IsResponseReady() const;
00758
00760
00764         bool IsHTTPError() const;
00765
00766 private:
00767
00768         UrlResponse(unsigned int token);
00769
00770         friend class glwebtools::GlWebToolsCore;
00771         friend class glwebtools::UrlConnection;
00772 };
00773
00774 }// namespace glwebtools
00775
00776 #endif


GLWebTools: glwebtools_urlrequest.h Source File

  • File List
glwebtools_urlrequest.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_URL_REQUEST_INCLUDED_
00003 #define _GLWEBTOOLS_URL_REQUEST_INCLUDED_
00004
00005 #include <glwebtools/internal/glwebtools_types.h>
00006 #include <glwebtools/internal/glwebtools_memory.h>
00007
00008 #include <glwebtools/glwebtools_urlhandle.h>
00009
00010 #include <glwebtools/os/glwebtools_mutex.h>
00011
00012 #define GLWEBTOOLS_CONTENT_TYPE_APPLICATION_URL_ENCODED "application/x-www-form-urlencoded"
00013 #define GLWEBTOOLS_CONTENT_TYPE_APPLICATION_JSON        "application/json"
00014
00015 namespace glwebtools
00016 {
00017
00018 class UrlConnectionCore;
00019 class GlWebToolsCore;
00020 class UrlRequest;
00021
00023 class UrlRequestCore : public Managed
00024 {
00025 public:
00026
00027         virtual ~UrlRequestCore();
00028
00029 private:
00031
00034         UrlRequest::Method GetMethod() const;
00036
00039         UrlRequest::State GetState() const;
00040
00042
00045         glwebtools::Error Reset();
00046
00048
00053         glwebtools::Error AddHeaders(const char* headerField, const char* value);
00054
00056
00060         glwebtools::Error AddHeaders(const std::map<std::string, std::string>& headerMap);
00061
00063
00068         glwebtools::Error SetUrl(const char* url, unsigned int port=0);
00069
00071
00078         glwebtools::Error SetUrl(UrlRequest::Protocol protocol, const char* authority, const char* path,unsigned int port=0);
00079
00081
00085         glwebtools::Error SetHeaders(const std::map<std::string, std::string>& headerMap);
00086
00088
00092         glwebtools::Error SetMethod(UrlRequest::Method method);
00093
00095
00100         glwebtools::Error SetData(const std::string& data);
00101
00103
00108         glwebtools::Error SetData(const std::map<std::string, std::string>& dataMap);
00109
00111
00117         glwebtools::Error SetData(const void* data, size_t dataSize);
00118
00120
00126         glwebtools::Error AddData(const char* key, const char* value);
00127
00129
00134         glwebtools::Error AddData(const std::map<std::string, std::string>& dataMap);
00135
00137
00140         glwebtools::Error ClearData();
00141
00143
00146         glwebtools::Error ClearHeaders();
00147
00149
00154         glwebtools::Error GetCreationSettings(UrlRequest::CreationSettings& cs) const;
00155
00156 private:
00157
00158         explicit UrlRequestCore(const UrlRequest::CreationSettings& cs);
00159
00160         bool SetState(UrlRequest::State state);
00161         bool SetupHandler(void* handler);
00162
00163         //shared internal mutex less method
00164         glwebtools::Error _AddHeaders(const char* headerField, const char* value);
00165         glwebtools::Error _AddData(const char* key, const char* value);
00166
00167         // Managed override
00168         virtual bool CanDelete() const;
00169         virtual unsigned int Grab();
00170         virtual unsigned int Drop();
00171
00172         unsigned int GetCounter();
00173         unsigned int GetToken();
00174         void SetToken(unsigned int token);
00175
00176         std::string m_url;
00177         unsigned int m_port;
00178         //PairedStringMap m_headerMap;
00179         std::string m_data;
00180
00181         UrlRequest::Method m_method;
00182         UrlRequest::State m_state;
00183
00184         void* m_implData;
00185
00186         mutable Mutex m_mutex;
00187
00188         unsigned int m_token;
00189
00190         UrlRequest::CreationSettings m_creationSettings;
00191
00192         friend class glwebtools::UrlConnectionCore;
00193         friend class glwebtools::GlWebToolsCore;
00194         friend class glwebtools::UrlRequest;
00195 };
00196 }
00197
00198 #endif


GLWebTools: glwebtools_urlrequest_xmlhttprequest2_helper.h Source File

  • File List
glwebtools_urlrequest_xmlhttprequest2_helper.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_URL_REQUEST_XMLHTTPREQUEST_HELPER_INCLUDED_
00003 #define _GLWEBTOOLS_URL_REQUEST_XMLHTTPREQUEST_HELPER_INCLUDED_
00004
00005 #include <glwebtools/internal/glwebtools_common.h>
00006 #include <glwebtools/internal/glwebtools_types.h>
00007
00008 namespace glwebtools
00009 {
00010         struct XMLHTTPRequestHelper
00011         {
00012                 std::map<std::string, std::string>* m_pHeaderMap;
00013                 std::string* m_pUrl;
00014                 std::string* m_pData;
00015                 unsigned int m_port;
00016         };
00017 }
00018
00019 #endif//_GLWEBTOOLS_URL_REQUEST_XMLHTTPREQUEST_HELPER_INCLUDED_


GLWebTools: glwebtools_urlresponse.h Source File

  • File List
glwebtools_urlresponse.h
00001 #pragma once
00002 #ifndef _GLWEBTOOLS_URL_RESPONSE_INCLUDED_
00003 #define _GLWEBTOOLS_URL_RESPONSE_INCLUDED_
00004
00005 #include <glwebtools/internal/glwebtools_types.h>
00006 #include <glwebtools/tool/glwebtools_mutabledata.h>
00007
00008 namespace glwebtools
00009 {
00010
00011 class UrlConnectionCore;
00012
00014 class UrlResponseCore
00015 {
00016 public:
00017         ~UrlResponseCore();
00018
00020
00025         glwebtools::Error GetData(const void*& dataPtr, size_t& dataSize) const;
00026
00028
00033         glwebtools::Error GetDataAsString(glwebtools::String& outString) const;
00034
00036
00039         long GetResponseCode() const;
00040
00042
00046         const char* GetHeaderField(const char* fieldId) const;
00047
00048 private:
00049         typedef PairedStringMapLowerCaseCompare HeaderMapType;
00050
00051 private:
00052         UrlResponseCore();
00053
00054         void SetResponseCode(long code);
00055         bool AddHeaderField(const char* key, const char* value);
00056         bool AddData(const void* data, size_t size);
00057
00058         long m_responseCode;
00059
00060         HeaderMapType m_headerFields;
00061
00062         MutableData* m_data;
00063
00064         friend class glwebtools::UrlConnectionCore;
00065 };
00066
00067 } //namespace glwebtools
00068
00069 #endif //_GLWEBTOOLS_URL_RESPONSE_INCLUDED_


GLWebTools: glwebtools_version.h Source File

  • File List
glwebtools_version.h
00001 #ifndef _GLWEBTOOLS_VERSION_INCLUDED_
00002 #define _GLWEBTOOLS_VERSION_INCLUDED_
00003 #define GLWEBTOOLS_VERSION_MAJOR 2
00004 #define GLWEBTOOLS_VERSION_MINOR 0
00005 #define GLWEBTOOLS_VERSION_BUILD 2329
00006 #define GLWEBTOOLS_VERSION_MAJOR_STR "2"
00007 #define GLWEBTOOLS_VERSION_MINOR_STR "0"
00008 #define GLWEBTOOLS_VERSION_BUILD_STR "2329"
00009 #define GLWEBTOOLS_VERSION GLWEBTOOLS_VERSION_MAJOR_STR"."GLWEBTOOLS_VERSION_MINOR_STR
00010 #define GLWEBTOOLS_VERSION_COMPLETE GLWEBTOOLS_VERSION_MAJOR_STR"."GLWEBTOOLS_VERSION_MINOR_STR"."GLWEBTOOLS_VERSION_BUILD_STR
00011 #endif //_GLWEBTOOLS_VERSION_INCLUDED_
00012


GLWebTools: Main Page

GLWebTools Documentation


GLWebTools: Namespace Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Typedefs
  • Enumerator
  • E_CONNECTION_CANCELLED : glwebtools
  • E_CONNECTION_NOTHREAD : glwebtools
  • E_INITIALIZATION_ERROR : glwebtools
  • E_INVALID_CREATION_SETTINGS : glwebtools
  • E_INVALID_DATA : glwebtools
  • E_INVALID_HANDLE : glwebtools
  • E_INVALID_OPERATION : glwebtools
  • E_INVALID_PARAMETER : glwebtools
  • E_MEMORY_ERROR : glwebtools
  • E_OBJECT_BUSY : glwebtools
  • E_SUCCESS : glwebtools
  • E_TASK_NOT_FOUND : glwebtools
  • E_TIMEOUT : glwebtools
  • E_TYPE_REGISTRATION_ERROR : glwebtools
  • E_UNKNOWN : glwebtools


GLWebTools: Namespace Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Typedefs
  • Enumerator
  • ByIndex() : glwebtools
  • ByName() : glwebtools
  • operator<<() : glwebtools
  • operator>>() : glwebtools


GLWebTools: Namespace Members

  • Namespace List
  • Namespace Members
  • All
  • Functions
  • Typedefs
  • Enumerator
  • uptr_t : glwebtools


GLWebTools: Member List

  • glwebtools
  • ArgumentWrapper
glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > Member List
This is the complete list of members for glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER >, including all inherited members.
ArgumentWrapper() | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [inline]
ArgumentWrapper(const ArgumentWrapper &other) | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [inline]
ArgumentWrapper(const GLWEBTOOLS_T &value, VALIDATOR validator, FORMATTER formatter) | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [inline]
ArgumentWrapper(const GLWEBTOOLS_T &value, VALIDATOR validator) | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [inline]
ArgumentWrapper(const GLWEBTOOLS_T &value) | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [inline]
Formatter() const | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [inline]
IsValid() const | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [inline]
operator GLWEBTOOLS_T const &() const | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [inline]
operator<<(std::ostream &os, const ArgumentWrapper &value) | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [friend]
operator=(const ArgumentWrapper &other) | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [inline]
operator=(const GLWEBTOOLS_T &value) | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [inline]
operator==(const ArgumentWrapper &other) const | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [inline]
operator==(const GLWEBTOOLS_T &other) const | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [inline]
Reset() | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [inline]
SetMember(FIELD_T GLWEBTOOLS_U::*member, VALUE_T value) | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [inline]
SetMember(GLWEBTOOLS_MEMBER member) | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [inline]
ToString(std::string &str) const | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [inline]
ToString() const | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [inline]
Validator() const | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [inline]
Value() const | glwebtools::ArgumentWrapper< GLWEBTOOLS_T, VALIDATOR, FORMATTER > | [inline]


GLWebTools: Member List

  • glwebtools
  • AttributeValidator
glwebtools::AttributeValidator Member List
This is the complete list of members for glwebtools::AttributeValidator, including all inherited members.
operator()(VALUE value) const glwebtools::AttributeValidator [inline]


GLWebTools: Member List

  • glwebtools
  • ExcludedItems
glwebtools::ExcludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > Member List
This is the complete list of members for glwebtools::ExcludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE >, including all inherited members.


GLWebTools: Member List

  • glwebtools
  • FalseType
glwebtools::FalseType Member List
This is the complete list of members for glwebtools::FalseType, including all inherited members.


GLWebTools: Member List

  • glwebtools
  • GlWebTools
  • CreationSettings
glwebtools::GlWebTools::CreationSettings Member List
This is the complete list of members for glwebtools::GlWebTools::CreationSettings, including all inherited members.
CreationSettings() | glwebtools::GlWebTools::CreationSettings
m_applicationIdentifier | glwebtools::GlWebTools::CreationSettings
m_applicationVersion | glwebtools::GlWebTools::CreationSettings
m_connectionHysteresis_ms | glwebtools::GlWebTools::CreationSettings
m_connectionMaxThreadCount | glwebtools::GlWebTools::CreationSettings
m_connectionMinThreadCount | glwebtools::GlWebTools::CreationSettings
m_connectionThreadPriority | glwebtools::GlWebTools::CreationSettings
m_deviceIdentifier | glwebtools::GlWebTools::CreationSettings
m_instanceName | glwebtools::GlWebTools::CreationSettings
m_isThreadedUpdate | glwebtools::GlWebTools::CreationSettings
m_maxThreadStartTime_ms | glwebtools::GlWebTools::CreationSettings
m_osIdentifier | glwebtools::GlWebTools::CreationSettings
m_osVersion | glwebtools::GlWebTools::CreationSettings
m_threadedUpdatePeriod | glwebtools::GlWebTools::CreationSettings
m_updateThreadPriority | glwebtools::GlWebTools::CreationSettings


GLWebTools: Member List

  • glwebtools
  • IncludedItems
glwebtools::IncludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE > Member List
This is the complete list of members for glwebtools::IncludedItems< GLWEBTOOLS_ITERATOR, GLWEBTOOLS_VALUE >, including all inherited members.


GLWebTools: Member List

  • glwebtools
  • IndexedValue
glwebtools::IndexedValue< GLWEBTOOLS_VALUE > Member List
This is the complete list of members for glwebtools::IndexedValue< GLWEBTOOLS_VALUE >, including all inherited members.


GLWebTools: Member List

  • glwebtools
  • IsArgumentOptional
glwebtools::IsArgumentOptional< GLWEBTOOLS_T > Member List
This is the complete list of members for glwebtools::IsArgumentOptional< GLWEBTOOLS_T >, including all inherited members.


GLWebTools: Member List

  • glwebtools
  • IsArgumentRequired
glwebtools::IsArgumentRequired< GLWEBTOOLS_T > Member List
This is the complete list of members for glwebtools::IsArgumentRequired< GLWEBTOOLS_T >, including all inherited members.


GLWebTools: Member List

  • glwebtools
  • IsArgumentWrapped
glwebtools::IsArgumentWrapped< GLWEBTOOLS_T > Member List
This is the complete list of members for glwebtools::IsArgumentWrapped< GLWEBTOOLS_T >, including all inherited members.


GLWebTools: Member List

  • glwebtools
  • IsList
glwebtools::IsList< GLWEBTOOLS_T > Member List
This is the complete list of members for glwebtools::IsList< GLWEBTOOLS_T >, including all inherited members.


GLWebTools: Member List

  • glwebtools
  • IsRange
glwebtools::IsRange< GLWEBTOOLS_T > Member List
This is the complete list of members for glwebtools::IsRange< GLWEBTOOLS_T >, including all inherited members.


GLWebTools: Member List

  • glwebtools
  • NameValuePair
glwebtools::NameValuePair< GLWEBTOOLS_VALUE > Member List
This is the complete list of members for glwebtools::NameValuePair< GLWEBTOOLS_VALUE >, including all inherited members.


GLWebTools: Member List

  • glwebtools
  • Not
glwebtools::Not< LEFT > Member List
This is the complete list of members for glwebtools::Not< LEFT >, including all inherited members.


GLWebTools: Member List

  • glwebtools
  • Or
glwebtools::Or< LEFT, RIGHT > Member List
This is the complete list of members for glwebtools::Or< LEFT, RIGHT >, including all inherited members.


GLWebTools: Member List

  • glwebtools
  • StringValidator
glwebtools::StringValidator Member List
This is the complete list of members for glwebtools::StringValidator, including all inherited members.
operator()(const std::string &value) const glwebtools::StringValidator [inline]


GLWebTools: Member List

  • glwebtools
  • ThreadPool
  • CreationSettings
glwebtools::ThreadPool::CreationSettings Member List
This is the complete list of members for glwebtools::ThreadPool::CreationSettings, including all inherited members.
CreationSettings() | glwebtools::ThreadPool::CreationSettings
CreationSettings(unsigned int minThreadCount, unsigned int maxThreadCount, glwebtools::Thread::Priority threadPriority, unsigned int hysteresis_ms, unsigned int maxThreadStartTime_ms) | glwebtools::ThreadPool::CreationSettings
m_hysteresis_ms | glwebtools::ThreadPool::CreationSettings
m_maxThreadCount | glwebtools::ThreadPool::CreationSettings
m_maxThreadStartTime_ms | glwebtools::ThreadPool::CreationSettings
m_minThreadCount | glwebtools::ThreadPool::CreationSettings
m_threadPriority | glwebtools::ThreadPool::CreationSettings


GLWebTools: Member List

  • glwebtools
  • TrueType
glwebtools::TrueType Member List
This is the complete list of members for glwebtools::TrueType, including all inherited members.


GLWebTools: Member List

  • glwebtools
  • UrlConnection
  • CreationSettings
glwebtools::UrlConnection::CreationSettings Member List
This is the complete list of members for glwebtools::UrlConnection::CreationSettings, including all inherited members.
CreationSettings() | glwebtools::UrlConnection::CreationSettings
CreationSettings(unsigned int maxConnections, bool failOnReponse400andHigher, bool follow302, unsigned int connectTimeout, glwebtools::Thread::Priority threadPriority, bool enableAcceptEncoding, const char *acceptEncoding) | glwebtools::UrlConnection::CreationSettings
CreationSettings(unsigned int maxConnections, bool failOnReponse400andHigher, bool follow302, unsigned int connectTimeout, const std::string &taskGroupId, glwebtools::Thread::Priority threadPriority, bool enableAcceptEncoding, const char *acceptEncoding) | glwebtools::UrlConnection::CreationSettings
m_acceptEncoding | glwebtools::UrlConnection::CreationSettings
m_connectTimeout | glwebtools::UrlConnection::CreationSettings
m_enableAcceptEncoding | glwebtools::UrlConnection::CreationSettings
m_follow302 | glwebtools::UrlConnection::CreationSettings
m_maxConnections | glwebtools::UrlConnection::CreationSettings
m_peerCAFile | glwebtools::UrlConnection::CreationSettings
m_supportServerSideEvent | glwebtools::UrlConnection::CreationSettings
m_taskGroupId | glwebtools::UrlConnection::CreationSettings
m_taskStartTimeout | glwebtools::UrlConnection::CreationSettings
m_threadPriority | glwebtools::UrlConnection::CreationSettings
m_timeout | glwebtools::UrlConnection::CreationSettings
m_useDataPacketQueue | glwebtools::UrlConnection::CreationSettings
m_userAgent | glwebtools::UrlConnection::CreationSettings