summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-01-25 13:40:15 (GMT)
committerBrad King <brad.king@kitware.com>2022-01-25 13:40:41 (GMT)
commit4959276c02ca5abf5775c608cc35dc8e09a8cc0a (patch)
tree8a3677eb45fa0d84171201e0d5350227cbf8e6ba /Source
parent03866411423c1b844580eb4879f378a592d73809 (diff)
downloadCMake-4959276c02ca5abf5775c608cc35dc8e09a8cc0a.zip
CMake-4959276c02ca5abf5775c608cc35dc8e09a8cc0a.tar.gz
CMake-4959276c02ca5abf5775c608cc35dc8e09a8cc0a.tar.bz2
cmListFileCache: Remove cmCommandContext
Subsume it inside `cmListFileFunction`.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmListFileCache.h43
1 files changed, 12 insertions, 31 deletions
diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h
index 1d45b30..5d45027 100644
--- a/Source/cmListFileCache.h
+++ b/Source/cmListFileCache.h
@@ -23,28 +23,6 @@
class cmMessenger;
-struct cmCommandContext
-{
- struct cmCommandName
- {
- std::string Original;
- std::string Lower;
- cmCommandName() = default;
- cmCommandName(std::string name)
- : Original(std::move(name))
- , Lower(cmSystemTools::LowerCase(this->Original))
- {
- }
- } Name;
- long Line = 0;
- cmCommandContext() = default;
- cmCommandContext(std::string name, long line)
- : Name(std::move(name))
- , Line(line)
- {
- }
-};
-
struct cmListFileArgument
{
enum Delimiter
@@ -82,12 +60,12 @@ public:
std::string const& OriginalName() const noexcept
{
- return this->Impl->Name.Original;
+ return this->Impl->OriginalName;
}
std::string const& LowerCaseName() const noexcept
{
- return this->Impl->Name.Lower;
+ return this->Impl->LowerCaseName;
}
long Line() const noexcept { return this->Impl->Line; }
@@ -97,17 +75,21 @@ public:
return this->Impl->Arguments;
}
- operator cmCommandContext const&() const noexcept { return *this->Impl; }
-
private:
- struct Implementation : public cmCommandContext
+ struct Implementation
{
Implementation(std::string name, long line,
std::vector<cmListFileArgument> args)
- : cmCommandContext{ std::move(name), line }
+ : OriginalName{ std::move(name) }
+ , LowerCaseName{ cmSystemTools::LowerCase(this->OriginalName) }
+ , Line{ line }
, Arguments{ std::move(args) }
{
}
+
+ std::string OriginalName;
+ std::string LowerCaseName;
+ long Line = 0;
std::vector<cmListFileArgument> Arguments;
};
@@ -147,11 +129,10 @@ public:
cmListFileFunction const& lff, std::string const& fileName,
cm::optional<std::string> deferId = {})
{
- cmCommandContext const& lfcc = lff;
cmListFileContext lfc;
lfc.FilePath = fileName;
- lfc.Line = lfcc.Line;
- lfc.Name = lfcc.Name.Original;
+ lfc.Line = lff.Line();
+ lfc.Name = lff.OriginalName();
lfc.DeferId = std::move(deferId);
return lfc;
}