/[debian]/mimetic/trunk/mimetic/rfc822/datetime.cxx
ViewVC logotype

Diff of /mimetic/trunk/mimetic/rfc822/datetime.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 510 by gregoa, Sat Feb 25 16:49:22 2006 UTC revision 511 by gregoa, Sun Jan 21 20:13:31 2007 UTC
# Line 2  Line 2 
2      copyright            : (C) 2002-2005 by Stefano Barbato      copyright            : (C) 2002-2005 by Stefano Barbato
3      email                : stefano@codesink.org      email                : stefano@codesink.org
4    
5      $Id: datetime.cxx,v 1.2 2005/02/23 10:26:15 tat Exp $      $Id: datetime.cxx,v 1.3 2007/01/21 14:55:34 tat Exp $
6   ***************************************************************************/   ***************************************************************************/
7    
8  /***************************************************************************  /***************************************************************************
# Line 284  void DateTime::set(const string& input) Line 284  void DateTime::set(const string& input)
284      }      }
285            
286      // gg mon aa[aa]          // gg mon aa[aa]    
287      for(; i < 3; ++i)      while(i < 3)
288      {      {
289          if(!stok.next(tok)) return;          if(!stok.next(tok)) return;
290            if(tok.empty())
291                continue; /* there's a ' ' after ',' ("Wed, 23 Nov...") */
292          switch(i)          switch(i)
293          {          {
294          case 0: m_iDay = utils::str2int(tok); break;          case 0: m_iDay = utils::str2int(tok); break;
295          case 1: m_iMonth = Month(tok).ordinal(); break;          case 1: m_iMonth = Month(tok).ordinal(); break;
296          case 2: m_iYear = utils::str2int(tok); break;          case 2: m_iYear = utils::str2int(tok); break;
297          }          }
298            ++i;
299      }      }
300    
301      stok.setDelimList(" :");      stok.setDelimList(" :");
302      for(int i = 0; i < 3; ++i)      for(i = 0; i < 3; ++i)
303      {      {
304          if(!stok.next(tok)) return;          if(!stok.next(tok)) return;
305          switch(i)          switch(i)
# Line 394  FieldValue* DateTime::clone() const Line 398  FieldValue* DateTime::clone() const
398  ostream& operator<<(ostream& os, const DateTime& dt)  ostream& operator<<(ostream& os, const DateTime& dt)
399  {  {
400      int width = os.width(), fill = os.fill();      int width = os.width(), fill = os.fill();
401    
402      os << dt.dayOfWeek().name() << ", "      os << dt.dayOfWeek().name() << ", "
403         << setw(2) << setfill('0') << dt.day() << " "         << setw(2) << setfill('0') << dt.day() << " "
404         << dt.month().name() << " "         << dt.month().name() << " "
# Line 402  ostream& operator<<(ostream& os, const D Line 407  ostream& operator<<(ostream& os, const D
407         << setw(2) << setfill('0') << dt.minute() << ":"         << setw(2) << setfill('0') << dt.minute() << ":"
408         << setw(2) << setfill('0') << dt.second() << " "         << setw(2) << setfill('0') << dt.second() << " "
409         << dt.zone().name();         << dt.zone().name();
410    
411      os.width(width);      os.width(width);
412      os.fill(fill);      os.fill(fill);
413      return os;      return os;

Legend:
Removed from v.510  
changed lines
  Added in v.511

  ViewVC Help
Powered by ViewVC 1.1.26