AnCH Framework 0.1
Another C++ Hack Framework
Loading...
Searching...
No Matches
iDatePartFormatter.hpp
1/*
2 ANCH Framework: ANother C++ Hack is a C++ framework based on C++11 standard
3 Copyright (C) 2012 Vincent Lachenal
4
5 This file is part of ANCH Framework.
6
7 ANCH Framework is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 ANCH Framework is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public License
18 along with ANCH Framework. If not, see <http://www.gnu.org/licenses/>.
19*/
20#pragma once
21
22#include <iostream>
23#include <ostream>
24
25#include "date/date.hpp"
26
27
28namespace anch::date {
29
36 public:
41 // Nothing to do
42 }
43
50 virtual void format(const anch::date::Date& date, std::ostream& output) const noexcept = 0;
51
57 virtual std::size_t getSize() const noexcept = 0;
58
65 virtual bool setValue(anch::date::Date& date, const std::string& value) const noexcept = 0;
66
72 virtual const std::string& getPattern() const noexcept = 0;
73
74 // Accessors +
75 protected:
81 static int32_t getYear(const anch::date::Date& date);
82
89 static void setYear(anch::date::Date& date, int32_t year);
90
96 static uint16_t getMonth(const anch::date::Date& date);
97
104 static void setMonth(anch::date::Date& date, uint16_t month);
105
111 static uint16_t getDay(const anch::date::Date& date);
112
119 static void setDay(anch::date::Date& date, uint16_t mday);
120
126 static uint16_t getHour(const anch::date::Date& date);
127
134 static void setHour(anch::date::Date& date, uint16_t hour);
135
141 static uint16_t getMinute(const anch::date::Date& date);
142
149 static void setMinute(anch::date::Date& date, uint16_t minute);
150
156 static uint16_t getSecond(const anch::date::Date& date);
157
164 static void setSecond(anch::date::Date& date, uint16_t second);
165
171 static uint16_t getMillisecond(const anch::date::Date& date);
172
179 static void setMillisecond(anch::date::Date& date, uint16_t milli);
180
186 static uint16_t getMicrosecond(const anch::date::Date& date);
187
194 static void setMicrosecond(anch::date::Date& date, uint16_t micro);
195
201 static uint16_t getNanosecond(const anch::date::Date& date);
202
209 static void setNanosecond(anch::date::Date& date, uint16_t nano);
210 // Accessors -
211 };
212
213}
214
215#include "date/impl/fmt/iDatePartFormatter.hpp"
Definition date.hpp:43
Definition iDatePartFormatter.hpp:35
virtual const std::string & getPattern() const noexcept=0
static void setNanosecond(anch::date::Date &date, uint16_t nano)
virtual bool setValue(anch::date::Date &date, const std::string &value) const noexcept=0
static void setMinute(anch::date::Date &date, uint16_t minute)
static void setMicrosecond(anch::date::Date &date, uint16_t micro)
static uint16_t getMinute(const anch::date::Date &date)
virtual void format(const anch::date::Date &date, std::ostream &output) const noexcept=0
static uint16_t getSecond(const anch::date::Date &date)
static uint16_t getNanosecond(const anch::date::Date &date)
virtual std::size_t getSize() const noexcept=0
virtual ~IDatePartFormatter()
Definition iDatePartFormatter.hpp:40
static uint16_t getMicrosecond(const anch::date::Date &date)
static void setHour(anch::date::Date &date, uint16_t hour)
static uint16_t getHour(const anch::date::Date &date)
static void setMonth(anch::date::Date &date, uint16_t month)
static void setMillisecond(anch::date::Date &date, uint16_t milli)
static void setYear(anch::date::Date &date, int32_t year)
static int32_t getYear(const anch::date::Date &date)
static uint16_t getDay(const anch::date::Date &date)
static void setSecond(anch::date::Date &date, uint16_t second)
static uint16_t getMonth(const anch::date::Date &date)
static void setDay(anch::date::Date &date, uint16_t mday)
static uint16_t getMillisecond(const anch::date::Date &date)
Date namespace.
AnCH framework base namespace.
Definition app.hpp:28