本文整理汇总了C++中IndexVector::reserve方法的典型用法代码示例。如果您正苦于以下问题:C++ IndexVector::reserve方法的具体用法?C++ IndexVector::reserve怎么用?C++ IndexVector::reserve使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IndexVector
的用法示例。
在下文中一共展示了IndexVector::reserve方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pen
postTable::postTable (OpenTypeFile &aFont, MemoryBlockPtr memory) : Table (aFont)
{
MemoryPen pen (memory);
version = pen.readFixed();
if (version != 0x00020000 && version != 0x00030000)
throw Exception ("Unsupported table version: " + String (version, 16));
italicAngle = pen.readFixed();
underlinePosition = pen.readFWord();
underlineThickness = pen.readFWord();
isFixedPitch = pen.readULong();
minMemType42 = pen.readULong();
maxMemType42 = pen.readULong();
minMemType1 = pen.readULong();
maxMemType1 = pen.readULong();
if (version == 0x00020000) {
// Read glyph names
UShort glyphNum = pen.readUShort();
typedef vector<UShort> IndexVector;
IndexVector glyphNameIndices;
glyphNameIndices.reserve (glyphNum);
UShort i;
for (i = 0; i < glyphNum; i++)
glyphNameIndices.push_back (pen.readUShort());
vector<String> extraNames;
IndexVector::iterator index;
for (index = glyphNameIndices.begin(); index != glyphNameIndices.end(); index ++) {
if (*index < MACINTOSH_SET_SIZE)
postNames.push_back (macGlyphs [*index]);
else {
UShort extraIndex = *index - MACINTOSH_SET_SIZE;
while (extraNames.size() <= extraIndex) {
Byte nameLength = pen.readByte();
extraNames.push_back (pen.readString (nameLength));
}
postNames.push_back (extraNames [extraIndex]);
}
}
}
}