ReadString
This function reads a null-terminated string from a stream.
Syntax
- std::string ReadString(int maxlength=0)
Parameters
- maxlength: the maximum length of the string to read.
Returns
Returns a string read from the stream.
Example
#include "Leadwerks.h"
using namespace Leadwerks;
int main(int argc, const char *argv[])
{
std::string path = "MyFile.dat";
Stream* stream = FileSystem::WriteFile(path);
if (stream==NULL) Debug::Error("Failed to write file.");
stream->WriteString("Hello!");
stream->Seek(0);
System::Print(stream->ReadString());
stream->Release();
return 0;
}