From 420b91db29485df39fd6e724e782c449158811cb Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 2 Jan 2007 08:33:20 +0000 Subject: Print done when done. --- indra/llcommon/llmemorystream.cpp | 52 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 indra/llcommon/llmemorystream.cpp (limited to 'indra/llcommon/llmemorystream.cpp') diff --git a/indra/llcommon/llmemorystream.cpp b/indra/llcommon/llmemorystream.cpp new file mode 100644 index 0000000000..dc0ad5aadb --- /dev/null +++ b/indra/llcommon/llmemorystream.cpp @@ -0,0 +1,52 @@ +/** + * @file llmemorystream.cpp + * @author Phoenix + * @date 2005-06-03 + * @brief Buffer and stream for a fixed linear memory segment. + * + * Copyright (c) 2005-$CurrentYear$, Linden Research, Inc. + * $License$ + */ + +#include "linden_common.h" +#include "llmemorystream.h" + +LLMemoryStreamBuf::LLMemoryStreamBuf(const U8* start, S32 length) +{ + reset(start, length); +} + +LLMemoryStreamBuf::~LLMemoryStreamBuf() +{ +} + +void LLMemoryStreamBuf::reset(const U8* start, S32 length) +{ + setg((char*)start, (char*)start, (char*)start + length); +} + +int LLMemoryStreamBuf::underflow() +{ + //lldebugs << "LLMemoryStreamBuf::underflow()" << llendl; + if(gptr() < egptr()) + { + return *gptr(); + } + return EOF; +} + +/** + * @class LLMemoryStreamBuf + */ + +LLMemoryStream::LLMemoryStream(const U8* start, S32 length) : + std::istream(&mStreamBuf), + mStreamBuf(start, length) +{ +} + +LLMemoryStream::~LLMemoryStream() +{ +} + + -- cgit v1.2.3