mirror of
https://github.com/MeshEnvy/lobbs.git
synced 2026-10-31 10:21:59 +01:00
24 lines
488 B
C++
24 lines
488 B
C++
#include "serialize.h"
|
|
#include <cstddef>
|
|
|
|
#include "core/LoBBSStackGuard.h"
|
|
|
|
bool lobbsSerializeMachine(const LoBBSResponse &resp, std::string &out)
|
|
{
|
|
out.clear();
|
|
if (!resp.ok) {
|
|
out = resp.error;
|
|
return true;
|
|
}
|
|
for (const LoScalar &rec : resp.records) {
|
|
if (!out.empty())
|
|
out.push_back('\n');
|
|
std::string line;
|
|
if (!rec.encode(line, SIZE_MAX))
|
|
return false;
|
|
out += line;
|
|
}
|
|
return true;
|
|
}
|
|
|