From 2273376dffb80af0cbf1bc1d8cc8990e1d1456f3 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Fri, 4 Sep 2009 00:16:51 +0000 Subject: DEV-39441 - Eliminate boost:regexp from LLString::format Also removed a missing setting (merge bug) --- indra/llcommon/lldate.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'indra/llcommon/lldate.cpp') diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index 7bc9e16bc9..6a82a848be 100644 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -94,8 +94,12 @@ std::string LLDate::asRFC1123() const return toHTTPDateString (std::string ("%A, %d %b %Y %H:%M:%S GMT")); } +LLFastTimer::DeclareTimer FT_DATE_FORMAT("Date Format"); + std::string LLDate::toHTTPDateString (std::string fmt) const { + LLFastTimer ft1(FT_DATE_FORMAT); + std::ostringstream stream; time_t locSeconds = (time_t) mSecondsSinceEpoch; struct tm * gmt = gmtime (&locSeconds); @@ -107,6 +111,8 @@ std::string LLDate::toHTTPDateString (std::string fmt) const std::string LLDate::toHTTPDateString (tm * gmt, std::string fmt) { + LLFastTimer ft1(FT_DATE_FORMAT); + std::ostringstream stream; stream.imbue (std::locale(LLStringUtil::getLocale().c_str())); toHTTPDateStream (stream, gmt, fmt); @@ -115,11 +121,11 @@ std::string LLDate::toHTTPDateString (tm * gmt, std::string fmt) void LLDate::toHTTPDateStream(std::ostream& s, tm * gmt, std::string fmt) { - using namespace std; + LLFastTimer ft1(FT_DATE_FORMAT); const char * pBeg = fmt.c_str(); const char * pEnd = pBeg + fmt.length(); - const time_put& tp = use_facet >(s.getloc()); + const std::time_put& tp = std::use_facet >(s.getloc()); tp.put (s, s, s.fill(), gmt, pBeg, pEnd); } -- cgit v1.2.3