From 041111f58b9d9cff4540a3477a62e5941b7fc60e Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Thu, 2 Jul 2015 14:26:21 +0200 Subject: [PATCH] GFF2XML: Use Common::composeString() in GFF3Dumper/GFF4Dumper --- src/xml/gff3dumper.cpp | 12 ++++++------ src/xml/gff4dumper.cpp | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/xml/gff3dumper.cpp b/src/xml/gff3dumper.cpp index dc5c26d3..e4726c82 100644 --- a/src/xml/gff3dumper.cpp +++ b/src/xml/gff3dumper.cpp @@ -86,7 +86,7 @@ void GFF3Dumper::dumpLocString(const Aurora::LocString &locString) { for (std::vector::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(); @@ -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; @@ -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: @@ -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); } @@ -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) diff --git a/src/xml/gff4dumper.cpp b/src/xml/gff4dumper.cpp index f36ce2ec..4527db39 100644 --- a/src/xml/gff4dumper.cpp +++ b/src/xml/gff4dumper.cpp @@ -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); @@ -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())) { @@ -184,7 +184,7 @@ 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()) @@ -192,7 +192,7 @@ void GFF4Dumper::openFieldTag(uint32 type, bool typeList, bool hasLabel, uint32 } if (hasIndex) - _xml->addProperty("index", Common::UString::format("%u", index)); + _xml->addProperty("index", Common::composeString(index)); } void GFF4Dumper::closeFieldTag(bool doBreak) { @@ -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(); } } @@ -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(); } } @@ -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);