本文整理汇总了C++中aurora::GFF3Struct::getOrientation方法的典型用法代码示例。如果您正苦于以下问题:C++ GFF3Struct::getOrientation方法的具体用法?C++ GFF3Struct::getOrientation怎么用?C++ GFF3Struct::getOrientation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类aurora::GFF3Struct
的用法示例。
在下文中一共展示了GFF3Struct::getOrientation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: catch
void GFF3Dumper::dumpField(const Aurora::GFF3Struct &strct, const Common::UString &field) {
Aurora::GFF3Struct::FieldType type = strct.getType(field);
Common::UString typeName;
if (((size_t) type) < ARRAYSIZE(kGFF3FieldTypeNames))
typeName = kGFF3FieldTypeNames[(int)type];
else
typeName = "filetype" + Common::composeString((uint64) type);
Common::UString label = field;
// Structs already open their own tag
if (type != Aurora::GFF3Struct::kFieldTypeStruct) {
_xml->openTag(typeName);
_xml->addProperty("label", label);
}
switch (type) {
case Aurora::GFF3Struct::kFieldTypeChar:
_xml->setContents(Common::composeString(strct.getUint(field)));
break;
case Aurora::GFF3Struct::kFieldTypeByte:
case Aurora::GFF3Struct::kFieldTypeUint16:
case Aurora::GFF3Struct::kFieldTypeUint32:
case Aurora::GFF3Struct::kFieldTypeUint64:
_xml->setContents(Common::composeString(strct.getUint(field)));
break;
case Aurora::GFF3Struct::kFieldTypeSint16:
case Aurora::GFF3Struct::kFieldTypeSint32:
case Aurora::GFF3Struct::kFieldTypeSint64:
_xml->setContents(Common::composeString(strct.getSint(field)));
break;
case Aurora::GFF3Struct::kFieldTypeFloat:
case Aurora::GFF3Struct::kFieldTypeDouble:
_xml->setContents(Common::UString::format("%.6f", strct.getDouble(field)));
break;
case Aurora::GFF3Struct::kFieldTypeStrRef:
_xml->setContents(strct.getString(field));
break;
case Aurora::GFF3Struct::kFieldTypeExoString:
case Aurora::GFF3Struct::kFieldTypeResRef:
try {
_xml->setContents(strct.getString(field));
} catch (...) {
_xml->addProperty("base64", "true");
Common::SeekableReadStream *data = strct.getData(field);
_xml->setContents(*data);
delete data;
}
break;
case Aurora::GFF3Struct::kFieldTypeLocString:
{
Aurora::LocString locString;
strct.getLocString(field, locString);
_xml->addProperty("strref", Common::composeString(locString.getID()));
dumpLocString(locString);
}
break;
case Aurora::GFF3Struct::kFieldTypeVoid:
_xml->setContents(*strct.getData(field));
break;
case Aurora::GFF3Struct::kFieldTypeStruct:
dumpStruct(strct.getStruct(field), label);
break;
case Aurora::GFF3Struct::kFieldTypeList:
dumpList(strct.getList(field));
break;
case Aurora::GFF3Struct::kFieldTypeOrientation:
{
double a = 0.0, b = 0.0, c = 0.0, d = 0.0;
strct.getOrientation(field, a, b, c, d);
_xml->breakLine();
_xml->openTag("double");
_xml->setContents(Common::UString::format("%.6f", a));
_xml->closeTag();
_xml->breakLine();
_xml->openTag("double");
_xml->setContents(Common::UString::format("%.6f", b));
_xml->closeTag();
_xml->breakLine();
_xml->openTag("double");
_xml->setContents(Common::UString::format("%.6f", c));
//.........这里部分代码省略.........