本文整理汇总了C++中SjByteVector::append方法的典型用法代码示例。如果您正苦于以下问题:C++ SjByteVector::append方法的具体用法?C++ SjByteVector::append怎么用?C++ SjByteVector::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SjByteVector
的用法示例。
在下文中一共展示了SjByteVector::append方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
SjByteVector ID3v2_TextIdentificationFrame::renderFields() const
{
SjByteVector v;
if(m_fieldList.GetCount() > 0) {
v.append((unsigned char)(m_textEncoding));
/*for(StringList::Iterator it = d->fieldList.begin(); it != d->fieldList.end(); it++) {
// Since the field list is null delimited, if this is not the first
// element in the list, append the appropriate delimiter for this
// encoding.
if(it != d->fieldList.begin())
v.append(textDelimiter(d->textEncoding));
v.append((*it).data(d->textEncoding));
}*/
int i, iCount = m_fieldList.GetCount();
for( i = 0; i < iCount; i++ )
{
if( i )
v.append(textDelimiter(m_textEncoding));
v.appendString(m_fieldList.Item(i), m_textEncoding);
}
}
return v;
}
示例2:
SjByteVector ID3v2_Frame::textDelimiter(SjStringType t)
{
SjByteVector d = (unsigned char)(0);
if(t == SJ_UTF16 || t == SJ_UTF16BE)
d.append((unsigned char)(0));
return d;
}
示例3: render
SjByteVector APE_Footer::render(bool isHeader) const
{
SjByteVector v;
// add the file identifier -- "APETAGEX"
v.append(fileIdentifier());
// add the version number -- we always render a 2.000 tag regardless of what
// the tag originally was.
v.append(SjByteVector::fromUint(2000, false));
// add the tag size
v.append(SjByteVector::fromUint(m_tagSize, false));
// add the item count
v.append(SjByteVector::fromUint(m_itemCount, false));
// render and add the flags (footer is always present)
unsigned long flags = 0;
flags |= m_headerPresent? 0x80000000UL : 0UL;
flags |= isHeader? 0x20000000UL : 0UL;
v.append(SjByteVector::fromUint(flags, false));
// add the reserved 64bit
v.append(SjByteVector::fromLongLong(0));
// done
return v;
}
示例4: char
SjByteVector ID3v2_Tag::render()
{
// We need to render the "tag data" first so that we have to correct size to
// render in the tag's header. The "tag data" -- everything that is included
// in ID3v2::Header::tagSize() -- includes the extended header, frames and
// padding, but does not include the tag's header or footer.
SjByteVector tagData;
// TODO: Render the extended header.
// Loop through the frames rendering them and adding them to the tagData.
//for(FrameList::Iterator it = d->frameList.begin(); it != d->frameList.end(); it++)
for ( ID3v2_FrameList::Node *node = m_frameList.GetFirst(); node; node = node->GetNext() )
{
ID3v2_Frame* it = node->GetData();
if(!it->header()->tagAlterPreservation())
tagData.append(it->render());
}
// Compute the amount of padding, and append that to tagData.
SjUint paddingSize = 0;
SjUint originalSize = m_header.tagSize();
if(tagData.size() < originalSize)
paddingSize = originalSize - tagData.size();
else
paddingSize = 1024;
tagData.append(SjByteVector(paddingSize, char(0)));
// Set the tag size.
m_header.setTagSize(tagData.size());
// TODO: This should eventually include d->footer->render().
return m_header.render() + tagData;
}
示例5: bytes
static void get_str16_nolen(WMA_File *f, int len, wxString& s)
{
SjByteVector bv = f->ReadBlock(len); // len here is apparently in bytes (see code below)
bv.append( SjByteVector::fromShort(0) ); // NULL terminator
s = bv.toString(SJ_UTF16LE);
//s = String(bv, String::UTF16LE);
// int c;
// char *q;
// q = buf;
// while (len > 0) {
// c = get_le16(f);
// if ((q - buf) < buf_size - 1)
// *q++ = c;
// len-=2;
// }
// *q = '\0';
}