Skip to content

Commit

Permalink
reduce use of str::toString() in favor of std::to_string()
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Smith committed Nov 13, 2023
1 parent dc435f5 commit 0ffa372
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
4 changes: 2 additions & 2 deletions six/modules/c++/six.sidd/source/DerivedXMLParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ XMLElem DerivedXMLParser::createFootprint(const std::string& name,
XMLElem footprint = newElement(name, getDefaultURI(), parent);
xml::lite::AttributeNode node;
node.setQName("size");
node.setValue(str::toString(LatLonCorners::NUM_CORNERS));
node.setValue(std::to_string(LatLonCorners::NUM_CORNERS));

footprint->getAttributes().add(node);

Expand All @@ -1200,7 +1200,7 @@ XMLElem DerivedXMLParser::createFootprint(const std::string& name,

for (size_t corner = 0; corner < LatLonCorners::NUM_CORNERS; ++corner)
{
node.setValue(str::toString(corner + 1));
node.setValue(std::to_string(corner + 1));
common().createLatLon(cornerName,
corners.getCorner(corner),
footprint)->getAttributes().add(node);
Expand Down
3 changes: 1 addition & 2 deletions six/modules/c++/six/source/XMLControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,7 @@ std::string XMLControl::dataTypeToString(DataType dataType, bool appendXML)
str = "SIDD";
break;
default:
throw except::Exception(
Ctxt("Invalid data type " + str::toString(dataType)));
throw except::Exception(Ctxt("Invalid data type " + str::toString(dataType)));
}

if (appendXML)
Expand Down
9 changes: 2 additions & 7 deletions six/projects/csm/source/SIDDSensorModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,8 @@ void SIDDSensorModel::initializeFromISD(const csm::Nitf21Isd& isd,
if (siddXML == nullptr)
{
const std::string message = (numSIDD == 0) ? "Not a SIDD" :
"Found " + str::toString(numSIDD) +
" SIDD XMLs but requested image index " +
str::toString(imageIndex);

throw csm::Error(csm::Error::SENSOR_MODEL_NOT_CONSTRUCTIBLE,
message,
"SIDDSensorModel::SIDDSensorModel");
"Found " + std::to_string(numSIDD) + " SIDD XMLs but requested image index " + std::to_string(imageIndex);
throw csm::Error(csm::Error::SENSOR_MODEL_NOT_CONSTRUCTIBLE, message, "SIDDSensorModel::SIDDSensorModel");
}

// get xml as string for sensor model state
Expand Down
8 changes: 2 additions & 6 deletions six/projects/csm/source/SIXPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ std::string SIXPlugin::getModelName(size_t modelIndex) const
case SIDD_MODEL_INDEX:
return SIDDSensorModel::NAME;
default:
throw csm::Error(csm::Error::INDEX_OUT_OF_RANGE,
"Model index is " + str::toString(modelIndex),
"SIXPlugin::getModelName");
throw csm::Error(csm::Error::INDEX_OUT_OF_RANGE, "Model index is " + std::to_string(modelIndex), "SIXPlugin::getModelName");
}
}

Expand All @@ -98,9 +96,7 @@ std::string SIXPlugin::getModelFamily(size_t modelIndex) const
case SIDD_MODEL_INDEX:
return SIDDSensorModel::FAMILY;
default:
throw csm::Error(csm::Error::INDEX_OUT_OF_RANGE,
"Model index is " + str::toString(modelIndex),
"SIXPlugin::getModelFamily");
throw csm::Error(csm::Error::INDEX_OUT_OF_RANGE, "Model index is " + std::to_string(modelIndex), "SIXPlugin::getModelFamily");
}
}

Expand Down

0 comments on commit 0ffa372

Please sign in to comment.