OpenAB  1.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
OpenAB Namespace Reference

namespace OpenAB More...

Classes

class  BasicHttpAuthorizer
 Class BasicHttpAuthorizer. Implements HTTP Basic authentication method. More...
 
class  DefaultLogger
 
class  HttpAuthorizer
 HttpAuthorizer interface. This should be used by classes implementing different Http authorization methods. More...
 
class  HttpMessage
 HttpMessage class. Represents Http request that can be executed using HttpSession object. More...
 
class  HttpSession
 HttpSession class. Allows to send Http requests. More...
 
class  ItemField
 Class representing single field of iCalendar object. Field can have assigned value and list of parameters. Fields itself does not know its name. More...
 
class  KeyValueItem
 Class representing item containing fields in form of key value pairs, that can contain additional parameters for each field. Each item can also contain nested items. More...
 
class  KeyValueItemFactory
 Factory for creating KeyValueItem object. More...
 
class  Logger
 Logger class, allows to override way in which messages from OpenAB will be logged. More...
 
class  OAuth2HttpAuthorizer
 Class OAuth2HttpAuthorizer Implements OAuth2 authentication method. More...
 
class  PIMCalendarEventItem
 
class  PIMCalendarEventItemIndex
 
class  PIMCalendarItem
 Documentation for class PIMCalendarItem. More...
 
class  PIMCalendarItemIndex
 Documentation for class PIMCalendarItemIndex. It implements PIMItemIndex for OpenAB::eEvent or OpenAB::eTask type, additionally allows to define which PIMItemCheck should be used to construct PIMCalendarItemIndex objects. More...
 
class  PIMCalendarTaskItem
 
class  PIMCalendarTaskItemIndex
 
class  PIMContactItem
 Class representing PIM contact item. More...
 
class  PIMContactItemIndex
 Documentation for class PIMContactItemIndex. It implements PIMItemIndex for OpenAB::eContact type, additionally allows to define which PIMItemCheck should be used to construct PIMContactItemIndex objects. More...
 
class  PIMItem
 Class representing PIM item. More...
 
class  PIMItemIndex
 Documentation for class PIMItemIndex. PIMItemIndex is a PIMItem representation used to match and compare PIMItems. Set of PIMItem fields is stored along with comparison rules allowing matching and comparing of PIMItems. PIMItemIndex is intended to be used by OpenAB_Sync::Sync plugins. More...
 
class  PluginManager
 PluginManager provides way to manage OpenAB plugins. Allows to discover modules that are providing OpenAB plugins, and load/unload them. More...
 
class  SecureString
 SecureString class, used to store strings like passwords etc. Current implementation encodes string into two strings using simple XOR encoding. More...
 
class  SmartPtr
 Smart pointer implementation for safely passing around dynamically created data. Smart pointers are reference counted, data that they are managing is automatically freed when no other references to it exist. More...
 
class  TimeStamp
 Class representing time stamp. Allows for basic operations like adding and subtracting time stamps. More...
 
class  Variant
 Variant class that can contains different types of data. More...
 
class  VCardField
 Represents single parsed vCard field. Filed has its value and additionally it can have set of parameters (each of parameter can have multiple values). More...
 
class  VCardPhoto
 Helper class for handling vCard fields of PHOTO or LOGO type. More...
 
class  VDayLightTimeZoneKeyValueItem
 Special implementation for VDAYLIGHT item of VTIMEZONE that ignores item. More...
 
class  VStandardTimeZoneKeyValueItem
 Special implementation for VSTANDARD item of VTIMEZONE that ignores item. More...
 

Enumerations

enum  PIMItemType { eContact, eEvent, eTask }
 

Functions

bool contains (const std::vector< std::string > &vec, const std::string &str)
 Checks if given string is contained in vector of strings. More...
 
void trimWhitespaces (std::string &str)
 Removes whitespaces from beginning and end of given string. More...
 
void trimSpaces (std::string &str)
 Removes whitespaces and spaces from beginning and end of given string. More...
 
std::vector< std::string > tokenize (const std::string &str, char delimiter, bool unique=false, bool leaveEmptyTokens=true)
 Tokenizes string. Uses provided delimiter for tokens, process can be controlled by behavior in case of duplicated and empty tokens. More...
 
void eraseAllOccurences (std::string &str, char toRemove)
 Removes all occurences of given character from string. More...
 
std::string cut (const std::string &str, const std::string &begin, const std::string &end, std::string::size_type &pos)
 Cuts part of string contained between two substrings. More...
 
std::vector< std::string > parserURL (const std::string &url)
 Parses URL into parts. URL is parsed into four parts: scheme (http, https, ftp, etc.), host, path and query, eg. http://www.google.com/search?q=test will be parsed into: More...
 
std::string parseURLHostPart (const std::string &url)
 Parses host part out of URL. More...
 
void substituteAll (std::string &str, const std::string &from, const std::string &to)
 Substitutes all occurrences of given substring. More...
 
bool beginsWith (const std::string &str, const std::string &substr)
 Checks if given string begins with given substring. More...
 
bool endsWith (const std::string &str, const std::string &substr)
 Checks if given string ends with given substring. More...
 
bool getUnfoldedLine (std::istream &is, std::string &str)
 
void linearize (std::string &str)
 Unfolds all lines in provided string. check if it does not duplicates functionality from getUnfoldedLine. More...
 
void unquoteSpecialCharacters (std::string &str)
 Removes quotation of special characters e.g. converts "\," into ",". More...
 
std::string percentDecode (const std::string &uri)
 
