diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-04-05 19:10:53 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-04-06 14:17:19 (GMT) |
commit | 7cbde5c503f15bcc568a64239977b8e1f6f501cb (patch) | |
tree | 6078c007e8ec354c204ee43882f22e720f23adeb /Source/cmQtAutoGen.h | |
parent | 7a5adae94dc8ca38fb2323742c6e4164682a876f (diff) | |
download | CMake-7cbde5c503f15bcc568a64239977b8e1f6f501cb.zip CMake-7cbde5c503f15bcc568a64239977b8e1f6f501cb.tar.gz CMake-7cbde5c503f15bcc568a64239977b8e1f6f501cb.tar.bz2 |
AutoRcc: Add cmQtAutoGen::RccLister class
The new `cmQtAutoGen::RccLister` class provides a simple interface to
list files in a `.qrc` resources file by either calling `rcc` with
list options or by parsing the resources file content.
Diffstat (limited to 'Source/cmQtAutoGen.h')
-rw-r--r-- | Source/cmQtAutoGen.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Source/cmQtAutoGen.h b/Source/cmQtAutoGen.h index d127a71..0faf6b3 100644 --- a/Source/cmQtAutoGen.h +++ b/Source/cmQtAutoGen.h @@ -100,6 +100,45 @@ public: /// @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 + */ + class RccLister + { + public: + RccLister(); + RccLister(std::string rccExecutable, std::vector<std::string> listOptions); + + //! The rcc executable + std::string const& RccExcutable() const { return RccExcutable_; } + void SetRccExecutable(std::string const& rccExecutable) + { + RccExcutable_ = rccExecutable; + } + + //! The rcc executable list options + std::vector<std::string> const& ListOptions() const + { + return ListOptions_; + } + void SetListOptions(std::vector<std::string> const& listOptions) + { + ListOptions_ = listOptions; + } + + /** + * @brief Lists a files in the qrcFile + * @arg files The file names are appended to this list + * @arg error contains the error message when the function fails + */ + bool list(std::string const& qrcFile, std::vector<std::string>& files, + std::string& error, bool verbose = false) const; + + private: + std::string RccExcutable_; + std::vector<std::string> ListOptions_; + }; }; #endif |