summaryrefslogtreecommitdiff
path: root/src/option.cpp
diff options
context:
space:
mode:
authorJoel Bosveld <Joel.Bosveld@gmail.com>2009-02-26 20:35:26 +0900
committerDennis Kasprzyk <onestone@compiz-fusion.org>2009-02-27 14:55:58 +0100
commita94019f989004220a319c7c04429089f5c637f49 (patch)
tree4c84a834de99899f736acf5470b89d1cbeee2ca9 /src/option.cpp
parent07e6cee21b8236e8577666ea0f6363741d2d1ae3 (diff)
downloadzcomp-a94019f989004220a319c7c04429089f5c637f49.tar.gz
zcomp-a94019f989004220a319c7c04429089f5c637f49.tar.bz2
Add conversion operators to CompOption::Value
Diffstat (limited to 'src/option.cpp')
-rw-r--r--src/option.cpp50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/option.cpp b/src/option.cpp
index 66b76cb..c8fcd2f 100644
--- a/src/option.cpp
+++ b/src/option.cpp
@@ -250,6 +250,56 @@ CompOption::Value::list ()
return priv->list;
}
+CompOption::Value::operator bool ()
+{
+ return b();
+}
+
+CompOption::Value::operator int ()
+{
+ return i();
+}
+
+CompOption::Value::operator float()
+{
+ return f();
+}
+
+CompOption::Value::operator unsigned short * ()
+{
+ return c();
+}
+
+CompOption::Value::operator CompString ()
+{
+ return s();
+}
+
+CompOption::Value::operator CompMatch & ()
+{
+ return match();
+}
+
+CompOption::Value::operator CompAction & ()
+{
+ return action();
+}
+
+CompOption::Value::operator CompAction * ()
+{
+ return &action();
+}
+
+CompOption::Value::operator Type ()
+{
+ return listType();
+}
+
+CompOption::Value::operator Vector & ()
+{
+ return list();
+}
+
bool
CompOption::Value::operator== (const CompOption::Value &val)
{