Analizo

 view release on metacpan or  search on metacpan

t/samples/kdelibs/daterange.h  view on Meta::CPAN

**ANALIZO NOTE**

This file was copied from kdelibs project for testing analizo features.

The original file was copied as-is to create automated tests on analizo side
fixing the bug below.

- https://github.com/analizo/analizo/issues/148

GitHub kdelibs repository:

- https://github.com/KDE/kdelibs.git

Original file was copied from the commit 668ef94b2b from kdelibs git repository
and it is located inside kdelibs repository on the path below.

- nepomuk/utils/daterange.h

Link to the original file on GitHub:

- https://github.com/KDE/kdelibs/blob/668ef94b2b861f7ec4aa20941bcb6493bc4367be/nepomuk/utils/daterange.h

*/

/*
   Copyright (c) 2009-2010 Sebastian Trueg <trueg@kde.org>

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
   published by the Free Software Foundation; either version 2 of
   the License or (at your option) version 3 or any later version
   accepted by the membership of KDE e.V. (or its successor approved
   by the membership of KDE e.V.), which shall act as a proxy
   defined in Section 14 of version 3 of the license.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/

#ifndef _DATE_RANGE_H_
#define _DATE_RANGE_H_

#include <QtCore/QDate>
#include <QtCore/QSharedDataPointer>

class QDebug;

/**
 * \class DateRange daterange.h DateRange
 *
 * \brief A simple data structure storing a start and an end date.
 *
 * %DateRange is a very simple data structure storing a start and an end date.
 * The really interesting parts are the static factory methods which take the
 * current calendar system into account and, thus, create accurate values.
 *
 * \author Sebastian Trueg <trueg@kde.org>
 */
class DateRange
{
public:
    /**
     * Create a new range
     */
    DateRange( const QDate& s = QDate(),
               const QDate& e = QDate() );

    /**
     * Copy constructor
     */
    DateRange( const DateRange& other );

    /**
     * Destructor
     */
    ~DateRange();

    /**
     * Make this range a copy of \p other
     */
    DateRange& operator=( const DateRange& other );

    /**
     * Start date of the range.
     */
    QDate start() const;

    /**
     * End date of the range.
     */
    QDate end() const;

    /**
     * Checks if both start and end are valid dates
     * and if end is after start.
     */
    bool isValid() const;

    /**
     * Set the start to \p date.
     */
    void setStart( const QDate& date );

    /**
     * Set the end to \p date.
     */
    void setEnd( const QDate& date );

    /**
     * \returns a DateRange with both start and end
     * dates set to QDate::currentDate()
     */
    static DateRange today();

    /**



( run in 1.021 second using v1.01-cache-2.11-cpan-302cb4679cc )