THRIFT-5923: UUID python
Client: py
Patch: CJCombrink
This closes #3330
diff --git a/lib/py/src/ext/binary.h b/lib/py/src/ext/binary.h
index 960b0d0..dd7750b 100644
--- a/lib/py/src/ext/binary.h
+++ b/lib/py/src/ext/binary.h
@@ -88,6 +88,10 @@
return encodeValue(value, parsedspec.type, parsedspec.typeargs);
}
+ void writeUuid(char* value) {
+ writeBuffer(value, 16);
+ }
+
void writeFieldStop() { writeByte(static_cast<uint8_t>(T_STOP)); }
bool readBool(bool& val) {
@@ -159,6 +163,13 @@
return len;
}
+ int32_t readUuid(char** buf) {
+ if (!readBytes(buf, 16)) {
+ return -1;
+ }
+ return 16;
+ }
+
int32_t readListBegin(TType& etype) {
int32_t len;
uint8_t b = 0;
@@ -206,6 +217,7 @@
}
SKIPBYTES(len);
}
+ bool skipUuid() { SKIPBYTES(16); }
#undef SKIPBYTES
private: