mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-03 21:00:01 -05:00
stringapi: Miscellaneous char* parameters
This commit is contained in:
+18
-18
@@ -225,35 +225,35 @@ private:
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void StartElement(const char* name, const char**)
|
||||
virtual void StartElement(const std::string& name, const char**)
|
||||
{
|
||||
this->CData.clear();
|
||||
if(strcmp(name, "log") == 0)
|
||||
if(name == "log")
|
||||
{
|
||||
this->Rev = Revision();
|
||||
this->Changes.clear();
|
||||
}
|
||||
// affected-files can contain blocks of
|
||||
// modified, unknown, renamed, kind-changed, removed, conflicts, added
|
||||
else if(strcmp(name, "modified") == 0
|
||||
|| strcmp(name, "renamed") == 0
|
||||
|| strcmp(name, "kind-changed") == 0)
|
||||
else if(name == "modified"
|
||||
|| name == "renamed"
|
||||
|| name == "kind-changed")
|
||||
{
|
||||
this->CurChange = Change();
|
||||
this->CurChange.Action = 'M';
|
||||
}
|
||||
else if(strcmp(name, "added") == 0)
|
||||
else if(name == "added")
|
||||
{
|
||||
this->CurChange = Change();
|
||||
this->CurChange = 'A';
|
||||
}
|
||||
else if(strcmp(name, "removed") == 0)
|
||||
else if(name == "removed")
|
||||
{
|
||||
this->CurChange = Change();
|
||||
this->CurChange = 'D';
|
||||
}
|
||||
else if(strcmp(name, "unknown") == 0
|
||||
|| strcmp(name, "conflicts") == 0)
|
||||
else if(name == "unknown"
|
||||
|| name == "conflicts")
|
||||
{
|
||||
// Should not happen here
|
||||
this->CurChange = Change();
|
||||
@@ -265,27 +265,27 @@ private:
|
||||
this->CData.insert(this->CData.end(), data, data+length);
|
||||
}
|
||||
|
||||
virtual void EndElement(const char* name)
|
||||
virtual void EndElement(const std::string& name)
|
||||
{
|
||||
if(strcmp(name, "log") == 0)
|
||||
if(name == "log")
|
||||
{
|
||||
this->BZR->DoRevision(this->Rev, this->Changes);
|
||||
}
|
||||
else if((strcmp(name, "file") == 0 || strcmp(name, "directory") == 0)
|
||||
&& !this->CData.empty())
|
||||
else if(!this->CData.empty() &&
|
||||
(name == "file" || name == "directory"))
|
||||
{
|
||||
this->CurChange.Path.assign(&this->CData[0], this->CData.size());
|
||||
cmSystemTools::ConvertToUnixSlashes(this->CurChange.Path);
|
||||
this->Changes.push_back(this->CurChange);
|
||||
}
|
||||
else if(strcmp(name, "symlink") == 0 && !this->CData.empty())
|
||||
else if(!this->CData.empty() && name == "symlink")
|
||||
{
|
||||
// symlinks have an arobase at the end in the log
|
||||
this->CurChange.Path.assign(&this->CData[0], this->CData.size()-1);
|
||||
cmSystemTools::ConvertToUnixSlashes(this->CurChange.Path);
|
||||
this->Changes.push_back(this->CurChange);
|
||||
}
|
||||
else if(strcmp(name, "committer") == 0 && !this->CData.empty())
|
||||
else if(!this->CData.empty() && name == "committer")
|
||||
{
|
||||
this->Rev.Author.assign(&this->CData[0], this->CData.size());
|
||||
if(this->EmailRegex.find(this->Rev.Author))
|
||||
@@ -294,15 +294,15 @@ private:
|
||||
this->Rev.EMail = this->EmailRegex.match(2);
|
||||
}
|
||||
}
|
||||
else if(strcmp(name, "timestamp") == 0 && !this->CData.empty())
|
||||
else if(!this->CData.empty() && name == "timestamp")
|
||||
{
|
||||
this->Rev.Date.assign(&this->CData[0], this->CData.size());
|
||||
}
|
||||
else if(strcmp(name, "message") == 0 && !this->CData.empty())
|
||||
else if(!this->CData.empty() && name == "message")
|
||||
{
|
||||
this->Rev.Log.assign(&this->CData[0], this->CData.size());
|
||||
}
|
||||
else if(strcmp(name, "revno") == 0 && !this->CData.empty())
|
||||
else if(!this->CData.empty() && name == "revno")
|
||||
{
|
||||
this->Rev.Rev.assign(&this->CData[0], this->CData.size());
|
||||
}
|
||||
|
||||
@@ -131,8 +131,8 @@ cmCTestGenericHandler* cmCTestBuildCommand::InitializeHandler()
|
||||
std::string buildCommand
|
||||
= this->GlobalGenerator->
|
||||
GenerateCMakeBuildCommand(cmakeBuildTarget ? cmakeBuildTarget : "",
|
||||
cmakeBuildConfiguration,
|
||||
cmakeBuildAdditionalFlags, true);
|
||||
cmakeBuildConfiguration,
|
||||
cmakeBuildAdditionalFlags ? cmakeBuildAdditionalFlags : "", true);
|
||||
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
|
||||
"SetMakeCommand:"
|
||||
<< buildCommand.c_str() << "\n");
|
||||
|
||||
+11
-11
@@ -189,10 +189,10 @@ private:
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void StartElement(const char* name, const char** atts)
|
||||
virtual void StartElement(const std::string& name, const char** atts)
|
||||
{
|
||||
this->CData.clear();
|
||||
if(strcmp(name, "logentry") == 0)
|
||||
if(name == "logentry")
|
||||
{
|
||||
this->Rev = Revision();
|
||||
if(const char* rev = this->FindAttribute(atts, "revision"))
|
||||
@@ -208,29 +208,29 @@ private:
|
||||
this->CData.insert(this->CData.end(), data, data+length);
|
||||
}
|
||||
|
||||
virtual void EndElement(const char* name)
|
||||
virtual void EndElement(const std::string& name)
|
||||
{
|
||||
if(strcmp(name, "logentry") == 0)
|
||||
if(name == "logentry")
|
||||
{
|
||||
this->HG->DoRevision(this->Rev, this->Changes);
|
||||
}
|
||||
else if(strcmp(name, "author") == 0 && !this->CData.empty())
|
||||
else if(!this->CData.empty() && name == "author")
|
||||
{
|
||||
this->Rev.Author.assign(&this->CData[0], this->CData.size());
|
||||
}
|
||||
else if ( strcmp(name, "email") == 0 && !this->CData.empty())
|
||||
else if(!this->CData.empty() && name == "email")
|
||||
{
|
||||
this->Rev.EMail.assign(&this->CData[0], this->CData.size());
|
||||
}
|
||||
else if(strcmp(name, "date") == 0 && !this->CData.empty())
|
||||
else if(!this->CData.empty() && name == "date")
|
||||
{
|
||||
this->Rev.Date.assign(&this->CData[0], this->CData.size());
|
||||
}
|
||||
else if(strcmp(name, "msg") == 0 && !this->CData.empty())
|
||||
else if(!this->CData.empty() && name == "msg")
|
||||
{
|
||||
this->Rev.Log.assign(&this->CData[0], this->CData.size());
|
||||
}
|
||||
else if(strcmp(name, "files") == 0 && !this->CData.empty())
|
||||
else if(!this->CData.empty() && name == "files")
|
||||
{
|
||||
std::vector<std::string> paths = this->SplitCData();
|
||||
for(unsigned int i = 0; i < paths.size(); ++i)
|
||||
@@ -242,7 +242,7 @@ private:
|
||||
this->Changes.push_back(this->CurChange);
|
||||
}
|
||||
}
|
||||
else if(strcmp(name, "file_adds") == 0 && !this->CData.empty())
|
||||
else if(!this->CData.empty() && name == "file_adds")
|
||||
{
|
||||
std::string added_paths(this->CData.begin(), this->CData.end());
|
||||
for(unsigned int i = 0; i < this->Changes.size(); ++i)
|
||||
@@ -253,7 +253,7 @@ private:
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(strcmp(name, "file_dels") == 0 && !this->CData.empty())
|
||||
else if(!this->CData.empty() && name == "file_dels")
|
||||
{
|
||||
std::string added_paths(this->CData.begin(), this->CData.end());
|
||||
for(unsigned int i = 0; i < this->Changes.size(); ++i)
|
||||
|
||||
@@ -49,21 +49,15 @@ class cmBoundsCheckerParser : public cmXMLParser
|
||||
{
|
||||
public:
|
||||
cmBoundsCheckerParser(cmCTest* c) { this->CTest = c;}
|
||||
void StartElement(const char* name, const char** atts)
|
||||
void StartElement(const std::string& name, const char** atts)
|
||||
{
|
||||
if(strcmp(name, "MemoryLeak") == 0)
|
||||
if(name == "MemoryLeak" ||
|
||||
name == "ResourceLeak")
|
||||
{
|
||||
this->Errors.push_back(cmCTestMemCheckHandler::MLK);
|
||||
}
|
||||
if(strcmp(name, "ResourceLeak") == 0)
|
||||
{
|
||||
this->Errors.push_back(cmCTestMemCheckHandler::MLK);
|
||||
}
|
||||
if(strcmp(name, "Error") == 0)
|
||||
{
|
||||
this->ParseError(atts);
|
||||
}
|
||||
if(strcmp(name, "Dangling Pointer") == 0)
|
||||
else if(name == "Error" ||
|
||||
name == "Dangling Pointer")
|
||||
{
|
||||
this->ParseError(atts);
|
||||
}
|
||||
@@ -79,7 +73,7 @@ public:
|
||||
ostr << "\n";
|
||||
this->Log += ostr.str();
|
||||
}
|
||||
void EndElement(const char* )
|
||||
void EndElement(const std::string& )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -361,10 +361,10 @@ private:
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void StartElement(const char* name, const char** atts)
|
||||
virtual void StartElement(const std::string& name, const char** atts)
|
||||
{
|
||||
this->CData.clear();
|
||||
if(strcmp(name, "logentry") == 0)
|
||||
if(name == "logentry")
|
||||
{
|
||||
this->Rev = Revision();
|
||||
this->Rev.SVNInfo = &SVNRepo;
|
||||
@@ -374,7 +374,7 @@ private:
|
||||
}
|
||||
this->Changes.clear();
|
||||
}
|
||||
else if(strcmp(name, "path") == 0)
|
||||
else if(name == "path")
|
||||
{
|
||||
this->CurChange = Change();
|
||||
if(const char* action = this->FindAttribute(atts, "action"))
|
||||
@@ -389,28 +389,28 @@ private:
|
||||
this->CData.insert(this->CData.end(), data, data+length);
|
||||
}
|
||||
|
||||
virtual void EndElement(const char* name)
|
||||
virtual void EndElement(const std::string& name)
|
||||
{
|
||||
if(strcmp(name, "logentry") == 0)
|
||||
if(name == "logentry")
|
||||
{
|
||||
this->SVN->DoRevisionSVN(this->Rev, this->Changes);
|
||||
}
|
||||
else if(strcmp(name, "path") == 0 && !this->CData.empty())
|
||||
else if(!this->CData.empty() && name == "path")
|
||||
{
|
||||
std::string orig_path(&this->CData[0], this->CData.size());
|
||||
std::string new_path = SVNRepo.BuildLocalPath( orig_path );
|
||||
this->CurChange.Path.assign(new_path);
|
||||
this->Changes.push_back(this->CurChange);
|
||||
}
|
||||
else if(strcmp(name, "author") == 0 && !this->CData.empty())
|
||||
else if(!this->CData.empty() && name == "author")
|
||||
{
|
||||
this->Rev.Author.assign(&this->CData[0], this->CData.size());
|
||||
}
|
||||
else if(strcmp(name, "date") == 0 && !this->CData.empty())
|
||||
else if(!this->CData.empty() && name == "date")
|
||||
{
|
||||
this->Rev.Date.assign(&this->CData[0], this->CData.size());
|
||||
}
|
||||
else if(strcmp(name, "msg") == 0 && !this->CData.empty())
|
||||
else if(!this->CData.empty() && name == "msg")
|
||||
{
|
||||
this->Rev.Log.assign(&this->CData[0], this->CData.size());
|
||||
}
|
||||
|
||||
@@ -68,10 +68,10 @@ private:
|
||||
return val;
|
||||
}
|
||||
|
||||
virtual void StartElement(const char* name, const char** atts)
|
||||
virtual void StartElement(const std::string& name, const char** atts)
|
||||
{
|
||||
this->CurrentValue.clear();
|
||||
if(strcmp(name, "cdash") == 0)
|
||||
if(name == "cdash")
|
||||
{
|
||||
this->CDashVersion = this->FindAttribute(atts, "version");
|
||||
}
|
||||
@@ -82,9 +82,9 @@ private:
|
||||
this->CurrentValue.insert(this->CurrentValue.end(), data, data+length);
|
||||
}
|
||||
|
||||
virtual void EndElement(const char* name)
|
||||
virtual void EndElement(const std::string& name)
|
||||
{
|
||||
if(strcmp(name, "status") == 0)
|
||||
if(name == "status")
|
||||
{
|
||||
std::string status = cmSystemTools::UpperCase(this->GetCurrentValue());
|
||||
if(status == "OK" || status == "SUCCESS")
|
||||
@@ -100,15 +100,15 @@ private:
|
||||
this->Status = STATUS_ERROR;
|
||||
}
|
||||
}
|
||||
else if(strcmp(name, "filename") == 0)
|
||||
else if(name == "filename")
|
||||
{
|
||||
this->Filename = this->GetCurrentValue();
|
||||
}
|
||||
else if(strcmp(name, "md5") == 0)
|
||||
else if(name == "md5")
|
||||
{
|
||||
this->MD5 = this->GetCurrentValue();
|
||||
}
|
||||
else if(strcmp(name, "message") == 0)
|
||||
else if(name == "message")
|
||||
{
|
||||
this->Message = this->GetCurrentValue();
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ public:
|
||||
|
||||
protected:
|
||||
|
||||
virtual void StartElement(const char* name, const char** atts)
|
||||
virtual void StartElement(const std::string& name, const char** atts)
|
||||
{
|
||||
if(strcmp(name, "class") == 0)
|
||||
if(name == "class")
|
||||
{
|
||||
int tagCount = 0;
|
||||
while(true)
|
||||
@@ -57,7 +57,7 @@ protected:
|
||||
++tagCount;
|
||||
}
|
||||
}
|
||||
else if(strcmp(name, "line") == 0)
|
||||
else if(name == "line")
|
||||
{
|
||||
int tagCount = 0;
|
||||
int curNumber = -1;
|
||||
@@ -85,7 +85,7 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void EndElement(const char*) {}
|
||||
virtual void EndElement(const std::string&) {}
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user