/[resiprocate]/branches/b-identity-0505/DateCategory.hxx
ViewVC logotype

Contents of /branches/b-identity-0505/DateCategory.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4598 - (show annotations) (download)
Wed May 11 22:53:07 2005 UTC (14 years, 6 months ago) by derek
File size: 3984 byte(s)
set svn:eol-style to LF
1 #if !defined(RESIP_DATE_CATEGORY_HXX)
2 #define RESIP_DATE_CATEGORY_HXX
3
4 #include <iosfwd>
5 #include "resiprocate/os/Data.hxx"
6 #include "resiprocate/ParserCategory.hxx"
7
8 namespace resip
9 {
10
11 //====================
12 // DateCategory:
13 //====================
14
15 enum DayOfWeek {
16 Sun = 0,
17 Mon,
18 Tue,
19 Wed,
20 Thu,
21 Fri,
22 Sat
23 };
24
25 extern Data DayOfWeekData[];
26 extern Data MonthData[];
27
28 enum Month {
29 Jan = 0,
30 Feb,
31 Mar,
32 Apr,
33 May,
34 Jun,
35 Jul,
36 Aug,
37 Sep,
38 Oct,
39 Nov,
40 Dec
41 };
42
43 class DateCategory : public ParserCategory
44 {
45 public:
46 enum {commaHandling = NoCommaTokenizing};
47
48 DateCategory();
49 DateCategory(HeaderFieldValue* hfv, Headers::Type type);
50 DateCategory(const DateCategory&);
51 DateCategory& operator=(const DateCategory&);
52
53 virtual void parse(ParseBuffer& pb);
54 virtual ParserCategory* clone() const;
55
56 virtual std::ostream& encodeParsed(std::ostream& str) const;
57
58 static DayOfWeek DayOfWeekFromData(const Data&);
59 static Month MonthFromData(const Data&);
60
61 const DayOfWeek& dayOfWeek() const;
62 int& dayOfMonth();
63 int dayOfMonth() const;
64 Month& month();
65 Month month() const;
66 int& year();
67 int year() const;
68 int& hour();
69 int hour() const;
70 int& minute();
71 int minute() const;
72 int& second();
73 int second() const;
74
75 private:
76 mutable enum DayOfWeek mDayOfWeek;
77 mutable int mDayOfMonth;
78 mutable enum Month mMonth;
79 mutable int mYear;
80 mutable int mHour;
81 mutable int mMin;
82 mutable int mSec;
83 };
84
85 }
86
87 #endif
88
89 /* ====================================================================
90 * The Vovida Software License, Version 1.0
91 *
92 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
93 *
94 * Redistribution and use in source and binary forms, with or without
95 * modification, are permitted provided that the following conditions
96 * are met:
97 *
98 * 1. Redistributions of source code must retain the above copyright
99 * notice, this list of conditions and the following disclaimer.
100 *
101 * 2. Redistributions in binary form must reproduce the above copyright
102 * notice, this list of conditions and the following disclaimer in
103 * the documentation and/or other materials provided with the
104 * distribution.
105 *
106 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
107 * and "Vovida Open Communication Application Library (VOCAL)" must
108 * not be used to endorse or promote products derived from this
109 * software without prior written permission. For written
110 * permission, please contact vocal@vovida.org.
111 *
112 * 4. Products derived from this software may not be called "VOCAL", nor
113 * may "VOCAL" appear in their name, without prior written
114 * permission of Vovida Networks, Inc.
115 *
116 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
117 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
118 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
119 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
120 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
121 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
122 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
123 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
124 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
125 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
126 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
127 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
128 * DAMAGE.
129 *
130 * ====================================================================
131 *
132 * This software consists of voluntary contributions made by Vovida
133 * Networks, Inc. and many individuals on behalf of Vovida Networks,
134 * Inc. For more information on Vovida Networks, Inc., please see
135 * <http://www.vovida.org/>.
136 *
137 */

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27