10 #ifndef PIMCALENDARITEM_HPP_
11 #define PIMCALENDARITEM_HPP_
48 bool parse(std::string rawFieldString,
bool forceParams =
false);
54 void setValue(
const std::string& value);
77 std::map<std::string, std::set<std::string> >
getParams()
const;
84 void processParam (std::string paramLine);
91 void addParam(std::string paramName, std::set<std::string> values);
94 std::map<std::string, std::set<std::string> > params;
116 bool parse(
const std::string& rawData);
135 std::map<std::string, std::vector<ItemField> >
fields;
136 std::map<std::string, std::vector< SmartPtr<KeyValueItem> > >
subcomponents;
139 bool processSubcomponent();
142 std::string currentSubcomponentName;
143 std::string currentSubcomponentData;
197 static std::map<std::string, KeyValueItemFactory*> factories;
204 #define CREATE_KEY_VALUE_ITEM_FACTORY(KeyValueItemClass, ComponentType) \
205 class KeyValueItemClass##Factory : public KeyValueItemFactory \
208 KeyValueItemClass##Factory() : KeyValueItemFactory() \
210 KeyValueItemFactory::registerFactory(this, ComponentType); \
212 ~KeyValueItemClass##Factory(){} \
214 KeyValueItem* createItem() \
216 return new KeyValueItemClass(); \
218 } KeyValueItemClass##FactoryInstance;
236 bool parse(
const std::string& iCalendar);
243 std::string iCalendar;
276 #endif // PIMCALENDARITEM_HPP_
bool parse(const std::string &iCalendar)
Parses item from string. Format of string to be parsed from depends on type of item.
Definition: PIMCalendarItem.cpp:332
KeyValueItemFactory()
Definition: PIMCalendarItem.hpp:176
std::string currentLine
Definition: PIMCalendarItem.hpp:131
std::map< std::string, std::vector< ItemField > > fields
Definition: PIMCalendarItem.hpp:135
PIMCalendarTaskItem()
Constructor.
Definition: PIMCalendarItem.cpp:401
~VDayLightTimeZoneKeyValueItem()
Definition: PIMCalendarItem.hpp:153
ItemField()
default constructor
Definition: PIMCalendarItem.cpp:17
virtual ~KeyValueItemFactory()
Definition: PIMCalendarItem.hpp:177
virtual ~KeyValueItem()
Definition: PIMCalendarItem.cpp:175
bool operator<(const ItemField &other) const
comparison operator, required so fields can be stored in std::map
Definition: PIMCalendarItem.cpp:164
virtual ~PIMCalendarTaskItem()
Destructor, virtual by default.
Definition: PIMCalendarItem.cpp:406
Factory for creating KeyValueItem object.
Definition: PIMCalendarItem.hpp:173
VStandardTimeZoneKeyValueItem()
Definition: PIMCalendarItem.hpp:164
std::map< std::string, std::vector< ItemField > > & getFields()
Returns all fields of item.
Definition: PIMCalendarItem.hpp:122
~VStandardTimeZoneKeyValueItem()
Definition: PIMCalendarItem.hpp:165
bool parse(const std::string &rawData)
parses item from raw data string
Definition: PIMCalendarItem.cpp:234
Smart pointer implementation for safely passing around dynamically created data. Smart pointers are r...
Definition: SmartPtr.hpp:32
Documentation for class PIMCalendarItem.
Definition: PIMCalendarItem.hpp:223
Definition: PIMCalendarItem.hpp:260
static void registerFactory(KeyValueItemFactory *factory, const std::string &componentType)
Registers factory for given component type.
Definition: PIMCalendarItem.cpp:303
bool processField()
Handler that processed contents of given fields. Can be override in child classes.
Definition: PIMCalendarItem.hpp:167
virtual KeyValueItem * createItem()=0
bool parse(std::string rawFieldString, bool forceParams=false)
Parses given field from raw string.
Definition: PIMCalendarItem.cpp:23
Class representing item containing fields in form of key value pairs, that can contain additional par...
Definition: PIMCalendarItem.hpp:102
virtual ~PIMCalendarItem()=0
Destructor, virtual by default.
Definition: PIMCalendarItem.cpp:328
void setValue(const std::string &value)
Sets value of field.
Definition: PIMCalendarItem.cpp:60
std::map< std::string, std::vector< SmartPtr< KeyValueItem > > > subcomponents
Definition: PIMCalendarItem.hpp:136
virtual ~PIMCalendarEventItem()
Destructor, virtual by default.
Definition: PIMCalendarItem.cpp:397
std::string currentFieldValue
Definition: PIMCalendarItem.hpp:133
PIMCalendarItem(PIMItemType t)
Constructor.
Definition: PIMCalendarItem.cpp:322
std::string toString() const
Returns string representation of field.
Definition: PIMCalendarItem.cpp:112
KeyValueItem()
default constructor
Definition: PIMCalendarItem.cpp:169
Class representing single field of iCalendar object. Field can have assigned value and list of parame...
Definition: PIMCalendarItem.hpp:29
~ItemField()
Definition: PIMCalendarItem.cpp:21
bool processField()
Handler that processed contents of given fields. Can be override in child classes.
Definition: PIMCalendarItem.hpp:155
PIMItemType
Definition: PIMItemIndex.hpp:24
PIMCalendarEventItem()
Constructor.
Definition: PIMCalendarItem.cpp:392
std::string getValue() const
Returns value of field.
Definition: PIMCalendarItem.cpp:154
std::string getRawData() const
Returns raw data of item. Format of raw data depends on type of item.
Definition: PIMCalendarItem.cpp:387
virtual bool processField()
Handler that processed contents of given fields. Can be override in child classes.
Definition: PIMCalendarItem.cpp:215
std::string currentFieldValueOriginal
Definition: PIMCalendarItem.hpp:134
SmartPtr< PIMItemIndex > getIndex()
Returns index for given item.
Definition: PIMCalendarItem.cpp:339
std::map< std::string, std::set< std::string > > getParams() const
Returns all parameters of field.
Definition: PIMCalendarItem.cpp:159
std::string currentFieldName
Definition: PIMCalendarItem.hpp:132
VDayLightTimeZoneKeyValueItem()
Definition: PIMCalendarItem.hpp:152
Special implementation for VSTANDARD item of VTIMEZONE that ignores item.
Definition: PIMCalendarItem.hpp:161
Special implementation for VDAYLIGHT item of VTIMEZONE that ignores item.
Definition: PIMCalendarItem.hpp:149
Class representing PIM item.
Definition: PIMItem.hpp:22
Definition: PIMCalendarItem.hpp:246