vfs: add 'with_xml_file_content()' and 'with_raw_file_content()'

Fixes #4372
This commit is contained in:
Christian Prochaska
2022-01-14 10:49:32 +01:00
committed by Christian Helmuth
parent 8fd2847a48
commit 8ced0f184e
2 changed files with 81 additions and 16 deletions

View File

@ -23,6 +23,7 @@
namespace Genode {
class Number_of_bytes;
class Byte_range_ptr;
class Cstring;
template <Genode::size_t> class String;
}
@ -67,6 +68,22 @@ class Genode::Number_of_bytes
};
/**
* Data structure for describing a 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
{
char * const start;
size_t const num_bytes;
Byte_range_ptr(char *start, size_t num_bytes)
: start(start), num_bytes(num_bytes) { }
};
/***********************
** Utility functions **
***********************/