25 #ifndef _ASN1CBITSTR_H_ 26 #define _ASN1CBITSTR_H_ 44 #ifndef _NO_UTILS_CLASSES 54 virtual OSSIZE getValue ()
const = 0;
62 virtual int setValue (OSSIZE value) = 0;
79 virtual OSSIZE getValue ()
const {
return mSize; }
102 virtual OSSIZE getValue ()
const {
return mSize; }
103 virtual int setValue (OSSIZE value);
125 virtual OSSIZE getValue ()
const {
return mSize; }
126 virtual int setValue (OSSIZE value);
148 virtual OSSIZE getValue ()
const {
return mSize; }
149 virtual int setValue (OSSIZE value);
178 OSOCTET** mppExtData;
182 OSSIZE mUnitsAllocated;
186 OSOCTET* allocateMemory (OSSIZE sz);
187 OSOCTET* reallocateMemory
188 (OSOCTET* old, OSSIZE oldBufSz, OSSIZE newBufSz);
189 void freeMemory (OSOCTET* mem);
196 void recalculateUnitsUsed();
202 int checkCapacity (OSSIZE unitsRequired);
208 OSOCTET getBits (OSSIZE j);
210 void privateInit (OSSIZE nbits);
211 void privateInit (OSOCTET* bitStr, OSSIZE maxNumbits_, OSOCTET** ppExtData);
220 EXTRTMETHOD
ASN1CBitStr (OSRTMessageBufferIF& msgBuf);
226 EXTRTMETHOD ASN1CBitStr();
235 #if SIZE_MAX > OSUINT32_MAX //if size_t > 32 bits 244 EXTRTMETHOD ASN1CBitStr
245 (OSOCTET* pBits, OSSIZE& numbits, OSSIZE maxNumbits,
246 OSOCTET** ppExtData = 0);
257 EXTRTMETHOD ASN1CBitStr
258 (OSOCTET* pBits, OSUINT32& numbits, OSSIZE maxNumbits,
259 OSOCTET** ppExtData = 0);
261 EXTRTMETHOD ASN1CBitStr
262 (OSOCTET* pBits, OSUINT8& numbits, OSSIZE maxNumbits,
263 OSOCTET** ppExtData = 0);
265 EXTRTMETHOD ASN1CBitStr
266 (OSOCTET* pBits, OSUINT16& numbits, OSSIZE maxNumbits,
267 OSOCTET** ppExtData = 0);
270 EXTRTMETHOD ASN1CBitStr (OSOCTET* pBits, OSSIZE maxNumbits);
287 void initBase (OSOCTET* pBits, OSSIZE numbits, OSSIZE maxNumbits);
289 EXTRTMETHOD
void init
290 (OSOCTET* pBits, OSUINT32& numbits, OSSIZE maxNumbits);
292 EXTRTMETHOD
void init
293 (OSOCTET* pBits, OSUINT8& numbits, OSSIZE maxNumbits);
295 EXTRTMETHOD
void init
296 (OSOCTET* pBits, OSUINT16& numbits, OSSIZE maxNumbits);
310 EXTRTMETHOD ASN1CBitStr (OSRTMessageBufferIF& msgbuf, OSSIZE nbits);
312 #if SIZE_MAX > OSUINT32_MAX //if size_t > 32 bits 324 EXTRTMETHOD ASN1CBitStr
325 (OSRTMessageBufferIF& msgbuf, OSOCTET* bitStr,
326 OSSIZE& numbits, OSSIZE maxNumbits_, OSOCTET** ppExtData = 0);
340 EXTRTMETHOD ASN1CBitStr
341 (OSRTMessageBufferIF& msgbuf, OSOCTET* bitStr,
342 OSUINT32& numbits, OSSIZE maxNumbits_, OSOCTET** ppExtData = 0);
344 EXTRTMETHOD ASN1CBitStr
345 (OSRTMessageBufferIF& msgbuf, OSOCTET* bitStr,
346 OSUINT8& numbits, OSSIZE maxNumbits_, OSOCTET** ppExtData = 0);
348 EXTRTMETHOD ASN1CBitStr
349 (OSRTMessageBufferIF& msgbuf, OSOCTET* bitStr,
350 OSUINT16& numbits, OSSIZE maxNumbits_, OSOCTET** ppExtData = 0);
352 EXTRTMETHOD ASN1CBitStr
353 (OSRTMessageBufferIF& msgbuf, OSOCTET* bitStr, OSSIZE maxNumbits_);
360 EXTRTMETHOD ASN1CBitStr
368 EXTRTMETHOD ASN1CBitStr
375 EXTRTMETHOD ASN1CBitStr (
OSRTContext& ctxt, OSSIZE nbits);
377 #if SIZE_MAX > OSUINT32_MAX //if size_t > 32 bits 385 EXTRTMETHOD ASN1CBitStr
387 OSSIZE& octsNumbits, OSSIZE maxNumbits_, OSOCTET** ppExtData = 0);
390 EXTRTMETHOD ASN1CBitStr
392 OSUINT32& octsNumbits, OSSIZE maxNumbits_, OSOCTET** ppExtData = 0);
394 EXTRTMETHOD ASN1CBitStr
396 OSUINT8& octsNumbits, OSSIZE maxNumbits_, OSOCTET** ppExtData = 0);
398 EXTRTMETHOD ASN1CBitStr
400 OSUINT16& octsNumbits, OSSIZE maxNumbits_, OSOCTET** ppExtData = 0);
402 EXTRTMETHOD ASN1CBitStr
403 (
OSRTContext& ctxt, OSOCTET* bitStr, OSSIZE maxNumbits_);
422 EXTRTMETHOD ASN1CBitStr (
const ASN1CBitStr& bitStr);
427 EXTRTMETHOD ASN1CBitStr (
const ASN1CBitStr& bitStr, OSBOOL extendable);
430 EXTRTMETHOD ~ASN1CBitStr();
450 EXTRTMETHOD
int set (OSSIZE bitIndex);
477 EXTRTMETHOD
int set (OSSIZE fromIndex, OSSIZE toIndex);
494 inline int change (OSSIZE bitIndex, OSBOOL value) {
495 return (value) ?
set (bitIndex) : clear (bitIndex);
517 EXTRTMETHOD
int clear (OSSIZE bitIndex);
544 EXTRTMETHOD
int clear (OSSIZE fromIndex, OSSIZE toIndex);
557 EXTRTMETHOD
void clear();
582 EXTRTMETHOD
int invert (OSSIZE bitIndex);
613 EXTRTMETHOD
int invert(OSSIZE fromIndex, OSSIZE toIndex);
629 EXTRTMETHOD OSBOOL
get(OSSIZE bitIndex);
639 inline OSBOOL
isSet(OSSIZE bitIndex) {
return get(bitIndex); }
653 inline OSBOOL
isEmpty() {
return (mUnitsUsed == 0); }
667 EXTRTMETHOD OSSIZE size()
const;
680 EXTRTMETHOD OSSIZE length()
const;
695 EXTRTMETHOD OSSIZE cardinality()
const;
713 EXTRTMETHOD
int getBytes (OSOCTET* pBuf, OSSIZE bufSz);
741 (OSSIZE fromIndex, OSSIZE toIndex, OSOCTET* pBuf, OSSIZE bufSz);
760 EXTRTMETHOD
int doAnd (
const OSOCTET* pOctstr, OSSIZE octsNumbits);
774 return doAnd(bitStr.data, bitStr.numbits);
787 inline int doAnd(
const ASN1CBitStr& bitStr) {
788 return doAnd(*bitStr.mpUnits, bitStr.
length());
808 EXTRTMETHOD
int doOr(
const OSOCTET* pOctstr, OSSIZE octsNumbits);
822 return doOr(bitStr.data, bitStr.numbits);
835 inline int doOr(
const ASN1CBitStr& bitStr) {
836 return doOr(*bitStr.mpUnits, bitStr.
length());
855 EXTRTMETHOD
int doXor(
const OSOCTET* pOctstr, OSSIZE octsNumbits);
869 return doXor(bitStr.data, bitStr.numbits);
882 inline int doXor(
const ASN1CBitStr& bitStr) {
883 return doXor(*bitStr.mpUnits, bitStr.
length());
909 EXTRTMETHOD
int doAndNot(
const OSOCTET* pOctstr, OSSIZE octsNumbits);
926 return doAndNot(bitStr.data, bitStr.numbits);
943 return doAndNot(*bitStr.mpUnits, bitStr.
length());
962 EXTRTMETHOD
int shiftLeft(OSSIZE shift);
980 EXTRTMETHOD
int shiftRight(OSSIZE shift);
991 EXTRTMETHOD OSUINT32 unusedBitsInLastUnit();
1022 EXTRTMETHOD
operator ASN1TDynBitStr*();
1025 typedef class _ASN1CBitStr :
public ASN1CType {
1027 _ASN1CBitStr (OSRTMessageBufferIF& msgBuf, OSUINT32 nbits) :
1030 _ASN1CBitStr (OSRTMessageBufferIF& msgBuf, OSOCTET* bitStr,
1031 OSUINT32& octsNumbits, OSUINT32 maxNumbits_) :
1034 _ASN1CBitStr (OSRTMessageBufferIF& msgBuf,
ASN1TDynBitStr& bitStr) :
1037 #endif // _NO_UTILS_CLASSES 1038 #endif // _ASN1CBITSTR_H_ Definition: asn1CppTypes.h:661
int doXor(const ASN1CBitStr &bitStr)
Definition: ASN1CBitStr.h:882
int doOr(const ASN1TDynBitStr &bitStr)
Definition: ASN1CBitStr.h:821
int doAndNot(const ASN1CBitStr &bitStr)
Definition: ASN1CBitStr.h:942
int doAnd(const ASN1CBitStr &bitStr)
Definition: ASN1CBitStr.h:787
OSBOOL isSet(OSSIZE bitIndex)
Definition: ASN1CBitStr.h:639
EXTRTMETHOD OSSIZE length() const
Definition: asn1CppTypes.h:308
int doXor(const ASN1TDynBitStr &bitStr)
Definition: ASN1CBitStr.h:868
Definition: ASN1CBitStr.h:51
int doOr(const ASN1CBitStr &bitStr)
Definition: ASN1CBitStr.h:835
Definition: asn1CppTypes.h:628
Definition: ASN1CBitStr.h:139
Definition: ASN1CBitStr.h:70
Definition: ASN1CBitStr.h:116
int change(OSSIZE bitIndex, OSBOOL value)
Definition: ASN1CBitStr.h:494
Definition: OSRTContext.h:64
virtual int setValue(OSSIZE value)=0
Definition: ASN1CBitStr.h:169
int doAnd(const ASN1TDynBitStr &bitStr)
Definition: ASN1CBitStr.h:773
int doAndNot(const ASN1TDynBitStr &bitStr)
Definition: ASN1CBitStr.h:925
Definition: ASN1CBitStr.h:93
OSBOOL isEmpty()
Definition: ASN1CBitStr.h:653