mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-04 05:10:10 -05:00
AutoRcc: Make rcc parsing function private
The `.qrc` parsing functions in `cmQtAutoGen` are no longer needed outside the private implementation of `cmQtAutoGen::RccLister`. This makes them private, too.
This commit is contained in:
+9
-15
@@ -240,8 +240,8 @@ void cmQtAutoGen::RccMergeOptions(std::vector<std::string>& baseOpts,
|
||||
MergeOptions(baseOpts, newOpts, valueOpts, isQt5);
|
||||
}
|
||||
|
||||
void cmQtAutoGen::RccListParseContent(std::string const& content,
|
||||
std::vector<std::string>& files)
|
||||
static void RccListParseContent(std::string const& content,
|
||||
std::vector<std::string>& files)
|
||||
{
|
||||
cmsys::RegularExpression fileMatchRegex("(<file[^<]+)");
|
||||
cmsys::RegularExpression fileReplaceRegex("(^<file[^>]*>)");
|
||||
@@ -258,10 +258,10 @@ void cmQtAutoGen::RccListParseContent(std::string const& content,
|
||||
}
|
||||
}
|
||||
|
||||
bool cmQtAutoGen::RccListParseOutput(std::string const& rccStdOut,
|
||||
std::string const& rccStdErr,
|
||||
std::vector<std::string>& files,
|
||||
std::string& error)
|
||||
static bool RccListParseOutput(std::string const& rccStdOut,
|
||||
std::string const& rccStdErr,
|
||||
std::vector<std::string>& files,
|
||||
std::string& error)
|
||||
{
|
||||
// Lambda to strip CR characters
|
||||
auto StripCR = [](std::string& line) {
|
||||
@@ -308,14 +308,6 @@ bool cmQtAutoGen::RccListParseOutput(std::string const& rccStdOut,
|
||||
return true;
|
||||
}
|
||||
|
||||
void cmQtAutoGen::RccListConvertFullPath(std::string const& qrcFileDir,
|
||||
std::vector<std::string>& files)
|
||||
{
|
||||
for (std::string& entry : files) {
|
||||
entry = cmSystemTools::CollapseFullPath(entry, qrcFileDir);
|
||||
}
|
||||
}
|
||||
|
||||
cmQtAutoGen::RccLister::RccLister() = default;
|
||||
|
||||
cmQtAutoGen::RccLister::RccLister(std::string rccExecutable,
|
||||
@@ -412,6 +404,8 @@ bool cmQtAutoGen::RccLister::list(std::string const& qrcFile,
|
||||
}
|
||||
|
||||
// Convert relative paths to absolute paths
|
||||
RccListConvertFullPath(fileDir, files);
|
||||
for (std::string& entry : files) {
|
||||
entry = cmSystemTools::CollapseFullPath(entry, fileDir);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -85,22 +85,6 @@ public:
|
||||
std::vector<std::string> const& newOpts,
|
||||
bool isQt5);
|
||||
|
||||
/// @brief Parses the content of a qrc file
|
||||
///
|
||||
/// Use when rcc does not support the "--list" option
|
||||
static void RccListParseContent(std::string const& content,
|
||||
std::vector<std::string>& files);
|
||||
|
||||
/// @brief Parses the output of the "rcc --list ..." command
|
||||
static bool RccListParseOutput(std::string const& rccStdOut,
|
||||
std::string const& rccStdErr,
|
||||
std::vector<std::string>& files,
|
||||
std::string& error);
|
||||
|
||||
/// @brief Converts relative qrc entry paths to full paths
|
||||
static void RccListConvertFullPath(std::string const& qrcFileDir,
|
||||
std::vector<std::string>& files);
|
||||
|
||||
/** @class RccLister
|
||||
* @brief Lists files in qrc resource files
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user