diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2016-11-30 09:04:19 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2016-12-06 14:59:24 (GMT) |
commit | 8de8d3b191b020c499fdfdd8df237af95da946cd (patch) | |
tree | 42b238ccbb40261e4c133e28f354d7db434d9083 /Source/cmQtAutoGeneratorInitializer.cxx | |
parent | d0283dc1859d61dc2cbdec0c8ee0b00214976c06 (diff) | |
download | CMake-8de8d3b191b020c499fdfdd8df237af95da946cd.zip CMake-8de8d3b191b020c499fdfdd8df237af95da946cd.tar.gz CMake-8de8d3b191b020c499fdfdd8df237af95da946cd.tar.bz2 |
QtAutogen: Remove and inline ReadAll function
The function was only used once.
Diffstat (limited to 'Source/cmQtAutoGeneratorInitializer.cxx')
-rw-r--r-- | Source/cmQtAutoGeneratorInitializer.cxx | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx index fb94e90..fd7bb53 100644 --- a/Source/cmQtAutoGeneratorInitializer.cxx +++ b/Source/cmQtAutoGeneratorInitializer.cxx @@ -424,15 +424,6 @@ static std::string utilStripCR(std::string const& line) return line; } -static std::string ReadAll(const std::string& filename) -{ - cmsys::ifstream file(filename.c_str()); - std::ostringstream stream; - stream << file.rdbuf(); - file.close(); - return stream.str(); -} - /// @brief Reads the resource files list from from a .qrc file - Qt5 version /// @return True if the .qrc file was successfully parsed static bool ListQt5RccInputs(cmSourceFile* sf, cmGeneratorTarget const* target, @@ -524,7 +515,13 @@ static bool ListQt5RccInputs(cmSourceFile* sf, cmGeneratorTarget const* target, static bool ListQt4RccInputs(cmSourceFile* sf, std::vector<std::string>& depends) { - const std::string qrcContents = ReadAll(sf->GetFullPath()); + // Read file into string + std::string qrcContents; + { + std::ostringstream stream; + stream << cmsys::ifstream(sf->GetFullPath().c_str()).rdbuf(); + qrcContents = stream.str(); + } cmsys::RegularExpression fileMatchRegex("(<file[^<]+)"); |