TDE personal information management applications
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.6KB

  1. /*
  2. This file is part of KAddressbook.
  3. Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  15. As a special exception, permission is given to link this program
  16. with any edition of TQt, and distribute the resulting executable,
  17. without including the source code for TQt in the source distribution.
  18. */
  19. #ifndef DATEPARSER_H
  20. #define DATEPARSER_H
  21. #include <tqstring.h>
  22. /**
  23. This class parses the date out of a given string with the
  24. help of a pattern.
  25. The pattern can contains the following key characters:
  26. y = year (e.g. 82)
  27. Y = year (e.g. 1982)
  28. m = month (e.g. 7, 07 or 12)
  29. M = month (e.g. 07 or 12)
  30. d = day (e.g. 3, 03 or 17)
  31. D = day (e.g. 03 or 17 )
  32. */
  33. class DateParser
  34. {
  35. public:
  36. DateParser( const TQString &pattern );
  37. ~DateParser();
  38. TQDate parse( const TQString &dateStr ) const;
  39. private:
  40. TQString mPattern;
  41. };
  42. #endif