本文整理汇总了C++中Character::GetSubType方法的典型用法代码示例。如果您正苦于以下问题:C++ Character::GetSubType方法的具体用法?C++ Character::GetSubType怎么用?C++ Character::GetSubType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Character
的用法示例。
在下文中一共展示了Character::GetSubType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FormatCharacter
bool Architecture::FormatCharacter(
Document const& rDoc,
Address const& rAddr,
Character const& rChar,
PrintData & rPrintData) const
{
auto const& rBinStrm = rDoc.GetBinaryStream();
std::ostringstream oss;
TOffset Off;
if (!rDoc.ConvertAddressToFileOffset(rAddr, Off))
return false;
switch (rChar.GetSubType())
{
case Character::AsciiCharacterType:
default:
{
s8 Char;
if (!rBinStrm.Read(Off, Char))
return false;
switch (Char)
{
case '\0':
oss << "\\0";
break;
case '\a':
oss << "\\a";
break;
case '\b':
oss << "\\b";
break;
case '\t':
oss << "\\t";
break;
case '\n':
oss << "\\n";
break;
case '\v':
oss << "\\v";
break;
case '\f':
oss << "\\f";
break;
case '\r':
oss << "\\r";
break;
default:
oss << Char;
break;
}
}
}
rPrintData.AppendCharacter(oss.str());
return true;
}
示例2: FormatCharacter
bool Architecture::FormatCharacter(
Document const& rDoc,
BinaryStream const& rBinStrm,
Address const& rAddr,
Character const& rChar,
std::string & rStrCell,
Cell::Mark::List & rMarks) const
{
std::ostringstream oss;
TOffset Off;
if (!rDoc.ConvertAddressToFileOffset(rAddr, Off))
return false;
switch (rChar.GetSubType())
{
case Character::AsciiCharacterType: default:
{
s8 Char;
if (!rBinStrm.Read(Off, Char))
return false;
switch (Char)
{
case '\0': oss << "\\0"; break;
case '\a': oss << "\\a"; break;
case '\b': oss << "\\b"; break;
case '\t': oss << "\\t"; break;
case '\n': oss << "\\n"; break;
case '\v': oss << "\\v"; break;
case '\f': oss << "\\f"; break;
case '\r': oss << "\\r"; break;
default: oss << Char; break;
}
}
}
rMarks.push_back(Cell::Mark(Cell::Mark::StringType, 1));
rStrCell = oss.str();
return true;
}