From: Pierre Ossman Date: Wed, 2 Mar 2011 12:44:12 +0000 (+0000) Subject: Make it easier to read string parameters by providing an implicit conversion X-Git-Tag: v1.1.90~443 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=660f1081d7cd1e4c763675ace8181ed34d377d34;p=tigervnc.git 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 --- 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.