summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llcommon/llprocess.cpp1
-rw-r--r--indra/llcommon/llprocess.h24
2 files changed, 15 insertions, 10 deletions
diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp
index bd08c3ab51..d4786035ce 100644
--- a/indra/llcommon/llprocess.cpp
+++ b/indra/llcommon/llprocess.cpp
@@ -163,6 +163,7 @@ public:
}
virtual std::ostream& get_ostream() { return mStream; }
+ virtual size_type size() const { return mStreambuf.size(); }
bool tick(const LLSD&)
{
diff --git a/indra/llcommon/llprocess.h b/indra/llcommon/llprocess.h
index 06ada83698..51010966f9 100644
--- a/indra/llcommon/llprocess.h
+++ b/indra/llcommon/llprocess.h
@@ -340,6 +340,20 @@ public:
typedef std::size_t size_type;
static const size_type npos;
+
+ /**
+ * Get accumulated buffer length.
+ *
+ * For WritePipe, is there still pending data to send to child?
+ *
+ * For ReadPipe, we often need to refrain from actually reading the
+ * std::istream returned by get_istream() until we've accumulated
+ * enough data to make it worthwhile. For instance, if we're expecting
+ * a number from the child, but the child happens to flush "12" before
+ * emitting "3\n", get_istream() >> myint could return 12 rather than
+ * 123!
+ */
+ virtual size_type size() const = 0;
};
/// As returned by getWritePipe() or getOptWritePipe()
@@ -388,16 +402,6 @@ public:
virtual std::string read(size_type len) = 0;
/**
- * Get accumulated buffer length.
- * Often we need to refrain from actually reading the std::istream
- * returned by get_istream() until we've accumulated enough data to
- * make it worthwhile. For instance, if we're expecting a number from
- * the child, but the child happens to flush "12" before emitting
- * "3\n", get_istream() >> myint could return 12 rather than 123!
- */
- virtual size_type size() const = 0;
-
- /**
* Peek at accumulated buffer data without consuming it. Optional
* parameters give you substr() functionality.
*