void OpenAB_init ()
 Perform the default initialization steps required by OpenAB. More...
 
 CREATE_KEY_VALUE_ITEM_FACTORY (VStandardTimeZoneKeyValueItem,"standard")
 
 CREATE_KEY_VALUE_ITEM_FACTORY (VDayLightTimeZoneKeyValueItem,"daylight")
 

Detailed Description

namespace OpenAB

namespace Ias

Enumeration Type Documentation

Enumerator
eContact 

Contact

eEvent 

Calendar event

eTask 

Task

Function Documentation

bool OpenAB::beginsWith ( const std::string &  str,
const std::string &  substr 
)

Checks if given string begins with given substring.

Parameters
[in]strstring to be checked.
[in]substrsubstring to be checked.
Returns
true if string begins with given substring, false otherwise.
bool OpenAB::contains ( const std::vector< std::string > &  vec,
const std::string &  str 
)

Checks if given string is contained in vector of strings.

Parameters
[in]vecvector of string to be checked.
[in]strstring to be searched in vector of strings.
Returns
true if string was found in vector, false otherwise.
OpenAB::CREATE_KEY_VALUE_ITEM_FACTORY ( VStandardTimeZoneKeyValueItem  ,
"standard"   
)
OpenAB::CREATE_KEY_VALUE_ITEM_FACTORY ( VDayLightTimeZoneKeyValueItem  ,
"daylight"   
)
std::string OpenAB::cut ( const std::string &  str,
const std::string &  begin,
const std::string &  end,
std::string::size_type &  pos 
)

Cuts part of string contained between two substrings.

Parameters
[in]strstring from which part should be cut.
[in]beginbeginning substring
[in]endending substring
[in,out]posposition from which beginning substring should be searched, after cutting it will point to position after end substring. If no beginning/end substring will be found it will be set to std::string::npos.
Returns
cut substring or empty string.
bool OpenAB::endsWith ( const std::string &  str,
const std::string &  substr 
)

Checks if given string ends with given substring.

Parameters
[in]strstring to be checked.
[in]substrsubstring to be checked.
Returns
true if string ends with given substring, false otherwise.
void OpenAB::eraseAllOccurences ( std::string &  str,
char  toRemove 
)

Removes all occurences of given character from string.

Parameters
[in,out]strstring from which all occurences of character should be removed.
[in]toRemovecharacter to be removed.
bool OpenAB::getUnfoldedLine ( std::istream &  is,
std::string &  str 
)

Reads one line from stream and unflods it using line folding rule defined in RFC2425 -5.8.1

Parameters
[in]isinput stream from which line should be read
[oun]str output of unfolded line
Returns
false if input stream has ended, true otherwise
void OpenAB::linearize ( std::string &  str)

Unfolds all lines in provided string. check if it does not duplicates functionality from getUnfoldedLine.

Parameters
[in,out]stringto be unfolded
void OpenAB::OpenAB_init ( )

Perform the default initialization steps required by OpenAB.

The basic initialization consist of:

  • Initialization of the log level (def=Info)
    AB_Log::Log::OutLevel() = OpenAB_Log::Log::Info;
  • Scan of the plugin folder ({prefix}/lib/OpenAB/*.so)
Note
OpenAB_init is not mandatory. These steps can be easily integrated in the code to allow any degree of customization (see: test/plugin/example/main.cpp).
std::vector< std::string > OpenAB::parserURL ( const std::string &  url)

Parses URL into parts. URL is parsed into four parts: scheme (http, https, ftp, etc.), host, path and query, eg. http://www.google.com/search?q=test will be parsed into:

  • http
  • www.google.com
  • search
  • q=test
    Parameters
    [in]urlURL to be parsed
    Returns
    vector of four strings containing parts of parsed URL (scheme, host, path, query). Returned vector will always have size of four, some of them may be empty if provided URL does not contain all parts described above.
std::string OpenAB::parseURLHostPart ( const std::string &  url)

Parses host part out of URL.

Parameters
[in]urlurl to be parsed.
Returns
concatenated scheme and host parts of original URL.
std::string OpenAB::percentDecode ( const std::string &  uri)
void OpenAB::substituteAll ( std::string &  str,
const std::string &  from,
const std::string &  to 
)

Substitutes all occurrences of given substring.

Parameters
[in,out]strstring in which substring should be substituted.
[in]fromsubstring that should be substituted.
[in]tostring to which substring should be substituted.
Todo:
Performance for large strings is not good.
std::vector< std::string > OpenAB::tokenize ( const std::string &  str,
char  delimiter,
bool  unique = false,
bool  leaveEmptyTokens = true 
)

Tokenizes string. Uses provided delimiter for tokens, process can be controlled by behavior in case of duplicated and empty tokens.

Parameters
[in]strstring to be tokenized.
[in]delimiterdelimiter of tokens.
[in]uniqueshould duplicated tokens be removed.
[in]leaveEmptyTokensshould empty tokens be keep.
Returns
vector of tokens.
void OpenAB::trimSpaces ( std::string &  str)

Removes whitespaces and spaces from beginning and end of given string.

Parameters
[in,out]strstring from which spaces should be removed.
void OpenAB::trimWhitespaces ( std::string &  str)

Removes whitespaces from beginning and end of given string.

Parameters
[in,out]strstring from which whitespaces should be removed.
void OpenAB::unquoteSpecialCharacters ( std::string &  str)

Removes quotation of special characters e.g. converts "\," into ",".

Parameters
[in,out]stringfrom which special characters should be unquoted