OpenAB  1.0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
GDataContactsConverter.hpp
Go to the documentation of this file.
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5  */
10 #ifndef GDATACONTACTSCONVERTER_HPP_
11 #define GDATACONTACTSCONVERTER_HPP_
12 
13 #include <gdata/gdata.h>
14 #include <string>
15 #include <vector>
16 
22 {
23  public:
28 
32  virtual ~GDataContactsConverter();
33 
39  static bool convert(GDataContactsContact* contact, std::string& vCard);
40 
49  static bool convert(GDataContactsContact* contact, guint8* photoData, gsize photoDataLen, gchar* photoType, std::string& vCard);
50 
51  private:
56 
60  GDataContactsConverter& operator=(GDataContactsConverter const &other);
61 
68  typedef bool (*FieldParseFunction)(GDataContactsContact* contac, std::ostringstream& stream);
69 
70  static std::vector<FieldParseFunction> fieldParsers;
71 
72  static bool convertCommon(GDataContactsContact* contact, std::ostringstream& oss);
73  static void populateParsers();
74 };
75 
76 #endif // GDATACONTACTSCONVERTER_HPP_
Class GDataContactsConverter. Converts contacts from GData format to vCards.
Definition: GDataContactsConverter.hpp:21
GDataContactsConverter()
Constructor.
Definition: GDataContactsConverter.cpp:351
virtual ~GDataContactsConverter()
Destructor, virtual by default.
Definition: GDataContactsConverter.cpp:356
static bool convert(GDataContactsContact *contact, std::string &vCard)
Converts GDataContactsContact to vCard.
Definition: GDataContactsConverter.cpp:397