diff --git a/repos/base/include/util/string.h b/repos/base/include/util/string.h
index 5eb4eb2162..8228e4ab25 100644
--- a/repos/base/include/util/string.h
+++ b/repos/base/include/util/string.h
@@ -18,12 +18,14 @@
#include
#include
#include
+#include
#include
namespace Genode {
class Number_of_bytes;
class Byte_range_ptr;
+ class Const_byte_range_ptr;
class Cstring;
template class String;
}
@@ -69,21 +71,37 @@ class Genode::Number_of_bytes
/**
- * Data structure for describing a byte buffer
+ * Data structure for describing a mutable byte buffer
*
* The type is intended to be used as 'Byte_range_ptr const &' argument.
- * It is deliberately non-copyable.
*/
-struct Genode::Byte_range_ptr
+struct Genode::Byte_range_ptr : Noncopyable
{
- char * const start;
- size_t const num_bytes;
+ struct {
+ char * const start;
+ size_t const num_bytes;
+ };
Byte_range_ptr(char *start, size_t num_bytes)
: start(start), num_bytes(num_bytes) { }
};
+/**
+ * Data structure for describing a constant byte buffer
+ */
+struct Genode::Const_byte_range_ptr : Noncopyable
+{
+ struct {
+ char const * const start;
+ size_t const num_bytes;
+ };
+
+ Const_byte_range_ptr(char const *start, size_t num_bytes)
+ : start(start), num_bytes(num_bytes) { }
+};
+
+
/***********************
** Utility functions **
***********************/