![]() |
AnCH Framework
0.1
Another C++ Hack Framework
|
#include <dateFormatter.hpp>
Public Member Functions | |
| DateFormatter (const std::string &dateFormat) | |
| virtual | ~DateFormatter () |
| void | format (const anch::date::Date &date, std::string &output) const |
| void | format (const anch::date::Date &date, std::ostream &output) const |
| void | parse (const std::string &strDate, anch::date::Date &date) const |
| anch::date::Date * | parse (const std::string &strDate) const |
Static Public Member Functions | |
| static void | registerFormatterPart (const std::string &pattern, getInstance instGetter) |
Date string formatter.
Paterns are:
Do not use characters '%' in your string pattern.
Warning: This class is not thread safe.
| DateFormatter::DateFormatter | ( | const std::string & | dateFormat | ) |
DateFormatter constructor
| dateFormat | The date format |
|
virtual |
DateFormatter destructor
| void DateFormatter::format | ( | const anch::date::Date & | date, |
| std::string & | output | ||
| ) | const |
Format date
| date | The date to format |
| output | The output string |
| void DateFormatter::format | ( | const anch::date::Date & | date, |
| std::ostream & | output | ||
| ) | const |
Format date
| date | The date to format |
| output | The output stream |
Format date.
| date | The date to format |
| output | The output string |
| void DateFormatter::parse | ( | const std::string & | strDate, |
| anch::date::Date & | date | ||
| ) | const |
Build date from string.
You can build the output Date with Date(false) constructor.
| strDate | String formatted date |
| date | The output date |
| Date * DateFormatter::parse | ( | const std::string & | strDate | ) | const |
|
static |
Register a new formatter part
| pattern | The formatter part pattern |
| instGetter | The formatter part new instance getter |
1.8.11