Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Core/Generators/CPlusPlus/CPlusPlusGenerator.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -455,8 +455,8 @@ public override ValueTask<Artifact[]> Compile(BebopSchema schema, GeneratorConfi
builder.AppendLine(" return after - before;");
builder.AppendLine(" }");
builder.AppendLine("");
builder.AppendLine($" size_t encodeInto(std::vector<uint8_t>& targetBuffer) {{ return {td.Name}::encodeInto(*this, targetBuffer); }}");
builder.AppendLine($" size_t encodeInto(::bebop::Writer& writer) {{ return {td.Name}::encodeInto(*this, writer); }}");
builder.AppendLine($" size_t encodeInto(std::vector<uint8_t>& targetBuffer) const {{ return {td.Name}::encodeInto(*this, targetBuffer); }}");
builder.AppendLine($" size_t encodeInto(::bebop::Writer& writer) const {{ return {td.Name}::encodeInto(*this, writer); }}");
builder.AppendLine("");
builder.AppendLine($" static {td.Name} decode(const uint8_t* sourceBuffer, size_t sourceBufferSize) {{");
builder.AppendLine($" {td.Name} result;");
Expand Down Expand Up @@ -485,6 +485,7 @@ public override ValueTask<Artifact[]> Compile(BebopSchema schema, GeneratorConfi
builder.AppendLine("");
builder.AppendLine($" static size_t decodeInto(::bebop::Reader& reader, {td.Name}& target) {{");
builder.Append(CompileDecode(td));
builder.AppendLine("");
builder.AppendLine(" return reader.bytesRead();");
builder.AppendLine(" }");
builder.AppendLine("");
Expand Down
Loading