本文整理汇总了C++中AsnBuf::length方法的典型用法代码示例。如果您正苦于以下问题:C++ AsnBuf::length方法的具体用法?C++ AsnBuf::length怎么用?C++ AsnBuf::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AsnBuf
的用法示例。
在下文中一共展示了AsnBuf::length方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BDecContent
// Decodes a BER BIT STRING from the given buffer and stores
// the value in this object.
void AsnBits::BDecContent (const AsnBuf &b, AsnTag tagId, AsnLen elmtLen, AsnLen &bytesDecoded)
{
FUNC("AsnBits::BDecContent");
if (elmtLen == INDEFINITE_LEN || elmtLen > b.length())
{
throw MemoryException(elmtLen, "elmtLen requests for too much data", STACK_ENTRY);
}
/*
* tagId is encoded tag shifted into long int.
* if CONS bit is set then constructed bit string
*/
if (tagId & 0x20000000)
BDecConsBits (b, elmtLen, bytesDecoded);
else /* primitive octet string */
{
if (elmtLen == INDEFINITE_LEN)
throw BoundsException("indefinite length on primitive", STACK_ENTRY);
if (elmtLen > b.length() || elmtLen <= 0)
throw BoundsException("length problem on decoding content", STACK_ENTRY);
bytesDecoded += elmtLen;
elmtLen--;
unsigned int iUnusedBitLen= (unsigned int)b.GetByte();
if (iUnusedBitLen > 7)
throw BoundsException("Length problem - Unused bits > 7", STACK_ENTRY);
bitLen = (elmtLen * 8) - iUnusedBitLen;
bits = new unsigned char[elmtLen];
b.GetUSeg (bits, elmtLen);
}
} /* AsnBits::BDecContent */
示例2: splice
// insert()
//
// insert cards from b into this AsnBuf
//
// TBD: is it necessary to return the length?
//
long AsnBuf::splice(AsnBuf &b)
{
if (m_card != m_deck.end() &&
((*m_card == NULL) || (*m_card)->length() == 0)) {
delete *m_card;
m_card = m_deck.erase(m_card);
}
long length = b.length();
Deck::reverse_iterator ib;
for (ib = b.m_deck.rbegin(); ib != b.m_deck.rend(); ++ib) {
m_card = m_deck.insert(m_deck.begin(), *ib);
}
b.m_deck.clear();
return length;
}
示例3: splice
// insert()
//
// insert cards from b into this AsnBuf
//
// TBD: is it necessary to return the length?
//
long AsnBuf::splice(AsnBuf &b)
{
Deck::iterator ib = b.m_deck.end();
//#ifdef _DEBUG
// Card *tmpCard = *ib;
//#endif
long length = b.length();
if (m_card != m_deck.end() && (*m_card)->length() == 0)
m_card = m_deck.erase(m_card);
do
{
ib--;
//#ifdef _DEBUG
// tmpCard = *ib;
//#endif
m_card = m_deck.insert(m_deck.begin(), *ib);
ib = b.m_deck.erase(ib);
} while (ib != b.m_deck.begin()) ;
return length;
}