Software and Services, Portable Libraries  2019.Mar.01
A library for managing digital certificates
property.hpp
Go to the documentation of this file.
1 //
2 // BEGIN_DOUGLAS_MARK_ROYER_COPYRIGHT
3 //
4 // Copyright (C) 2000-2014 Douglas Mark Royer, All Rights Reserved.
5 //
6 // NOTICE:
7 //
8 // THIS SOURCE CODE BELONGS TO DOUGLAS MARK ROYER THIS CODE IS CONSIDERED A
9 // TRADE SECRET AND IS NOT TO BE DIVULGED OR USED BY PARTIES WHO HAVE
10 // NOT RECEIVED WRITTEN AUTHORIZATION FROM THE OWNER.
11 //
12 //
13 // THIS SOFTWARE AND MANUAL ARE BOTH PROTECTED BY UNITED STATES
14 // COPYRIGHT LAW (TITLE 17 UNITED STATES CODE). UNAUTHORIZED REPRODUCTION
15 // AND/OR SALE MAY RESULT IN IMPRISONMENT OF UP TO ONE YEAR AND FINES
16 // OF UP TO $100,000 (17 USC 506). COPYRIGHT INFRINGERS MAY ALSO
17 // BE SUBJECT TO CIVIL LIABILITY.
18 //
19 // THIS NOTICE AND THE ABOVE COPYRIGHT NOTICE MUST REMAIN IN ALL
20 // COPIES AND ANY DERIVED WORK.
21 //
22 // ALL OF THIS CODE IS ORIGINAL WORK BY THE COPYRIGHT HOLDER.
23 //
24 // THIS DOCUMENT AND THE INFORMATION CONTAINED HEREIN IS
25 // PROVIDED ON AN "AS IS" BASIS AND THE OWNDER DISCLAIM ALL
26 // WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
27 // TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL
28 // NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES
29 // OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
30 //
31 // ANY SERVICE CONTRACT WILL BE UNDER A SEPARATE
32 // LICENSE.
33 //
34 // END_DOUGLAS_MARK_ROYER_COPYRIGHT
35 //
36 
44 #ifndef __DOUGLAS_MARK_ROYER_LIBRARY_ICALENDAR_PROPERTY_HPP__
45 #define __DOUGLAS_MARK_ROYER_LIBRARY_ICALENDAR_PROPERTY_HPP__
46 
47 #ifndef EXPORT_ICALENDAR
48 #ifdef BUILDING_LIBRARY_ICALENDAR
49 #define EXPORT_ICALENDAR EXPORT_OUT
50 #else
51 #define EXPORT_ICALENDAR EXPORT_IN
52 #endif
53 #endif
54 
55 #ifdef BUILDING_LIBRARY_ICALENDAR
56 #include "iCalendar.hpp"
57 #include "parameter.hpp"
58 #include "value.hpp"
59 #else
60 #include <SaS/iCalendar/iCalendar.hpp>
61 #include <SaS/iCalendar/parameter.hpp>
62 #include <SaS/iCalendar/value.hpp>
63 #endif
64 
65 using namespace std;
68 
69 namespace SoftwareAndServices
70 {
71  namespace Library
72  {
73  namespace iCalendar
74  {
79  class EXPORT_ICALENDAR property
80  : public value,
81  virtual public instance<property>
82  {
83 
84  public:
85 
93  property(bool startsWtihX, const char * xname);
94 
102  property(Tokens_t type, Tokens_t ValueType = LAST_TOKEN);
103 
111  property(Tokens_t name, int Value);
112 
120  property(Tokens_t name, const text * Value);
121 
129  property(Tokens_t name, const char * Value);
130 
138  property(Tokens_t name, const binary * Value);
139 
147  property(Tokens_t name, const boolean * Value);
148 
156  property(Tokens_t name, bool Value);
157 
165  property(Tokens_t name, const uri * Value);
166 
174  property(Tokens_t name, const upn_value * Value);
175 
183  property(Tokens_t name, const upn_filter * Value);
184 
192  property(Tokens_t name, const cal_address * Value);
193 
201  property(Tokens_t name, const utc_offset * Value);
202 
210  property(Tokens_t name, const date * Value);
211 
219  property(Tokens_t name, const time * Value);
220 
228  property(Tokens_t name, const date_time * Value);
229 
237  property(Tokens_t name, const dur_value * Value);
238 
246  property(Tokens_t name, const float_value * Value);
247 
255  property(Tokens_t name, double Value);
256 
264  property(Tokens_t name, const integer * Value);
265 
273  property(Tokens_t name, const period * Value);
274 
282  property(Tokens_t name, const recur * Value);
283 
291  property(Tokens_t name, const cal_query * Value);
292 
302  property(bool startsWithX, const text * name, const text * Value);
303 
311  property(const text * xName, const text * xValue);
312 
320  property(const char * xName, const char * xValue);
321 
329  property(const property & CopyFrom);
330 
334  virtual ~property();
335 
345  virtual bool validParams(const Tokens_t * validArray) const;
346 
356  bool parse(Parse & in, component * errors);
357 
367  bool parse(const char * in, component * errors);
368 
381  bool parseValue(Parse & in,
382  Tokens_t DefalutValueType,
383  component * errors);
384 
396  bool parseText(Parse & in,
397  Tokens_t DefalutValueType,
398  component * errors);
399 
411  bool parseDateTime(Parse & in,
412  Tokens_t DefalutValueType,
413  component * errors);
414 
420  void operator delete(void * data);
421 
428  virtual InstanceCount_t incInstance() const;
429 
436  virtual InstanceCount_t decInstance() const;
437 
445  virtual bool addParameter(const parameter * newParam);
446 
455  bool addIfNew(const parameter *);
456 
468  bool addX(const char * xName,
469  char * xValue);
470 
474  const parameterVec * getParams() const;
475 
481  parameter * getParam(const char * name) const;
482 
488  parameter * getParam(Tokens_t name) const;
489 
497  parameter * getParam(unsigned int nTh) const;
498 
506  bool sprint(String * Results) const;
507 
520  bool getParamValue(String * Results,
521  Tokens_t token,
522  unsigned int nTh);
523 
532  bool setValueType(Tokens_t type);
533 
537  Tokens_t getValueType() const;
538 
542  Tokens_t getName() const;
543 
547  const text * getXName() const;
548 
556  bool setName(Tokens_t name);
557 
565  Tokens_t setName(const char * name);
566 
574  bool remove(const parameter * param);
575 
583  bool operator==(const property & Other) const;
584 
592  bool operator!=(const property & Other) const;
593 
603  property & operator=(const property & CopyFrom);
604 
605  private:
606 
612  bool _sprintParams(String * Results) const;
613 
617  parameterVec * _parameters;
618 
622  Tokens_t _name;
623 
627  Tokens_t _valType;
628 
633  const text * _xName;
634  };
635 
640  typedef std::vector<property*> propertyVec;
641 
642  }
643  }
644 }
645 
646 #endif /*__DOUGLAS_MARK_ROYER_LIBRARY_ICALENDAR_PROPERTY_HPP__*/
This object represents an RFC-iCalendar TIME object.
Definition: time.hpp:74
STL namespace.
An RFC-iCalendar PERIOD value.
Definition: period.hpp:81
This class represents any iCalendar TEXT value type.
Definition: text.hpp:76
Generic text parsing routines.
Definition: Parse.hpp:102
An RFC-iCalendar implementation of a DATE-TIME parameter.
Definition: date_time.hpp:90
Base class for all RFC-iCalendar properties.
Definition: property.hpp:79
This supports any CAL-ADDRESS that is supported by calendaring.
Definition: cal_address.hpp:82
This is the base class for all values, that includes parameters and properties.
Definition: value.hpp:78
An RFC-iCalendar implementation of NAME property.
Definition: name.hpp:78
An RFC-iCalendar integer value.
Definition: integer.hpp:79
Instance counting and tracking.
Definition: instance.hpp:90
An RFC-iCalendar UPN-FILTER value type.
Definition: upn_filter.hpp:78
EXPORT_ICALENDAR typedef vector< property * > propertyVec
An array of property.
Definition: iCalendar.hpp:425
An RFC-iCalendar implementation of a FLOAT parameter.
Definition: float_value.hpp:73
This is a class that allows:
Definition: String.hpp:114
Copyright Douglas Mark Royer DouglasRoyer@gmail.com.
Definition: Base.hpp:98
uint64_t InstanceCount_t
Many, many instances supported by the software.
Definition: instance.hpp:83
std::vector< parameter * > parameterVec
An array of parameters.
Definition: parameter.hpp:330
This object represents a RFC-iCalendar UTC-OFFSET value.
Definition: utc_offset.hpp:78
The class is an RFC-iCalendar RECUR object.
Definition: recur.hpp:84
Storage for an RFC-iCalendar URI value.
Definition: uri.hpp:88
An RFC-iCalendar implementation of a DUR parameter.
Definition: dur_value.hpp:82
An implementation of RFC-iCalendar CAL-QUERY.
Definition: cal_query.hpp:78
This object represents an RFC-iCalendar DATE object.
Definition: date.hpp:80
Base class for all RFC-iCalendar components.
Definition: component.hpp:98