Skip to content

Commit

Permalink
GFF2XML: Use Common::composeString() in GFF3Dumper/GFF4Dumper
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Jul 2, 2015
1 parent 5e93313 commit 041111f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions src/xml/gff3dumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void GFF3Dumper::dumpLocString(const Aurora::LocString &locString) {

for (std::vector<Aurora::LocString::SubLocString>::iterator s = str.begin(); s != str.end(); ++s) {
_xml->openTag("string");
_xml->addProperty("language", Common::UString::format("%u", s->language));
_xml->addProperty("language", Common::composeString(s->language));

_xml->setContents(s->str);
_xml->closeTag();
Expand Down Expand Up @@ -123,7 +123,7 @@ void GFF3Dumper::dumpField(const Aurora::GFF3Struct &strct, const Common::UStrin
if (((size_t) type) < ARRAYSIZE(kGFF3FieldTypeNames))
typeName = kGFF3FieldTypeNames[(int)type];
else
typeName = Common::UString::format("fieldtype%d", (int)type);
typeName = "filetype" + Common::composeString((uint64) type);

Common::UString label = field;

Expand All @@ -142,13 +142,13 @@ void GFF3Dumper::dumpField(const Aurora::GFF3Struct &strct, const Common::UStrin
case Aurora::GFF3Struct::kFieldTypeUint16:
case Aurora::GFF3Struct::kFieldTypeUint32:
case Aurora::GFF3Struct::kFieldTypeUint64:
_xml->setContents(Common::UString::format("%"PRIu64, Cu64(strct.getUint(field))));
_xml->setContents(Common::composeString(strct.getUint(field)));
break;

case Aurora::GFF3Struct::kFieldTypeSint16:
case Aurora::GFF3Struct::kFieldTypeSint32:
case Aurora::GFF3Struct::kFieldTypeSint64:
_xml->setContents(Common::UString::format("%"PRId64, Cd64(strct.getSint(field))));
_xml->setContents(Common::composeString(strct.getSint(field)));
break;

case Aurora::GFF3Struct::kFieldTypeFloat:
Expand All @@ -167,7 +167,7 @@ void GFF3Dumper::dumpField(const Aurora::GFF3Struct &strct, const Common::UStrin
Aurora::LocString locString;

strct.getLocString(field, locString);
_xml->addProperty("strref", Common::UString::format("%u", locString.getID()));
_xml->addProperty("strref", Common::composeString(locString.getID()));

dumpLocString(locString);
}
Expand Down Expand Up @@ -255,7 +255,7 @@ void GFF3Dumper::dumpField(const Aurora::GFF3Struct &strct, const Common::UStrin
void GFF3Dumper::dumpStruct(const Aurora::GFF3Struct &strct, const Common::UString &label) {
_xml->openTag("struct");
_xml->addProperty("label", label);
_xml->addProperty("id", Common::UString::format("%u", strct.getID()));
_xml->addProperty("id", Common::composeString(strct.getID()));
_xml->breakLine();

for (Aurora::GFF3Struct::iterator f = strct.begin(); f != strct.end(); ++f)
Expand Down
14 changes: 7 additions & 7 deletions src/xml/gff4dumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void GFF4Dumper::dumpStruct(const Aurora::GFF4Struct *strct, bool hasLabel, uint
_xml->addProperty("name", strct ? Common::tagToString(strct->getLabel()) : "");

if (hasLabel) {
_xml->addProperty("label", Common::UString::format("%u", label));
_xml->addProperty("label", Common::composeString(label));

if (!isGeneric) {
Common::UString alias = findFieldName(label);
Expand All @@ -122,7 +122,7 @@ void GFF4Dumper::dumpStruct(const Aurora::GFF4Struct *strct, bool hasLabel, uint
}

if (hasIndex)
_xml->addProperty("index", Common::UString::format("%u", index));
_xml->addProperty("index", Common::composeString(index));

if (strct) {
if (insertID(strct->getID())) {
Expand Down Expand Up @@ -184,15 +184,15 @@ void GFF4Dumper::openFieldTag(uint32 type, bool typeList, bool hasLabel, uint32
_xml->openTag(getIFieldTypeName(type, typeList));

if (hasLabel) {
_xml->addProperty("label", Common::UString::format("%u", label));
_xml->addProperty("label", Common::composeString(label));

Common::UString alias = findFieldName(label);
if (!alias.empty())
_xml->addProperty("alias", alias);
}

if (hasIndex)
_xml->addProperty("index", Common::UString::format("%u", index));
_xml->addProperty("index", Common::composeString(index));
}

void GFF4Dumper::closeFieldTag(bool doBreak) {
Expand All @@ -211,7 +211,7 @@ void GFF4Dumper::dumpFieldUint(const GFF4Field &field) {

for (size_t i = 0; i < values.size(); i++) {
openFieldTag(field.type, false, !field.isList, field.label, field.isList, i);
_xml->setContents(Common::UString::format("%"PRIu64, Cu64(values[i])));
_xml->setContents(Common::composeString(values[i]));
closeFieldTag();
}
}
Expand All @@ -226,7 +226,7 @@ void GFF4Dumper::dumpFieldSint(const GFF4Field &field) {

for (size_t i = 0; i < values.size(); i++) {
openFieldTag(field.type, false, !field.isList, field.label, field.isList, i);
_xml->setContents(Common::UString::format("%"PRId64, Cd64(values[i])));
_xml->setContents(Common::composeString(values[i]));
closeFieldTag();
}
}
Expand Down Expand Up @@ -275,7 +275,7 @@ void GFF4Dumper::dumpFieldTlk(const GFF4Field &field) {
openFieldTag(field.type, false, !field.isList, field.label, field.isList, i);

openFieldTag(Aurora::GFF4Struct::kIFieldTypeUint32, false, false, 0, false, 0);
_xml->setContents(Common::UString::format("%u", strRefs[i]));
_xml->setContents(Common::composeString(strRefs[i]));
closeFieldTag(false);

openFieldTag(Aurora::GFF4Struct::kIFieldTypeString, false, false, 0, false, 0);
Expand Down

0 comments on commit 041111f

Please sign in to comment.