Index: src/FileSystemJsObject.cpp |
=================================================================== |
--- a/src/FileSystemJsObject.cpp |
+++ b/src/FileSystemJsObject.cpp |
@@ -56,18 +56,18 @@ |
} |
void Run() |
{ |
std::string content; |
std::string error; |
try |
{ |
- std::shared_ptr<std::istream> stream = fileSystem->Read(path); |
- content = Utils::Slurp(*stream); |
+ auto buffer = fileSystem->Read(path); |
+ content = std::string(buffer.cbegin(), buffer.cend()); |
} |
catch (std::exception& e) |
{ |
error = e.what(); |
} |
catch (...) |
{ |
error = "Unknown error while reading from " + path; |
@@ -95,19 +95,18 @@ |
{ |
} |
void Run() |
{ |
std::string error; |
try |
{ |
- std::stringstream stream; |
- stream << content; |
- fileSystem->Write(path, stream); |
+ FileSystem::IOBuffer buffer(content.cbegin(), content.cend()); |
+ fileSystem->Write(path, buffer); |
} |
catch (std::exception& e) |
{ |
error = e.what(); |
} |
catch (...) |
{ |
error = "Unknown error while writing to " + path; |