From aec493328f4cd1a6d717743c984a153dc120013a Mon Sep 17 00:00:00 2001 From: weidai Date: Fri, 6 Jun 2003 02:34:03 +0000 Subject: sync with private branch git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@76 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- queue.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'queue.h') 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) -- cgit v1.2.1