summaryrefslogtreecommitdiff
path: root/queue.h
diff options
context:
space:
mode:
authorweidai <weidai11@users.noreply.github.com>2003-06-06 02:34:03 +0000
committerweidai <weidai11@users.noreply.github.com>2003-06-06 02:34:03 +0000
commit6c4437d03df6a1beadfadfc7c5388005c69665db (patch)
tree22ac172cd2a9920b7d33711a25947c5c98e8cef2 /queue.h
parent2f50e8eac958f5a1bf7be05aeac015e5ee400927 (diff)
downloadcryptopp-git-6c4437d03df6a1beadfadfc7c5388005c69665db.tar.gz
sync with private branch
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 e247d9f6..b9641bc4 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)