From f118e7c80b95d8c0a0c8abb14ff379b6697e01b6 Mon Sep 17 00:00:00 2001 From: Aaron Brashears Date: Wed, 13 Jun 2007 18:02:37 +0000 Subject: result of merge manually performed through diff and patch. svn diff svn+ssh://svn/svn/linden/release@63615 svn+ssh://svn/svn/linden/branches/release-candidate@63637 | patch -p0 in release --- indra/llcommon/llframetimer.cpp | 6 ++++++ indra/llcommon/llframetimer.h | 1 + indra/llcommon/llsdutil.cpp | 13 +++++++++++++ indra/llcommon/llsdutil.h | 3 +++ 4 files changed, 23 insertions(+) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llframetimer.cpp b/indra/llcommon/llframetimer.cpp index fca2bd2e85..2505295143 100644 --- a/indra/llcommon/llframetimer.cpp +++ b/indra/llcommon/llframetimer.cpp @@ -50,6 +50,12 @@ void LLFrameTimer::reset() mExpiry = sFrameTime; } +void LLFrameTimer::resetWithExpiry(F32 expiration) +{ + reset(); + setTimerExpirySec(expiration); +} + // Don't combine pause/unpause with start/stop // Useage: // LLFrameTime foo; // starts automatically diff --git a/indra/llcommon/llframetimer.h b/indra/llcommon/llframetimer.h index c7c1c50c7b..da777e4ee6 100644 --- a/indra/llcommon/llframetimer.h +++ b/indra/llcommon/llframetimer.h @@ -55,6 +55,7 @@ public: void start(); void stop(); void reset(); + void resetWithExpiry(F32 expiration); void pause(); void unpause(); void setTimerExpirySec(F32 expiration); diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp index 57a024ecee..5a0a76b3f3 100644 --- a/indra/llcommon/llsdutil.cpp +++ b/indra/llcommon/llsdutil.cpp @@ -265,3 +265,16 @@ char* ll_print_sd(const LLSD& sd) buffer[bufferSize - 1] = '\0'; return buffer; } + +char* ll_pretty_print_sd(const LLSD& sd) +{ + const U32 bufferSize = 10 * 1024; + static char buffer[bufferSize]; + std::ostringstream stream; + //stream.rdbuf()->pubsetbuf(buffer, bufferSize); + stream << LLSDOStreamer(sd, LLSDFormatter::OPTIONS_PRETTY); + stream << std::ends; + strncpy(buffer, stream.str().c_str(), bufferSize); + buffer[bufferSize - 1] = '\0'; + return buffer; +} \ No newline at end of file diff --git a/indra/llcommon/llsdutil.h b/indra/llcommon/llsdutil.h index 860232044e..2241cf9426 100644 --- a/indra/llcommon/llsdutil.h +++ b/indra/llcommon/llsdutil.h @@ -65,4 +65,7 @@ LLSD ll_binary_from_string(const LLSD& sd); // Serializes sd to static buffer and returns pointer, useful for gdb debugging. char* ll_print_sd(const LLSD& sd); +// Serializes sd to static buffer and returns pointer, using "pretty printing" mode. +char* ll_pretty_print_sd(const LLSD& sd); + #endif // LL_LLSDUTIL_H -- cgit v1.2.3