Commit 8573e20c authored by Sebastian Holtermann's avatar Sebastian Holtermann
Browse files

cmOutputConverter: Let GetFortranFormat accept a cm::string_view

parent 49117623
...@@ -150,13 +150,11 @@ std::string cmOutputConverter::EscapeWindowsShellArgument(const char* arg, ...@@ -150,13 +150,11 @@ std::string cmOutputConverter::EscapeWindowsShellArgument(const char* arg,
} }
cmOutputConverter::FortranFormat cmOutputConverter::GetFortranFormat( cmOutputConverter::FortranFormat cmOutputConverter::GetFortranFormat(
const char* value) cm::string_view value)
{ {
FortranFormat format = FortranFormatNone; FortranFormat format = FortranFormatNone;
if (value && *value) { if (!value.empty()) {
std::vector<std::string> fmt; for (std::string const& fi : cmSystemTools::ExpandedListArgument(value)) {
cmSystemTools::ExpandListArgument(value, fmt);
for (std::string const& fi : fmt) {
if (fi == "FIXED") { if (fi == "FIXED") {
format = FortranFormatFixed; format = FortranFormatFixed;
} }
...@@ -168,6 +166,15 @@ cmOutputConverter::FortranFormat cmOutputConverter::GetFortranFormat( ...@@ -168,6 +166,15 @@ cmOutputConverter::FortranFormat cmOutputConverter::GetFortranFormat(
return format; return format;
} }
cmOutputConverter::FortranFormat cmOutputConverter::GetFortranFormat(
const char* value)
{
if (!value) {
return FortranFormatNone;
}
return GetFortranFormat(cm::string_view(value));
}
void cmOutputConverter::SetLinkScriptShell(bool linkScriptShell) void cmOutputConverter::SetLinkScriptShell(bool linkScriptShell)
{ {
this->LinkScriptShell = linkScriptShell; this->LinkScriptShell = linkScriptShell;
......
...@@ -89,6 +89,7 @@ public: ...@@ -89,6 +89,7 @@ public:
FortranFormatFixed, FortranFormatFixed,
FortranFormatFree FortranFormatFree
}; };
static FortranFormat GetFortranFormat(cm::string_view value);
static FortranFormat GetFortranFormat(const char* value); static FortranFormat GetFortranFormat(const char* value);
private: private:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment