summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-09-12 03:20:16 +0000
committerDavid Robillard <d@drobilla.net>2007-09-12 03:20:16 +0000
commitfda877003a1843ed53257f6e85123b0ef15b8f4f (patch)
tree0bbbd9124483185594969b6d507be351d5beffc6
parentb1d0c86db891dabb77fbc9655e7e5d5740ccf701 (diff)
downloadraul-fda877003a1843ed53257f6e85123b0ef15b8f4f.tar.gz
raul-fda877003a1843ed53257f6e85123b0ef15b8f4f.tar.bz2
raul-fda877003a1843ed53257f6e85123b0ef15b8f4f.zip
Const-correctness for Raul::RDF::Node type conversion functions.
git-svn-id: http://svn.drobilla.net/lad/raul@702 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--raul/RDFNode.hpp12
-rw-r--r--raul/Table.hpp2
-rw-r--r--src/RDFNode.cpp12
3 files changed, 13 insertions, 13 deletions
diff --git a/raul/RDFNode.hpp b/raul/RDFNode.hpp
index 13326f7..c0ed669 100644
--- a/raul/RDFNode.hpp
+++ b/raul/RDFNode.hpp
@@ -62,14 +62,14 @@ public:
std::string to_string() const;
std::string to_quoted_uri_string() const;
- bool is_int();
- int to_int();
+ bool is_int() const;
+ int to_int() const;
- bool is_float();
- float to_float();
+ bool is_float() const;
+ float to_float() const;
- bool is_bool();
- float to_bool();
+ bool is_bool() const;
+ float to_bool() const;
private:
librdf_node* _node;
diff --git a/raul/Table.hpp b/raul/Table.hpp
index 9fd672a..1d20a9c 100644
--- a/raul/Table.hpp
+++ b/raul/Table.hpp
@@ -29,7 +29,7 @@ namespace Raul {
/** Slow insertion, fast lookup, cache optimized, super fast sorted iteration.
*
* This has the advantage over std::map that iterating over the collection
- * is super fast, and iteration is sorted. Probably also faster due to all
+ * is fast and sorted. Possibly also faster in some situations due to all
* data being in a single chunk of memory, cache optimized, etc.
*/
template <typename K, typename T>
diff --git a/src/RDFNode.cpp b/src/RDFNode.cpp
index a4c672f..4140bcb 100644
--- a/src/RDFNode.cpp
+++ b/src/RDFNode.cpp
@@ -94,7 +94,7 @@ Node::to_quoted_uri_string() const
bool
-Node::is_int()
+Node::is_int() const
{
if (_node && librdf_node_get_type(_node) == LIBRDF_NODE_TYPE_LITERAL) {
librdf_uri* datatype_uri = librdf_node_get_literal_value_datatype_uri(_node);
@@ -107,7 +107,7 @@ Node::is_int()
int
-Node::to_int()
+Node::to_int() const
{
assert(is_int());
return strtol((const char*)librdf_node_get_literal_value(_node), NULL, 10);
@@ -115,7 +115,7 @@ Node::to_int()
bool
-Node::is_float()
+Node::is_float() const
{
if (_node && librdf_node_get_type(_node) == LIBRDF_NODE_TYPE_LITERAL) {
librdf_uri* datatype_uri = librdf_node_get_literal_value_datatype_uri(_node);
@@ -128,14 +128,14 @@ Node::is_float()
float
-Node::to_float()
+Node::to_float() const
{
assert(is_float());
return strtod((const char*)librdf_node_get_literal_value(_node), NULL);
}
bool
-Node::is_bool()
+Node::is_bool() const
{
if (_node && librdf_node_get_type(_node) == LIBRDF_NODE_TYPE_LITERAL) {
librdf_uri* datatype_uri = librdf_node_get_literal_value_datatype_uri(_node);
@@ -148,7 +148,7 @@ Node::is_bool()
float
-Node::to_bool()
+Node::to_bool() const
{
assert(is_bool());
if (!strcmp((const char*)librdf_node_get_literal_value(_node), "true"))