Ticket #5126: date_time.patch

File date_time.patch, 7.2 KB (added by hstong@…, 12 years ago)

Patch to escape SCCS keywords

  • libs/date_time/example/local_time/local_date_time.cpp

    old new  
    2424  local_date_time ny_time(date(2004, Aug, 30), hours(10), nyc, true);
    2525 
    2626  typedef boost::date_time::time_facet<local_date_time, char> ldt_facet;
    27   ldt_facet* timefacet = new ldt_facet("%Y-%b-%d %H:%M:%S%F %Z");
     27  ldt_facet* timefacet = new ldt_facet("%Y-%b-%d %H:%M:%S""%F %Z");
    2828  std::locale loc(std::locale::classic(), timefacet);
    2929 
    3030  std::cout << ny_time << std::endl;
  • libs/date_time/test/posix_time/testtime_facet.cpp

    old new  
    165165      //reset the sign to always print
    166166      time_facet* f = new time_facet();
    167167      ss.imbue(std::locale(ss.getloc(), f));
    168       f->time_duration_format("%+%H:%M:%S%F");
     168      f->time_duration_format("%+%H:%M:%S""%F");
    169169
    170170      ss.str("");
    171171      ss << td4 - td3;
     
    348348    }
    349349
    350350    {
    351       wtime_facet* wtimefacet = new wtime_facet(L"%Y-%b-%d %H:%M:%S%F");
    352       teststreaming("widestream custom time no frac seconds %F operator: %Y-%b-%d %H:%M:%S%F", t,
     351      wtime_facet* wtimefacet = new wtime_facet(L"%Y-%b-%d %H:%M:%S" L"%F");
     352      teststreaming("widestream custom time no frac seconds %F operator: %Y-%b-%d %H:%M:%S""%F", t,
    353353                    std::wstring(L"2004-Oct-13 18:01:56"),
    354354                    std::locale(std::locale::classic(), wtimefacet));
    355355    }
    356356
    357357    {
    358       wtime_facet* wtimefacet = new wtime_facet(L"%Y-%b-%d %H:%M:%S%F");
     358      wtime_facet* wtimefacet = new wtime_facet(L"%Y-%b-%d %H:%M:%S" L"%F");
    359359#ifdef BOOST_DATE_TIME_HAS_NANOSECONDS
    360       teststreaming("widestream custom time with frac seconds %F operator: %Y-%b-%d %H:%M:%S%F", tf,
     360      teststreaming("widestream custom time with frac seconds %F operator: %Y-%b-%d %H:%M:%S""%F", tf,
    361361                    std::wstring(L"2004-Oct-13 18:01:56.000003000"),
    362362                    std::locale(std::locale::classic(), wtimefacet));
    363363#else
    364       teststreaming("widestream custom time with frac seconds %F operator: %Y-%b-%d %H:%M:%S%F", tf,
     364      teststreaming("widestream custom time with frac seconds %F operator: %Y-%b-%d %H:%M:%S""%F", tf,
    365365                    std::wstring(L"2004-Oct-13 18:01:56.000003"),
    366366                    std::locale(std::locale::classic(), wtimefacet));
    367367#endif // BOOST_DATE_TIME_HAS_NANOSECONDS
     
    395395
    396396
    397397    {
    398       wtime_facet* wtimefacet = new wtime_facet(L"%Y-%b-%d %H:%M:%S%F");
     398      wtime_facet* wtimefacet = new wtime_facet(L"%Y-%b-%d %H:%M:%S" L"%F");
    399399#ifdef BOOST_DATE_TIME_HAS_NANOSECONDS
    400       teststreaming("widestream time period frac seconds %F operator: %Y-%b-%d %H:%M:%S%F", tp,
     400      teststreaming("widestream time period frac seconds %F operator: %Y-%b-%d %H:%M:%S""%F", tp,
    401401                    std::wstring(L"[2004-Oct-13 18:01:56/2004-Oct-20 19:02:57.000002999]"),
    402402                    std::locale(std::locale::classic(), wtimefacet));
    403403#else
    404       teststreaming("widestream time period frac seconds %F operator: %Y-%b-%d %H:%M:%S%F", tp,
     404      teststreaming("widestream time period frac seconds %F operator: %Y-%b-%d %H:%M:%S""%F", tp,
    405405                    std::wstring(L"[2004-Oct-13 18:01:56/2004-Oct-20 19:02:57.000002]"),
    406406                    std::locale(std::locale::classic(), wtimefacet));
    407407#endif // BOOST_DATE_TIME_HAS_NANOSECONDS
  • libs/date_time/test/posix_time/testtime_input_facet.cpp

    old new  
    117117
    118118  time_input_facet* facet = new time_input_facet();
    119119  std::locale loc(std::locale::classic(), facet);
    120   facet->time_duration_format("%H:%M:%S%f");
     120  facet->time_duration_format("%H:%M:%S""%f");
    121121  iss.imbue(loc);
    122122
    123123  iss.str("14:13:12.0 extra stuff");
     
    180180  { /****** iso format tests (and custom 'scrunched-together formats) ******/
    181181    time_input_facet *facet = new time_input_facet();
    182182    facet->set_iso_format();
    183     facet->time_duration_format("%H%M%S%F"); // iso format
     183    facet->time_duration_format("%H""%M""%S""%F"); // iso format
    184184    std::stringstream ss;
    185185    ss.imbue(std::locale(std::locale::classic(), facet));
    186186    ptime pt(not_a_date_time);
     
    217217    ss.exceptions(std::ios_base::failbit); // we need exceptions turned on here
    218218    int count = 0;
    219219    try {
    220       facet->time_duration_format("%H%M%S%F");
     220      facet->time_duration_format("%H""%M""%S""%F");
    221221      ss.str("not-a-date-time");
    222222      ++count;
    223223      ss >> td;
    224224      check_equal("special value w/ hours flag", td, nadt);
    225225      ss.str("");
    226       facet->time_duration_format("%M%S%F");
     226      facet->time_duration_format("%M""%S""%F");
    227227      ss.str("not-a-date-time");
    228228      ++count;
    229229      ss >> td;
    230230      check_equal("special value w/ minutes flag", td, nadt);
    231231      ss.str("");
    232       facet->time_duration_format("%S%F");
     232      facet->time_duration_format("%S""%F");
    233233      ss.str("not-a-date-time");
    234234      ++count;
    235235      ss >> td;
     
    257257    // exception tests
    258258    std::ios_base::failure exc("failure");
    259259    check("failure test w/ hours flag",
    260         failure_test(td, "bad_input", exc, new time_input_facet("%H%M%S%F")));
     260        failure_test(td, "bad_input", exc, new time_input_facet("%H""%M""%S""%F")));
    261261    check("silent failure test w/ hours flag",
    262         failure_test(td, "bad_input", new time_input_facet("%H%M%S%F")));
     262        failure_test(td, "bad_input", new time_input_facet("%H""%M""%S""%F")));
    263263    check("failure test w/ minute flag",
    264         failure_test(td, "bad_input", exc, new time_input_facet("%M%S%F")));
     264        failure_test(td, "bad_input", exc, new time_input_facet("%M""%S""%F")));
    265265    check("silent failure test w/ minute flag",
    266         failure_test(td, "bad_input", new time_input_facet("%M%S%F")));
     266        failure_test(td, "bad_input", new time_input_facet("%M""%S""%F")));
    267267    check("failure test w/ second flag",
    268         failure_test(td, "bad_input", exc, new time_input_facet("%S%F")));
     268        failure_test(td, "bad_input", exc, new time_input_facet("%S""%F")));
    269269    check("silent failure test w/ second flag",
    270         failure_test(td, "bad_input", new time_input_facet("%S%F")));
     270        failure_test(td, "bad_input", new time_input_facet("%S""%F")));
    271271    check("failure test w/ sec w/frac (always) flag",
    272272        failure_test(td, "bad_input", exc, new time_input_facet("%s")));
    273273    check("silent failure test w/ sec w/frac (always) flag",
     
    350350  // Failure tests
    351351  // faliure tests for date elements tested in gregorian tests
    352352  time_input_facet* facet2 = new time_input_facet();
    353   facet2->time_duration_format("%H:%M:%S%f");
     353  facet2->time_duration_format("%H:%M:%S""%f");
    354354  check("Failure test: Missing frac_sec with %f flag (w/exceptions)",
    355355        failure_test(td, "14:13:12 extra stuff", e_failure, facet2));
    356356  time_input_facet* facet3 = new time_input_facet();
    357   facet3->time_duration_format("%H:%M:%S%f");
     357  facet3->time_duration_format("%H:%M:%S""%f");
    358358  check("Failure test: Missing frac_sec with %f flag (no exceptions)",
    359359        failure_test(td, "14:13:12 extra stuff", facet3));
    360360