2010-08-01 20:28:19 +00:00
|
|
|
/*
|
2014-09-26 18:24:07 +02:00
|
|
|
* Copyright 2010-2014, Haiku, Inc.
|
2010-08-01 20:28:19 +00:00
|
|
|
* Distributed under the terms of the MIT Licence.
|
|
|
|
*/
|
|
|
|
#ifndef _B_DATE_TIME_FORMAT_H_
|
|
|
|
#define _B_DATE_TIME_FORMAT_H_
|
|
|
|
|
2014-09-26 18:24:07 +02:00
|
|
|
|
2010-08-01 20:28:19 +00:00
|
|
|
#include <Format.h>
|
|
|
|
#include <FormatParameters.h>
|
|
|
|
|
|
|
|
|
|
|
|
class BString;
|
|
|
|
|
2014-09-26 18:24:07 +02:00
|
|
|
|
|
|
|
enum BDateElement {
|
|
|
|
B_DATE_ELEMENT_INVALID = B_BAD_DATA,
|
|
|
|
B_DATE_ELEMENT_YEAR = 0,
|
|
|
|
B_DATE_ELEMENT_MONTH,
|
|
|
|
B_DATE_ELEMENT_DAY,
|
|
|
|
B_DATE_ELEMENT_AM_PM,
|
|
|
|
B_DATE_ELEMENT_HOUR,
|
|
|
|
B_DATE_ELEMENT_MINUTE,
|
|
|
|
B_DATE_ELEMENT_SECOND
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-08-01 20:28:19 +00:00
|
|
|
class BDateTimeFormat : public BFormat {
|
|
|
|
public:
|
|
|
|
BDateTimeFormat();
|
|
|
|
BDateTimeFormat(const BDateTimeFormat &other);
|
|
|
|
virtual ~BDateTimeFormat();
|
|
|
|
|
|
|
|
// formatting
|
|
|
|
|
|
|
|
// no-frills version: Simply appends the
|
|
|
|
// formatted date to the string buffer.
|
2010-08-29 20:40:15 +00:00
|
|
|
// Can fail only with B_NO_MEMORY or
|
|
|
|
// B_BAD_VALUE.
|
2010-08-01 20:28:19 +00:00
|
|
|
virtual status_t Format(bigtime_t value, BString* buffer) const;
|
|
|
|
|
|
|
|
// TODO: ... basically, all of it!
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _B_DATE_TIME_FORMAT_H_
|