summaryrefslogtreecommitdiffstats
path: root/Source/CursesDialog
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CursesDialog')
-rw-r--r--Source/CursesDialog/cmCursesCacheEntryComposite.cxx14
-rw-r--r--Source/CursesDialog/cmCursesCacheEntryComposite.h5
-rw-r--r--Source/CursesDialog/cmCursesLabelWidget.cxx2
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx10
-rw-r--r--Source/CursesDialog/cmCursesMainForm.h2
-rw-r--r--Source/CursesDialog/cmCursesOptionsWidget.cxx7
-rw-r--r--Source/CursesDialog/cmCursesOptionsWidget.h2
-rw-r--r--Source/CursesDialog/cmCursesPathWidget.cxx6
-rw-r--r--Source/CursesDialog/cmCursesStringWidget.cxx2
-rw-r--r--Source/CursesDialog/cmCursesStringWidget.h2
-rw-r--r--Source/CursesDialog/cmCursesWidget.cxx4
-rw-r--r--Source/CursesDialog/cmCursesWidget.h2
12 files changed, 30 insertions, 28 deletions
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
index 249137f..682f95f 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
@@ -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)
{
@@ -50,7 +51,7 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
{
case cmCacheManager::BOOL:
this->Entry = new cmCursesBoolWidget(this->EntryWidth, 1, 1, 1);
- if (cmSystemTools::IsOn(it.GetValue()))
+ if (cmSystemTools::IsOn(it.GetValue().c_str()))
{
static_cast<cmCursesBoolWidget*>(this->Entry)->SetValueAsBool(true);
}
@@ -93,7 +94,8 @@ cmCursesCacheEntryComposite::cmCursesCacheEntryComposite(
}
break;
case cmCacheManager::UNINITIALIZED:
- cmSystemTools::Error("Found an undefined variable: ", it.GetName());
+ cmSystemTools::Error("Found an undefined variable: ",
+ it.GetName().c_str());
break;
default:
// TODO : put warning message here
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h
index 1357a02..98107cc 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.h
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h
@@ -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();
diff --git a/Source/CursesDialog/cmCursesLabelWidget.cxx b/Source/CursesDialog/cmCursesLabelWidget.cxx
index b5ed312..b50eb64 100644
--- a/Source/CursesDialog/cmCursesLabelWidget.cxx
+++ b/Source/CursesDialog/cmCursesLabelWidget.cxx
@@ -19,7 +19,7 @@ cmCursesLabelWidget::cmCursesLabelWidget(int width, int height,
field_opts_off(this->Field, O_EDIT);
field_opts_off(this->Field, O_ACTIVE);
field_opts_off(this->Field, O_STATIC);
- this->SetValue(name.c_str());
+ this->SetValue(name);
}
cmCursesLabelWidget::~cmCursesLabelWidget()
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index d94cd37..0734927 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -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 )
diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h
index 883a2b3..fba9bc5 100644
--- a/Source/CursesDialog/cmCursesMainForm.h
+++ b/Source/CursesDialog/cmCursesMainForm.h
@@ -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,
diff --git a/Source/CursesDialog/cmCursesOptionsWidget.cxx b/Source/CursesDialog/cmCursesOptionsWidget.cxx
index 652b2df..2f4b59e 100644
--- a/Source/CursesDialog/cmCursesOptionsWidget.cxx
+++ b/Source/CursesDialog/cmCursesOptionsWidget.cxx
@@ -59,7 +59,6 @@ bool cmCursesOptionsWidget::HandleInput(int& key, cmCursesMainForm*, WINDOW* w)
{
return false;
}
- return false;
}
void cmCursesOptionsWidget::AddOption(std::string const & option )
@@ -74,7 +73,7 @@ void cmCursesOptionsWidget::NextOption()
{
this->CurrentOption = 0;
}
- this->SetValue(this->Options[this->CurrentOption].c_str());
+ this->SetValue(this->Options[this->CurrentOption]);
}
void cmCursesOptionsWidget::PreviousOption()
{
@@ -86,10 +85,10 @@ void cmCursesOptionsWidget::PreviousOption()
{
this->CurrentOption--;
}
- this->SetValue(this->Options[this->CurrentOption].c_str());
+ this->SetValue(this->Options[this->CurrentOption]);
}
-void cmCursesOptionsWidget::SetOption(const char* value)
+void cmCursesOptionsWidget::SetOption(const std::string& value)
{
this->CurrentOption = 0; // default to 0 index
this->SetValue(value);
diff --git a/Source/CursesDialog/cmCursesOptionsWidget.h b/Source/CursesDialog/cmCursesOptionsWidget.h
index b52ac9d..5cee489 100644
--- a/Source/CursesDialog/cmCursesOptionsWidget.h
+++ b/Source/CursesDialog/cmCursesOptionsWidget.h
@@ -25,7 +25,7 @@ public:
// when this widget has focus. Returns true if the input was
// handled.
virtual bool HandleInput(int& key, cmCursesMainForm* fm, WINDOW* w);
- void SetOption(const char*);
+ void SetOption(const std::string&);
void AddOption(std::string const &);
void NextOption();
void PreviousOption();
diff --git a/Source/CursesDialog/cmCursesPathWidget.cxx b/Source/CursesDialog/cmCursesPathWidget.cxx
index 14c325b..cd93bc3 100644
--- a/Source/CursesDialog/cmCursesPathWidget.cxx
+++ b/Source/CursesDialog/cmCursesPathWidget.cxx
@@ -57,9 +57,9 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w)
{
glob = cstr + "*";
}
- std::vector<cmStdString> dirs;
+ std::vector<std::string> dirs;
- cmSystemTools::SimpleGlob(glob.c_str(), dirs, (this->Type == cmCacheManager::PATH?-1:0));
+ cmSystemTools::SimpleGlob(glob, dirs, (this->Type == cmCacheManager::PATH?-1:0));
if ( this->CurrentIndex < dirs.size() )
{
cstr = dirs[this->CurrentIndex];
@@ -74,7 +74,7 @@ void cmCursesPathWidget::OnTab(cmCursesMainForm* fm, WINDOW* w)
cstr += "/";
}
- this->SetString(cstr.c_str());
+ this->SetString(cstr);
touchwin(w);
wrefresh(w);
form_driver(form, REQ_END_FIELD);
diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx
index bd1ff71..d25022d 100644
--- a/Source/CursesDialog/cmCursesStringWidget.cxx
+++ b/Source/CursesDialog/cmCursesStringWidget.cxx
@@ -195,7 +195,7 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
return true;
}
-void cmCursesStringWidget::SetString(const char* value)
+void cmCursesStringWidget::SetString(const std::string& value)
{
this->SetValue(value);
}
diff --git a/Source/CursesDialog/cmCursesStringWidget.h b/Source/CursesDialog/cmCursesStringWidget.h
index e939049..dd8c02a 100644
--- a/Source/CursesDialog/cmCursesStringWidget.h
+++ b/Source/CursesDialog/cmCursesStringWidget.h
@@ -37,7 +37,7 @@ public:
/**
* Set/Get the string.
*/
- void SetString(const char* value);
+ void SetString(const std::string& value);
const char* GetString();
virtual const char* GetValue();
diff --git a/Source/CursesDialog/cmCursesWidget.cxx b/Source/CursesDialog/cmCursesWidget.cxx
index 5dffcaa..e5363f4 100644
--- a/Source/CursesDialog/cmCursesWidget.cxx
+++ b/Source/CursesDialog/cmCursesWidget.cxx
@@ -46,10 +46,10 @@ void cmCursesWidget::Move(int x, int y, bool isNewPage)
}
}
-void cmCursesWidget::SetValue(const char* value)
+void cmCursesWidget::SetValue(const std::string& value)
{
this->Value = value;
- set_field_buffer(this->Field, 0, value);
+ set_field_buffer(this->Field, 0, value.c_str());
}
const char* cmCursesWidget::GetValue()
diff --git a/Source/CursesDialog/cmCursesWidget.h b/Source/CursesDialog/cmCursesWidget.h
index 952c67a..d91a0cb 100644
--- a/Source/CursesDialog/cmCursesWidget.h
+++ b/Source/CursesDialog/cmCursesWidget.h
@@ -40,7 +40,7 @@ public:
* Set/Get the value (setting the value also changes the contents
* of the field buffer).
*/
- virtual void SetValue(const char* value);
+ virtual void SetValue(const std::string& value);
virtual const char* GetValue();
/**