diff options
author | Brad King <brad.king@kitware.com> | 2009-02-05 21:31:37 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-02-05 21:31:37 (GMT) |
commit | dc13914cd698b49cbae491c1e1aebbcd44fbe932 (patch) | |
tree | 4eaa716c3e2160a7e81125360d83dc9f87241ede /Source/CTest/cmCTestMemCheckHandler.cxx | |
parent | f16a471576199ec275463e35ff17849350c0da79 (diff) | |
download | CMake-dc13914cd698b49cbae491c1e1aebbcd44fbe932.zip CMake-dc13914cd698b49cbae491c1e1aebbcd44fbe932.tar.gz CMake-dc13914cd698b49cbae491c1e1aebbcd44fbe932.tar.bz2 |
ENH: Create cmXMLSafe to help escapes in XML
This class provides easy syntax to efficiently insert blocks of data
into XML documents with proper escapes. It replaces the old
cmCTest::MakeXMLSafe and cmSystemTools::MakeXMLSafe methods which
allocated extra memory instead of directly streaming the data.
Diffstat (limited to 'Source/CTest/cmCTestMemCheckHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestMemCheckHandler.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx index 97a6ee0..12d178d 100644 --- a/Source/CTest/cmCTestMemCheckHandler.cxx +++ b/Source/CTest/cmCTestMemCheckHandler.cxx @@ -24,6 +24,7 @@ #include <cmsys/RegularExpression.hxx> #include <cmsys/Base64.h> #include "cmMakefile.h" +#include "cmXMLSafe.h" #include <stdlib.h> #include <math.h> @@ -77,8 +78,8 @@ public: int i = 0; for(; atts[i] != 0; i+=2) { - ostr << " " << this->CTest->MakeXMLSafe(atts[i]).c_str() - << " - " << this->CTest->MakeXMLSafe(atts[i+1]).c_str() << "\n"; + ostr << " " << cmXMLSafe(atts[i]) + << " - " << cmXMLSafe(atts[i+1]) << "\n"; } ostr << "\n"; this->Log += ostr.str(); @@ -313,7 +314,7 @@ void cmCTestMemCheckHandler::GenerateDartOutput(std::ostream& os) { cmCTestTestResult *result = &this->TestResults[cc]; std::string testPath = result->Path + "/" + result->Name; - os << "\t\t<Test>" << cmCTest::MakeXMLSafe( + os << "\t\t<Test>" << cmXMLSafe( this->CTest->GetShortPathToFile(testPath.c_str())) << "</Test>" << std::endl; } @@ -610,7 +611,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckPurifyOutput( results[failure] ++; defects ++; } - ostr << cmCTest::MakeXMLSafe(*i) << std::endl; + ostr << cmXMLSafe(*i) << std::endl; } log = ostr.str(); @@ -750,7 +751,7 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput( defects ++; } totalOutputSize += lines[cc].size(); - ostr << cmCTest::MakeXMLSafe(lines[cc]) << std::endl; + ostr << cmXMLSafe(lines[cc]) << std::endl; } else { @@ -767,9 +768,9 @@ bool cmCTestMemCheckHandler::ProcessMemCheckValgrindOutput( cmCTestLog(this->CTest, DEBUG, "before xml safe " << lines[*i] << std::endl); cmCTestLog(this->CTest, DEBUG, "after xml safe " - << cmCTest::MakeXMLSafe(lines[*i]) << std::endl); + << cmXMLSafe(lines[*i]) << std::endl); - ostr << cmCTest::MakeXMLSafe(lines[*i]) << std::endl; + ostr << cmXMLSafe(lines[*i]) << std::endl; if(!unlimitedOutput && totalOutputSize > static_cast<size_t>(this->CustomMaximumFailedTestOutputSize)) { |