]> source.dussan.org Git - tigervnc.git/commitdiff
Make it easier to read string parameters by providing an implicit conversion
authorPierre Ossman <ossman@cendio.se>
Wed, 2 Mar 2011 12:44:12 +0000 (12:44 +0000)
committerPierre Ossman <ossman@cendio.se>
Wed, 2 Mar 2011 12:44:12 +0000 (12:44 +0000)
to const char*.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4307 3789f03b-4d11-0410-bbf8-ca57d06f2519

common/rfb/Configuration.cxx
common/rfb/Configuration.h

index e9eee1a9ed866170cec5de468af9f29bf00db986..8137501f8811f82fbf1f440f234baca050003128 100644 (file)
@@ -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_,
index 276651d5a79062aa4cc4fc6c231432698c0f068f..35e31fc020813bb7942f9ffba8cac5c4f252478a 100644 (file)
@@ -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.