summaryrefslogtreecommitdiff
path: root/queue.h
diff options
context:
space:
mode:
authorweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-06-06 02:34:03 +0000
committerweidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>2003-06-06 02:34:03 +0000
commitaec493328f4cd1a6d717743c984a153dc120013a (patch)
tree22ac172cd2a9920b7d33711a25947c5c98e8cef2 /queue.h
parente3e0c6c7d2d37b902060ffefc27270675fbf246b (diff)
downloadcryptopp-aec493328f4cd1a6d717743c984a153dc120013a.tar.gz
sync with private branch
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@76 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'queue.h')
-rw-r--r--queue.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/queue.h b/queue.h
index e247d9f..b9641bc 100644
--- a/queue.h
+++ b/queue.h
@@ -52,6 +52,7 @@ public:
const byte * Spy(unsigned int &contiguousSize) const;
void LazyPut(const byte *inString, unsigned int size);
+ void LazyPutModifiable(byte *inString, unsigned int size);
void UndoLazyPut(unsigned int size);
void FinalizeLazyPut();
@@ -100,8 +101,9 @@ private:
unsigned int m_nodeSize;
ByteQueueNode *m_head, *m_tail;
- const byte *m_lazyString;
+ byte *m_lazyString;
unsigned int m_lazyLength;
+ bool m_lazyStringModifiable;
};
//! use this to make sure LazyPut is finalized in event of exception
@@ -112,10 +114,20 @@ public:
: m_bq(bq) {bq.LazyPut(inString, size);}
~LazyPutter()
{try {m_bq.FinalizeLazyPut();} catch(...) {}}
+protected:
+ LazyPutter(ByteQueue &bq) : m_bq(bq) {}
private:
ByteQueue &m_bq;
};
+//! like LazyPutter, but does a LazyPutModifiable instead
+class LazyPutterModifiable : public LazyPutter
+{
+public:
+ LazyPutterModifiable(ByteQueue &bq, byte *inString, unsigned int size)
+ : LazyPutter(bq) {bq.LazyPutModifiable(inString, size);}
+};
+
NAMESPACE_END
NAMESPACE_BEGIN(std)