- Implemented 'description.default', 'description.count', and
  'description.oneline'.
- New 'indent.annotation' for the 'description.default' field format.
This commit is contained in:
Paul Beckingham 2011-05-04 23:15:17 -04:00
parent f37a250894
commit 28b0960015
8 changed files with 145 additions and 33 deletions

View file

@ -694,6 +694,38 @@ int Date::monthOfYear (const std::string& input)
return -1;
}
////////////////////////////////////////////////////////////////////////////////
int Date::length (const std::string& format)
{
int total = 0;
std::string::const_iterator i;
for (i = format.begin (); i != format.end (); ++i)
{
switch (*i)
{
case 'm':
case 'M':
case 'd':
case 'D':
case 'y':
case 'A':
case 'b':
case 'B':
case 'V':
case 'h':
case 'H':
case 'N':
case 'S': total += 2; break;
case 'a': total += 3; break;
case 'Y': total += 4; break;
default: total += 1; break;
}
}
return total;
}
////////////////////////////////////////////////////////////////////////////////
time_t Date::easter (int year)
{