From fda877003a1843ed53257f6e85123b0ef15b8f4f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 12 Sep 2007 03:20:16 +0000 Subject: Const-correctness for Raul::RDF::Node type conversion functions. git-svn-id: http://svn.drobilla.net/lad/raul@702 a436a847-0d15-0410-975c-d299462d15a1 --- raul/RDFNode.hpp | 12 ++++++------ raul/Table.hpp | 2 +- src/RDFNode.cpp | 12 ++++++------ 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 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")) -- cgit v1.2.1