本文整理汇总了C++中AString::Add_Space方法的典型用法代码示例。如果您正苦于以下问题:C++ AString::Add_Space方法的具体用法?C++ AString::Add_Space怎么用?C++ AString::Add_Space使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AString
的用法示例。
在下文中一共展示了AString::Add_Space方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Print_UInt64_and_String
void Print_UInt64_and_String(AString &s, UInt64 val, const char *name)
{
char temp[32];
ConvertUInt64ToString(val, temp);
s += temp;
s.Add_Space();
s += name;
}
示例2: ParseDepedencyExpression
static bool ParseDepedencyExpression(const Byte *p, UInt32 size, AString &res)
{
res.Empty();
for (UInt32 i = 0; i < size;)
{
unsigned command = p[i++];
if (command > ARRAY_SIZE(kExpressionCommands))
return false;
res += kExpressionCommands[command];
if (command < 3)
{
if (i + kGuidSize > size)
return false;
res.Add_Space();
AddGuid(res, p + i, false);
i += kGuidSize;
}
res += "; ";
}
return true;
}
示例3: Init
void CFieldPrinter::Init(const CFieldInfoInit *standardFieldTable, unsigned numItems)
{
Clear();
for (unsigned i = 0; i < numItems; i++)
{
CFieldInfo &f = _fields.AddNew();
const CFieldInfoInit &fii = standardFieldTable[i];
f.PropID = fii.PropID;
f.IsRawProp = false;
f.NameA = fii.Name;
f.TitleAdjustment = fii.TitleAdjustment;
f.TextAdjustment = fii.TextAdjustment;
f.PrefixSpacesWidth = fii.PrefixSpacesWidth;
f.Width = fii.Width;
unsigned k;
for (k = 0; k < fii.PrefixSpacesWidth; k++)
LinesString.Add_Space();
for (k = 0; k < fii.Width; k++)
LinesString += '-';
}
}
示例4: GetProperty
STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value)
{
COM_TRY_BEGIN
CPropVariant prop;
const CSection &item = _sections[index];
switch (propID)
{
case kpidPath:
{
AString s (GetName(_segments[item.SegmentIndex].Name));
if (!item.IsDummy)
s += GetName(item.Name);
prop = MultiByteToUnicodeString(s);
break;
}
case kpidSize: /* prop = (UInt64)item.VSize; break; */
case kpidPackSize: prop = (UInt64)item.GetPackSize(); break;
case kpidCharacts:
if (!item.IsDummy)
{
AString res (TypeToString(g_SectTypes, ARRAY_SIZE(g_SectTypes), item.Flags & SECT_TYPE_MASK));
AString s (FlagsToString(g_Flags, ARRAY_SIZE(g_Flags), item.Flags & SECT_ATTR_MASK));
if (!s.IsEmpty())
{
res.Add_Space();
res += s;
}
prop = res;
}
break;
case kpidOffset: prop = item.Pa; break;
case kpidVa: prop = item.Va; break;
}
prop.Detach(value);
return S_OK;
COM_TRY_END
}
示例5: if
//.........这里部分代码省略.........
// Section 0
ReadChunk(inStream, database.StartPosition + sectionOffsets[0], sectionSizes[0]);
if (sectionSizes[0] < 0x18)
return S_FALSE;
if (ReadUInt32() != 0x01FE)
return S_FALSE;
ReadUInt32(); // unknown: 0
UInt64 fileSize = ReadUInt64();
database.UpdatePhySize(fileSize);
ReadUInt32(); // unknown: 0
ReadUInt32(); // unknown: 0
// Section 1: The Directory Listing
ReadChunk(inStream, database.StartPosition + sectionOffsets[1], sectionSizes[1]);
if (ReadUInt32() != kSignature_IFCM)
return S_FALSE;
if (ReadUInt32() != 1) // (probably a version number)
return S_FALSE;
UInt32 dirChunkSize = ReadUInt32(); // $2000
if (dirChunkSize < 64)
return S_FALSE;
ReadUInt32(); // $100000 (unknown)
ReadUInt32(); // -1 (unknown)
ReadUInt32(); // -1 (unknown)
UInt32 numDirChunks = ReadUInt32();
ReadUInt32(); // 0 (unknown, probably high word of above)
for (UInt32 ci = 0; ci < numDirChunks; ci++)
{
UInt64 chunkPos = _inBuffer.GetProcessedSize();
if (ReadUInt32() == kSignature_AOLL)
{
UInt32 quickrefLength = ReadUInt32(); // Len of quickref area at end of directory chunk
if (quickrefLength > dirChunkSize || quickrefLength < 2)
return S_FALSE;
ReadUInt64(); // Directory chunk number
// This must match physical position in file, that is
// the chunk size times the chunk number must be the
// offset from the end of the directory header.
ReadUInt64(); // Chunk number of previous listing chunk when reading
// directory in sequence (-1 if first listing chunk)
ReadUInt64(); // Chunk number of next listing chunk when reading
// directory in sequence (-1 if last listing chunk)
ReadUInt64(); // Number of first listing entry in this chunk
ReadUInt32(); // 1 (unknown -- other values have also been seen here)
ReadUInt32(); // 0 (unknown)
unsigned numItems = 0;
for (;;)
{
UInt64 offset = _inBuffer.GetProcessedSize() - chunkPos;
UInt32 offsetLimit = dirChunkSize - quickrefLength;
if (offset > offsetLimit)
return S_FALSE;
if (offset == offsetLimit)
break;
if (database.NewFormat)
{
UInt16 nameLen = ReadUInt16();
if (nameLen == 0)
return S_FALSE;
UString name;
ReadUString((unsigned)nameLen, name);
AString s;
ConvertUnicodeToUTF8(name, s);
Byte b = ReadByte();
s.Add_Space();
PrintByte(b, s);
s.Add_Space();
UInt64 len = ReadEncInt();
// then number of items ?
// then length ?
// then some data (binary encoding?)
while (len-- != 0)
{
b = ReadByte();
PrintByte(b, s);
}
database.NewFormatString += s;
database.NewFormatString += "\r\n";
}
else
{
RINOK(ReadDirEntry(database));
}
numItems++;
}
Skip(quickrefLength - 2);
if (ReadUInt16() != numItems)
return S_FALSE;
if (numItems > numDirEntries)
return S_FALSE;
numDirEntries -= numItems;
}
else
Skip(dirChunkSize - 4);
}
return numDirEntries == 0 ? S_OK : S_FALSE;
}