00001 00009 #ifndef __Buffer_H__ 00010 #define __Buffer_H__ 00011 00012 #if _MSC_VER > 1000 00013 #pragma once 00014 #endif 00015 00016 #include "PKIFdll.h" 00017 #define CAC_API_FACTORY 00018 00019 #include <vector> 00020 00021 // forward declaration 00022 struct CPKIFBufferImpl; 00023 00031 class CAC_API CPKIFBuffer 00032 { 00033 public: 00034 CPKIFBuffer(); 00035 CPKIFBuffer(const unsigned char* buf, unsigned int bufLen); 00036 00039 CPKIFBuffer(bool takeOwnership, unsigned char* buf, unsigned int bufLen); 00040 CPKIFBuffer(const CPKIFBuffer& data); 00041 //CPKIFBuffer(const ASN1DynOctStr& data); 00042 virtual ~CPKIFBuffer(); 00043 00044 unsigned char* AllocateBuffer(int len); 00045 const unsigned char* GetBuffer() const; 00046 unsigned int GetLength() const; 00047 00048 bool operator==(const CPKIFBuffer& rhs); 00049 bool operator!=(const CPKIFBuffer& rhs); 00050 00051 private: 00052 CPKIFBuffer& operator=(const CPKIFBuffer& rhs); //added 4/6/2004 00053 00054 struct CPKIFBufferImpl *m_impl; 00055 }; 00056 00057 DECLARE_SMART_POINTERS(CPKIFBuffer); 00058 typedef std::vector<CPKIFBufferPtr, PKIFAlloc<CPKIFBufferPtr> > CPKIFBufferList; 00059 DECLARE_SMART_POINTERS(CPKIFBufferList); 00060 00061 #endif 00062