diff options
author | weidai <weidai11@users.noreply.github.com> | 2003-06-06 02:34:03 +0000 |
---|---|---|
committer | weidai <weidai11@users.noreply.github.com> | 2003-06-06 02:34:03 +0000 |
commit | 6c4437d03df6a1beadfadfc7c5388005c69665db (patch) | |
tree | 22ac172cd2a9920b7d33711a25947c5c98e8cef2 /queue.h | |
parent | 2f50e8eac958f5a1bf7be05aeac015e5ee400927 (diff) | |
download | cryptopp-git-6c4437d03df6a1beadfadfc7c5388005c69665db.tar.gz |
sync with private branch
Diffstat (limited to 'queue.h')
-rw-r--r-- | queue.h | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -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) |