aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nimpb/nimpb.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nimpb/nimpb.nim b/src/nimpb/nimpb.nim
index 909486d..982b682 100644
--- a/src/nimpb/nimpb.nim
+++ b/src/nimpb/nimpb.nim
@@ -529,3 +529,7 @@ proc excl*(s: var IntSet, values: openArray[int]) =
## Exclude multiple values from an IntSet.
for value in values:
excl(s, value)
+
+proc readLengthDelimited*(stream: ProtobufStream): string =
+ let size = int(readVarint(stream))
+ result = safeReadStr(stream, size)