summaryrefslogtreecommitdiffstats
path: root/raul/Atom.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-13 16:04:14 +0000
committerDavid Robillard <d@drobilla.net>2009-05-13 16:04:14 +0000
commitc0d0364c030688aa8bfe4ad8dcaa2cffed8c0d04 (patch)
treec559879d17437adfb1aae4fb5fb40bbe6ac2f983 /raul/Atom.hpp
parentf60b59b49df6bc298755d49e97bc329b6d6030a1 (diff)
downloadraul-c0d0364c030688aa8bfe4ad8dcaa2cffed8c0d04.tar.gz
raul-c0d0364c030688aa8bfe4ad8dcaa2cffed8c0d04.tar.bz2
raul-c0d0364c030688aa8bfe4ad8dcaa2cffed8c0d04.zip
Strip trailing whitespace.
git-svn-id: http://svn.drobilla.net/lad/trunk/raul@1999 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'raul/Atom.hpp')
-rw-r--r--raul/Atom.hpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/raul/Atom.hpp b/raul/Atom.hpp
index 44b4b0c..e6c8ce6 100644
--- a/raul/Atom.hpp
+++ b/raul/Atom.hpp
@@ -1,15 +1,15 @@
/* This file is part of Raul.
* Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *
+ *
* Raul is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
- *
+ *
* Raul is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
- *
+ *
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
@@ -51,9 +51,9 @@ public:
Atom(float val) : _type(FLOAT), _float_val(val) {}
Atom(bool val) : _type(BOOL), _bool_val(val) {}
Atom(const char* val) : _type(STRING), _string_val(strdup(val)) {}
-
+
Atom(Type t, const std::string& val) : _type(t), _string_val(strdup(val.c_str())) {}
-
+
Atom(const char* type_uri, size_t size, void* val) : _type(BLOB) {
_blob_type_length = strlen(type_uri) + 1; // + 1 for \0
_blob_size = size;
@@ -86,7 +86,7 @@ public:
break;
}
}
-
+
Atom& operator=(const Atom& other) {
if (_type == BLOB)
free(_blob_val);
@@ -127,7 +127,7 @@ public:
}
inline bool operator!=(const Atom& other) const { return ! operator==(other); }
-
+
inline bool operator<(const Atom& other) const {
if (_type == other.type()) {
switch (_type) {
@@ -155,7 +155,7 @@ public:
}
return 0;
}
-
+
inline bool is_valid() const { return (_type != NIL); }
/** Type of this atom. Always check this before attempting to get the
@@ -168,13 +168,13 @@ public:
inline bool get_bool() const { assert(_type == BOOL); return _bool_val; }
inline const char* get_string() const { assert(_type == STRING); return _string_val; }
inline const char* get_uri() const { assert(_type == URI); return _string_val; }
-
+
inline const char* get_blob_type() const { assert(_type == BLOB); return (const char*)_blob_val; }
inline const void* get_blob() const { assert(_type == BLOB); return (const char*)_blob_val + _blob_type_length; }
private:
Type _type;
-
+
union {
int32_t _int_val;
float _float_val;