Alkimia API

alkdateformat.h
1/*
2 SPDX-FileCopyrightText: 2004 Ace Jones acejones @users.sourceforge.net
3
4 This file is part of libalkimia.
5
6 SPDX-License-Identifier: GPL-2.0-or-later
7*/
8
9#ifndef ALKDATEFORMAT_H
10#define ALKDATEFORMAT_H
11
12#include "alkexception.h"
13
14#include <QDate>
15#include <QString>
16#include <QStringList>
17
18/**
19 *
20 * Universal date converter
21 *
22 * In 'strict' mode, this is designed to be compatible with the QIF profile date
23 * converter. However, that converter deals with the concept of an apostrophe
24 * format in a way I don't understand. So for the moment, they are 99%
25 * compatible, waiting on that issue. (acejones)
26 */
27class ALK_NO_EXPORT AlkDateFormat
28{
29public:
30 explicit AlkDateFormat(const QString &format);
31 AlkDateFormat(const AlkDateFormat& right);
33
34 AlkDateFormat& operator=(const AlkDateFormat&);
35
36 typedef enum {
37 NoError = 0,
38 InvalidFormatString,
39 InvalidFormatCharacter,
40 InvalidDate,
41 InvalidDay,
42 InvalidMonth,
43 InvalidYear,
44 InvalidYearLength,
45 } ErrorCode;
46
47 QString convertDate(const QDate &date);
48 QDate convertString(const QString &date, bool strict = true,
49 unsigned centuryMidPoint = QDate::currentDate().year());
50 const QString &format() const;
51
52 QString lastErrorMessage() const;
53 ErrorCode lastError() const;
54
55private:
56 class Private;
57 Private* const d;
58};
59
60#endif // ALKDATEFORMAT_H
Universal date converter.
QDate currentDate()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.