Loading...
Searching...
No Matches
ledger::date_interval_t Class Reference

#include <times.h>

Inherits equality_comparable< date_interval_t >.

Public Member Functions

optional< date_tbegin () const
 
 date_interval_t ()
 
 date_interval_t (const date_interval_t &other)
 
 date_interval_t (const string &str)
 
void dump (std::ostream &out)
 
optional< date_tend () const
 
bool find_period (const date_t &date=(epoch ? epoch->date() :boost::gregorian::day_clock::local_day()), const bool align_intervals=false, const bool allow_shift=true)
 Find the current or next period containing date.
 
optional< date_tinclusive_end () const
 
bool is_valid () const
 
 operator bool () const
 
date_interval_toperator++ ()
 
bool operator< (const date_interval_t &other) const
 
bool operator== (const date_interval_t &other) const
 
void parse (const string &str)
 
void resolve_end ()
 
void stabilize (const optional< date_t > &date=none, bool align_intervals=false)
 
bool within_period (const date_t &date=(epoch ? epoch->date() :boost::gregorian::day_clock::local_day()))
 
 ~date_interval_t () throw ()
 

Static Public Member Functions

static date_t add_duration (const date_t &date, const date_duration_t &duration)
 
static date_t subtract_duration (const date_t &date, const date_duration_t &duration)
 

Public Attributes

bool aligned
 
optional< date_duration_tduration
 
optional< date_tend_of_duration
 
optional< date_tfinish
 
optional< date_tnext
 
optional< date_specifier_or_range_trange
 
bool since_specified = false
 
optional< date_tstart
 

Detailed Description

Definition at line 438 of file times.h.

Constructor & Destructor Documentation

◆ date_interval_t() [1/3]

ledger::date_interval_t::date_interval_t ( )
inlineexplicit

Definition at line 456 of file times.h.

References TRACE_CTOR.

◆ date_interval_t() [2/3]

ledger::date_interval_t::date_interval_t ( const string & str)
inline

Definition at line 459 of file times.h.

References parse(), and TRACE_CTOR.

+ Here is the call graph for this function:

◆ date_interval_t() [3/3]

ledger::date_interval_t::date_interval_t ( const date_interval_t & other)
inline

Definition at line 463 of file times.h.

References TRACE_CTOR.

◆ ~date_interval_t()

ledger::date_interval_t::~date_interval_t ( )
throw ( )
inline

Definition at line 474 of file times.h.

References TRACE_DTOR.

Member Function Documentation

◆ add_duration()

static date_t ledger::date_interval_t::add_duration ( const date_t & date,
const date_duration_t & duration )
static

◆ begin()

optional< date_t > ledger::date_interval_t::begin ( ) const
inline

Definition at line 491 of file times.h.

References ledger::downcast(), range, and start.

+ Here is the call graph for this function:

◆ dump()

void ledger::date_interval_t::dump ( std::ostream & out)

◆ end()

optional< date_t > ledger::date_interval_t::end ( ) const
inline

Definition at line 494 of file times.h.

References ledger::downcast(), finish, and range.

+ Here is the call graph for this function:

◆ find_period()

bool ledger::date_interval_t::find_period ( const date_t & date = (epoch ? epoch->date() :boost::gregorian::day_clock::local_day()),
const bool align_intervals = false,
const bool allow_shift = true )

Find the current or next period containing date.

Returns false if no such period can be found. If allow_shift is true, the default, then the interval may be shifted in time to find the period.

Referenced by within_period().

+ Here is the caller graph for this function:

◆ inclusive_end()

optional< date_t > ledger::date_interval_t::inclusive_end ( ) const
inline

Definition at line 517 of file times.h.

References ledger::downcast(), and end_of_duration.

+ Here is the call graph for this function:

◆ is_valid()

bool ledger::date_interval_t::is_valid ( ) const
inline

Definition at line 503 of file times.h.

References start.

Referenced by operator bool().

+ Here is the caller graph for this function:

◆ operator bool()

ledger::date_interval_t::operator bool ( ) const
inline

Definition at line 487 of file times.h.

References is_valid().

+ Here is the call graph for this function:

◆ operator++()

date_interval_t & ledger::date_interval_t::operator++ ( )

◆ operator<()

bool ledger::date_interval_t::operator< ( const date_interval_t & other) const
inline

Definition at line 482 of file times.h.

References ledger::downcast(), and start.

+ Here is the call graph for this function:

◆ operator==()

bool ledger::date_interval_t::operator== ( const date_interval_t & other) const
inline

Definition at line 478 of file times.h.

References ledger::downcast(), and start.

+ Here is the call graph for this function:

◆ parse()

void ledger::date_interval_t::parse ( const string & str)

Referenced by date_interval_t().

+ Here is the caller graph for this function:

◆ resolve_end()

void ledger::date_interval_t::resolve_end ( )

◆ stabilize()

void ledger::date_interval_t::stabilize ( const optional< date_t > & date = none,
bool align_intervals = false )

◆ subtract_duration()

static date_t ledger::date_interval_t::subtract_duration ( const date_t & date,
const date_duration_t & duration )
static

◆ within_period()

bool ledger::date_interval_t::within_period ( const date_t & date = (epoch ? epoch->date() : boost::gregorian::day_clock::local_day()))
inline

Definition at line 513 of file times.h.

References find_period().

+ Here is the call graph for this function:

Member Data Documentation

◆ aligned

bool ledger::date_interval_t::aligned

Definition at line 450 of file times.h.

◆ duration

optional<date_duration_t> ledger::date_interval_t::duration

Definition at line 452 of file times.h.

◆ end_of_duration

optional<date_t> ledger::date_interval_t::end_of_duration

Definition at line 453 of file times.h.

Referenced by inclusive_end().

◆ finish

optional<date_t> ledger::date_interval_t::finish

Definition at line 449 of file times.h.

Referenced by end().

◆ next

optional<date_t> ledger::date_interval_t::next

Definition at line 451 of file times.h.

◆ range

optional<date_specifier_or_range_t> ledger::date_interval_t::range

Definition at line 446 of file times.h.

Referenced by begin(), and end().

◆ since_specified

bool ledger::date_interval_t::since_specified = false

Definition at line 454 of file times.h.

◆ start

optional<date_t> ledger::date_interval_t::start

Definition at line 448 of file times.h.

Referenced by begin(), is_valid(), operator<(), and operator==().


The documentation for this class was generated from the following file: