mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
stringapi: Use strings for variable names
Variable names are always generated by CMake and should never be NULL.
This commit is contained in:
@@ -19,9 +19,10 @@
|
||||
#include "cmCursesDummyWidget.h"
|
||||
#include "../cmSystemTools.h"
|
||||
|
||||
cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(const char* key,
|
||||
int labelwidth,
|
||||
int entrywidth) :
|
||||
cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
|
||||
const std::string& key,
|
||||
int labelwidth,
|
||||
int entrywidth) :
|
||||
Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth)
|
||||
{
|
||||
this->Label = new cmCursesLabelWidget(this->LabelWidth, 1, 1, 1, key);
|
||||
@@ -31,7 +32,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(const char* key,
|
||||
}
|
||||
|
||||
cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
|
||||
const char* key, const cmCacheManager::CacheIterator& it, bool isNew,
|
||||
const std::string& key, const cmCacheManager::CacheIterator& it, bool isNew,
|
||||
int labelwidth, int entrywidth)
|
||||
: Key(key), LabelWidth(labelwidth), EntryWidth(entrywidth)
|
||||
{
|
||||
|
||||
@@ -18,8 +18,9 @@
|
||||
class cmCursesCacheEntryComposite
|
||||
{
|
||||
public:
|
||||
cmCursesCacheEntryComposite(const char* key, int labelwidth, int entrywidth);
|
||||
cmCursesCacheEntryComposite(const char* key,
|
||||
cmCursesCacheEntryComposite(const std::string& key, int labelwidth,
|
||||
int entrywidth);
|
||||
cmCursesCacheEntryComposite(const std::string& key,
|
||||
const cmCacheManager::CacheIterator& it,
|
||||
bool isNew, int labelwidth, int entrywidth);
|
||||
~cmCursesCacheEntryComposite();
|
||||
|
||||
@@ -84,9 +84,9 @@ cmCursesMainForm::~cmCursesMainForm()
|
||||
}
|
||||
|
||||
// See if a cache entry is in the list of entries in the ui.
|
||||
bool cmCursesMainForm::LookForCacheEntry(const char* key)
|
||||
bool cmCursesMainForm::LookForCacheEntry(const std::string& key)
|
||||
{
|
||||
if (!key || !this->Entries)
|
||||
if (!this->Entries)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -94,7 +94,7 @@ bool cmCursesMainForm::LookForCacheEntry(const char* key)
|
||||
std::vector<cmCursesCacheEntryComposite*>::iterator it;
|
||||
for (it = this->Entries->begin(); it != this->Entries->end(); ++it)
|
||||
{
|
||||
if (!strcmp(key, (*it)->Key.c_str()))
|
||||
if (key == (*it)->Key)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -146,7 +146,7 @@ void cmCursesMainForm::InitializeUI()
|
||||
this->CMakeInstance->GetCacheManager()->NewIterator();
|
||||
!i.IsAtEnd(); i.Next())
|
||||
{
|
||||
const char* key = i.GetName();
|
||||
std::string key = i.GetName();
|
||||
if ( i.GetType() == cmCacheManager::INTERNAL ||
|
||||
i.GetType() == cmCacheManager::STATIC ||
|
||||
i.GetType() == cmCacheManager::UNINITIALIZED )
|
||||
@@ -168,7 +168,7 @@ void cmCursesMainForm::InitializeUI()
|
||||
this->CMakeInstance->GetCacheManager()->NewIterator();
|
||||
!i.IsAtEnd(); i.Next())
|
||||
{
|
||||
const char* key = i.GetName();
|
||||
std::string key = i.GetName();
|
||||
if ( i.GetType() == cmCacheManager::INTERNAL ||
|
||||
i.GetType() == cmCacheManager::STATIC ||
|
||||
i.GetType() == cmCacheManager::UNINITIALIZED )
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
* Returns true if an entry with the given key is in the
|
||||
* list of current composites.
|
||||
*/
|
||||
bool LookForCacheEntry(const char* key);
|
||||
bool LookForCacheEntry(const std::string& key);
|
||||
|
||||
enum {
|
||||
MIN_WIDTH = 65,
|
||||
|
||||
Reference in New Issue
Block a user