StdAir Logo  1.00.18
C++ Standard Airline IT Object Library
Loading...
Searching...
No Matches
DatePeriodKey.cpp
Go to the documentation of this file.
1// //////////////////////////////////////////////////////////////////////
2// Import section
3// //////////////////////////////////////////////////////////////////////
4// STL
5#include <ostream>
6#include <sstream>
7// Boost Date-Time
8#include <boost/date_time/gregorian/formatters.hpp>
9// STDAIR
12
13namespace stdair {
14
15 // ////////////////////////////////////////////////////////////////////
17 : _datePeriod (BOOST_DEFAULT_DATE_PERIOD) {
18 assert (false);
19 }
20
21 // ////////////////////////////////////////////////////////////////////
23 : _datePeriod (iDatePeriod) {
24 }
25
26 // ////////////////////////////////////////////////////////////////////
28 : _datePeriod (iKey._datePeriod) {
29 }
30
31 // ////////////////////////////////////////////////////////////////////
34
35 // ////////////////////////////////////////////////////////////////////
36 void DatePeriodKey::toStream (std::ostream& ioOut) const {
37 ioOut << "DatePeriodKey: " << toString() << std::endl;
38 }
39
40 // ////////////////////////////////////////////////////////////////////
41 void DatePeriodKey::fromStream (std::istream& ioIn) {
42 }
43
44 // ////////////////////////////////////////////////////////////////////
45 const std::string DatePeriodKey::toString() const {
46 std::ostringstream oStr;
47 const stdair::Date_T lStart = _datePeriod.begin();
48 const stdair::Date_T lEnd = _datePeriod.end();
49 oStr << "[" << boost::gregorian::to_simple_string(lStart)
50 << "/" << boost::gregorian::to_simple_string(lEnd)
51 << "]";
52 return oStr.str();
53 }
54
55}
Handle on the StdAir library context.
boost::gregorian::date Date_T
const DatePeriod_T BOOST_DEFAULT_DATE_PERIOD
boost::gregorian::date_period DatePeriod_T
const std::string toString() const
void fromStream(std::istream &ioIn)
void toStream(std::ostream &ioOut) const
DatePeriodKey(const DatePeriod_T &)