Skip to content

Commit

Permalink
Merge branch 'main' into cpp17
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Smith committed Dec 19, 2023
2 parents b2c0ead + d94dfb5 commit 553e326
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 17 deletions.
3 changes: 1 addition & 2 deletions six/modules/c++/cphd03/source/CPHDXMLControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -778,8 +778,7 @@ void CPHDXMLControl::fromXML(const xml::lite::Element* srpXML, SRP& srp)
#if ENFORCESPEC
srp.srpType = cphd::SRPType(getFirstAndOnly(srpXML, "SRPType")->getCharacterData());
#else
std::string s(getFirstAndOnly(srpXML, "SRPType")->getCharacterData());
str::upper(s);
const auto s = str::upper(getFirstAndOnly(srpXML, "SRPType")->getCharacterData());
srp.srpType = cphd::SRPType::toType(s);
#endif
parseInt(getFirstAndOnly(srpXML, "NumSRPs"), srp.numSRPs);
Expand Down
3 changes: 1 addition & 2 deletions six/modules/c++/samples/check_valid_six.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ static int main_(int argc, char** argv)
const std::string inputPath(options->get<std::string>("input"));
std::vector<std::string> inputPathnames = getPathnames(inputPath);
const std::string logFile(options->get<std::string>("log"));
std::string level(options->get<std::string>("level"));
auto level = str::upper(options->get<std::string>("level"));
std::vector<std::string> schemaPaths;
getSchemaPaths(*options, "--schema", "schema", schemaPaths);

Expand All @@ -200,7 +200,6 @@ static int main_(int argc, char** argv)
xmlRegistry.addCreator<six::sicd::ComplexXMLControl>();
xmlRegistry.addCreator<six::sidd::DerivedXMLControl>();

str::upper(level);
str::trim(level);
std::unique_ptr<logging::Logger> log =
logging::setupLogger(fs::path(argv[0]).filename().string(), level, logFile);
Expand Down
11 changes: 5 additions & 6 deletions six/modules/c++/six.sicd/source/Grid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,13 @@ DirectionParameters::calculateWeightFunction() const
return nullptr;
}

std::string windowName(weightType->windowName);
str::upper(windowName);
const std::string windowName(weightType->windowName);

if (windowName == "UNIFORM")
if (str::eq(windowName, "UNIFORM"))
{
return std::make_unique<Identity>();
}
if (windowName == "HAMMING")
if (str::eq(windowName, "HAMMING"))
{
double coef = 0.0;
if (weightType->parameters.empty() || weightType->parameters[0].str().empty())
Expand All @@ -156,11 +155,11 @@ DirectionParameters::calculateWeightFunction() const

return std::make_unique<RaisedCos>(coef);
}
if (windowName == "HANNING")
if (str::eq(windowName, "HANNING"))
{
return std::make_unique<RaisedCos>(0.50);
}
if (windowName == "KAISER")
if (str::eq(windowName, "KAISER"))
{
return std::make_unique<Kaiser>(double(weightType->parameters[0]));
}
Expand Down
6 changes: 2 additions & 4 deletions six/modules/c++/six.sicd/source/Utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,10 +717,8 @@ std::unique_ptr<ComplexData> Utilities::getComplexData(
const std::string& pathname,
const std::vector<std::string>& schemaPaths)
{
std::string extension = fs::path(pathname).extension().string();
str::lower(extension);

if (extension == ".xml")
const auto extension = fs::path(pathname).extension().string();
if (str::eq(extension, ".xml"))
{
logging::NullLogger log;
return parseDataFromFile(pathname, schemaPaths, log);
Expand Down
5 changes: 2 additions & 3 deletions six/modules/c++/six/source/Utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,9 @@ BooleanType six::toType<BooleanType>(const std::string& s)
{
std::string type(s);
str::trim(type);
str::lower(type);
if (type == "true" || type == "1" || type == "yes")
if (str::eq(type, "true") || type == "1" || str::eq(type, "yes"))
return BooleanType::IS_TRUE;
if (type == "false" || type == "0" || type == "no")
if (str::eq(type, "false") || type == "0" || str::eq(type, "no"))
return BooleanType::IS_FALSE;
return BooleanType::NOT_SET;
}
Expand Down

0 comments on commit 553e326

Please sign in to comment.