summaryrefslogtreecommitdiff
path: root/Source/cmQtAutoGen.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmQtAutoGen.h')
-rw-r--r--Source/cmQtAutoGen.h31
1 files changed, 19 insertions, 12 deletions
diff --git a/Source/cmQtAutoGen.h b/Source/cmQtAutoGen.h
index 9c5212952..a740ba30a 100644
--- a/Source/cmQtAutoGen.h
+++ b/Source/cmQtAutoGen.h
@@ -5,17 +5,19 @@
#include "cmConfigure.h" // IWYU pragma: keep
-#include <memory> // IWYU pragma: keep
+#include <memory>
#include <string>
#include <vector>
+#include <cm/string_view>
+
/** \class cmQtAutoGen
* \brief Common base class for QtAutoGen classes
*/
class cmQtAutoGen
{
public:
- /// @brief Integer version
+ /** Integer version. */
struct IntegerVersion
{
unsigned int Major = 0;
@@ -41,6 +43,7 @@ public:
}
};
+ /** Compiler features. */
class CompilerFeatures
{
public:
@@ -48,9 +51,9 @@ public:
std::string HelpOutput;
std::vector<std::string> ListOptions;
};
- typedef std::shared_ptr<CompilerFeatures> CompilerFeaturesHandle;
+ using CompilerFeaturesHandle = std::shared_ptr<CompilerFeatures>;
- /// @brief AutoGen generator type
+ /** AutoGen generator type. */
enum class GenT
{
GEN, // AUTOGEN
@@ -59,31 +62,35 @@ public:
RCC // AUTORCC
};
- /// @brief Nested lists separator
- static std::string const ListSep;
/// @brief Maximum number of parallel threads/processes in a generator
static unsigned int const ParallelMax;
public:
/// @brief Returns the generator name
- static std::string const& GeneratorName(GenT genType);
+ static cm::string_view GeneratorName(GenT genType);
/// @brief Returns the generator name in upper case
- static std::string const& GeneratorNameUpper(GenT genType);
+ static cm::string_view GeneratorNameUpper(GenT genType);
/// @brief Returns a string with the requested tool names
static std::string Tools(bool moc, bool uic, bool rcc);
/// @brief Returns the string escaped and enclosed in quotes
- static std::string Quoted(std::string const& text);
+ static std::string Quoted(cm::string_view text);
static std::string QuotedCommand(std::vector<std::string> const& command);
+ /// @brief Returns the file name without path and extension (thread safe)
+ static std::string FileNameWithoutLastExtension(cm::string_view filename);
+
+ /// @brief Returns the parent directory of the file (thread safe)
+ static std::string ParentDir(cm::string_view filename);
+
/// @brief Returns the parent directory of the file with a "/" suffix
- static std::string SubDirPrefix(std::string const& filename);
+ static std::string SubDirPrefix(cm::string_view filename);
/// @brief Appends the suffix to the filename before the last dot
- static std::string AppendFilenameSuffix(std::string const& filename,
- std::string const& suffix);
+ static std::string AppendFilenameSuffix(cm::string_view filename,
+ cm::string_view suffix);
/// @brief Merges newOpts into baseOpts
static void UicMergeOptions(std::vector<std::string>& baseOpts,