summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2011-03-02 12:44:12 +0000
committerPierre Ossman <ossman@cendio.se>2011-03-02 12:44:12 +0000
commit660f1081d7cd1e4c763675ace8181ed34d377d34 (patch)
treed305b833ed82e417fdaeea3ad04fb3ae31f3a147 /common
parentabda06acb910a82c31c341a82b29db1864abbb9d (diff)
downloadtigervnc-660f1081d7cd1e4c763675ace8181ed34d377d34.tar.gz
tigervnc-660f1081d7cd1e4c763675ace8181ed34d377d34.zip
Make it easier to read string parameters by providing an implicit conversion
to const char*. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4307 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common')
-rw-r--r--common/rfb/Configuration.cxx4
-rw-r--r--common/rfb/Configuration.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/common/rfb/Configuration.cxx b/common/rfb/Configuration.cxx
index e9eee1a9..8137501f 100644
--- a/common/rfb/Configuration.cxx
+++ b/common/rfb/Configuration.cxx
@@ -444,6 +444,10 @@ char* StringParameter::getValueStr() const {
return strDup(value);
}
+StringParameter::operator const char *() const {
+ return value;
+}
+
// -=- BinaryParameter
BinaryParameter::BinaryParameter(const char* name_, const char* desc_,
diff --git a/common/rfb/Configuration.h b/common/rfb/Configuration.h
index 276651d5..35e31fc0 100644
--- a/common/rfb/Configuration.h
+++ b/common/rfb/Configuration.h
@@ -241,6 +241,7 @@ namespace rfb {
virtual char* getDefaultStr() const;
virtual char* getValueStr() const;
void setDefaultStr(const char* v);
+ operator const char*() const;
// getData() returns a copy of the data - it must be delete[]d by the
// caller.