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 > ULONG_MAX //if 64 bit system 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 > ULONG_MAX //if 64 bit system 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);
384 EXTRTMETHOD ASN1CBitStr
386 OSUINT32& octsNumbits, OSSIZE maxNumbits_, OSOCTET** ppExtData = 0);
388 EXTRTMETHOD ASN1CBitStr
390 OSUINT8& octsNumbits, OSSIZE maxNumbits_, OSOCTET** ppExtData = 0);
392 EXTRTMETHOD ASN1CBitStr
394 OSUINT16& octsNumbits, OSSIZE maxNumbits_, OSOCTET** ppExtData = 0);
396 EXTRTMETHOD ASN1CBitStr
397 (
OSRTContext& ctxt, OSOCTET* bitStr, OSSIZE maxNumbits_);
409 EXTRTMETHOD ASN1CBitStr (
const ASN1CBitStr& bitStr);
414 EXTRTMETHOD ASN1CBitStr (
const ASN1CBitStr& bitStr, OSBOOL extendable);
417 EXTRTMETHOD ~ASN1CBitStr();
437 EXTRTMETHOD
int set (OSSIZE bitIndex);
464 EXTRTMETHOD
int set (OSSIZE fromIndex, OSSIZE toIndex);
481 inline int change (OSSIZE bitIndex, OSBOOL value) {
482 return (value) ?
set (bitIndex) : clear (bitIndex);
504 EXTRTMETHOD
int clear (OSSIZE bitIndex);
531 EXTRTMETHOD
int clear (OSSIZE fromIndex, OSSIZE toIndex);
544 EXTRTMETHOD
void clear();
569 EXTRTMETHOD
int invert (OSSIZE bitIndex);
600 EXTRTMETHOD
int invert(OSSIZE fromIndex, OSSIZE toIndex);
616 EXTRTMETHOD OSBOOL
get(OSSIZE bitIndex);
626 inline OSBOOL
isSet(OSSIZE bitIndex) {
return get(bitIndex); }
640 inline OSBOOL
isEmpty() {
return (mUnitsUsed == 0); }
654 EXTRTMETHOD OSSIZE size()
const;
667 EXTRTMETHOD OSSIZE length()
const;
682 EXTRTMETHOD OSSIZE cardinality()
const;
700 EXTRTMETHOD
int getBytes (OSOCTET* pBuf, OSSIZE bufSz);
728 (OSSIZE fromIndex, OSSIZE toIndex, OSOCTET* pBuf, OSSIZE bufSz);
747 EXTRTMETHOD
int doAnd (
const OSOCTET* pOctstr, OSSIZE octsNumbits);
761 return doAnd(bitStr.data, bitStr.numbits);
774 inline int doAnd(
const ASN1CBitStr& bitStr) {
775 return doAnd(*bitStr.mpUnits, bitStr.
length());
795 EXTRTMETHOD
int doOr(
const OSOCTET* pOctstr, OSSIZE octsNumbits);
809 return doOr(bitStr.data, bitStr.numbits);
822 inline int doOr(
const ASN1CBitStr& bitStr) {
823 return doOr(*bitStr.mpUnits, bitStr.
length());
842 EXTRTMETHOD
int doXor(
const OSOCTET* pOctstr, OSSIZE octsNumbits);
856 return doXor(bitStr.data, bitStr.numbits);
869 inline int doXor(
const ASN1CBitStr& bitStr) {
870 return doXor(*bitStr.mpUnits, bitStr.
length());
896 EXTRTMETHOD
int doAndNot(
const OSOCTET* pOctstr, OSSIZE octsNumbits);
913 return doAndNot(bitStr.data, bitStr.numbits);
930 return doAndNot(*bitStr.mpUnits, bitStr.
length());
949 EXTRTMETHOD
int shiftLeft(OSSIZE shift);
967 EXTRTMETHOD
int shiftRight(OSSIZE shift);
978 EXTRTMETHOD OSUINT32 unusedBitsInLastUnit();
1009 EXTRTMETHOD
operator ASN1TDynBitStr*();
1012 typedef class _ASN1CBitStr :
public ASN1CType {
1014 _ASN1CBitStr (OSRTMessageBufferIF& msgBuf, OSUINT32 nbits) :
1017 _ASN1CBitStr (OSRTMessageBufferIF& msgBuf, OSOCTET* bitStr,
1018 OSUINT32& octsNumbits, OSUINT32 maxNumbits_) :
1021 _ASN1CBitStr (OSRTMessageBufferIF& msgBuf,
ASN1TDynBitStr& bitStr) :
1024 #endif // _NO_UTILS_CLASSES 1025 #endif // _ASN1CBITSTR_H_ Definition: asn1CppTypes.h:656
int doXor(const ASN1CBitStr &bitStr)
Definition: ASN1CBitStr.h:869
int doOr(const ASN1TDynBitStr &bitStr)
Definition: ASN1CBitStr.h:808
int doAndNot(const ASN1CBitStr &bitStr)
Definition: ASN1CBitStr.h:929
int doAnd(const ASN1CBitStr &bitStr)
Definition: ASN1CBitStr.h:774
OSBOOL isSet(OSSIZE bitIndex)
Definition: ASN1CBitStr.h:626
EXTRTMETHOD OSSIZE length() const
Definition: asn1CppTypes.h:313
int doXor(const ASN1TDynBitStr &bitStr)
Definition: ASN1CBitStr.h:855
Definition: ASN1CBitStr.h:51
int doOr(const ASN1CBitStr &bitStr)
Definition: ASN1CBitStr.h:822
Definition: asn1CppTypes.h:623
Definition: ASN1CBitStr.h:139
Definition: ASN1CBitStr.h:70
Definition: ASN1CBitStr.h:116
int change(OSSIZE bitIndex, OSBOOL value)
Definition: ASN1CBitStr.h:481
Definition: OSRTContext.h:65
virtual int setValue(OSSIZE value)=0
Definition: ASN1CBitStr.h:169
int doAnd(const ASN1TDynBitStr &bitStr)
Definition: ASN1CBitStr.h:760
int doAndNot(const ASN1TDynBitStr &bitStr)
Definition: ASN1CBitStr.h:912
Definition: ASN1CBitStr.h:93
OSBOOL isEmpty()
Definition: ASN1CBitStr.h:640