I have a COW database that uses mmap and the String type seems to either allocate or move when I would like to just have a const pointer/len to memory itself. Is there anything in NTL that can do this?
How about Upp::MemReadStream? If I understand you correctly, this seems to be what you need.
Best regards,
Oblivion
Nice. How would that work though for deserialization without copy?
I try:
#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN {
const char *test = "this is a test";
MemReadStream ms(test, strlen(test));
String test2;
ms % test2;
Cout() << test2;
}
And the result is empty. GetLine returns a new String, Put(Cout()) is also empty.