root/tlate/date_value.hh

Revision 987de1071fffd236a8c527ba3acf198acbe612b7, 1.4 KB (checked in by Antti-Juhani Kaijanaho <antti-juhani@…>, 2 years ago)

Add support for a dedicated date type in templates.

Signed-off-by: Antti-Juhani Kaijanaho <antti-juhani@…>

  • Property mode set to 100644
Line 
1/*  This file is part of Alue, the multiprotocol Internet discussion daemon
2
3    Copyright © 2009, 2010 Antti-Juhani Kaijanaho
4
5    Alue is free software: you can redistribute it and/or modify it
6    under the terms of the GNU General Public License as published by
7    the Free Software Foundation, either version 3 of the License, or
8    (at your option) any later version.
9
10    Alue is distributed in the hope that it will be useful, but
11    WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with Alue.  If not, see <http://www.gnu.org/licenses/>.
17
18 */
19
20#ifndef GUARD_TLATE_DATE_VALUE_HH
21#define GUARD_TLATE_DATE_VALUE_HH
22
23#include "structured_value.hh"
24
25#include <boost/date_time/posix_time/posix_time.hpp>
26
27namespace tlate
28{
29        class date_value : public structured_value
30        {
31                boost::posix_time::ptime date;
32
33        public:
34                date_value(boost::posix_time::ptime date) : date(date) {}
35
36                value::const_ptr get(std::string) const;
37
38                static value::ptr mk(boost::posix_time::ptime date) {
39                        value::ptr rv(new date_value(date));
40                        return rv;
41                }
42        };
43}
44
45#endif /* GUARD_TLATE_DATE_VALUE_HH */
Note: See TracBrowser for help on using the browser.