fmt code.
This commit is contained in:
parent
1ec3cfb28f
commit
67c9353455
|
@ -6,7 +6,6 @@ const prettyPrintQVariant = @import("./qtshit/utils/prettyPrintQVariant.zig").pr
|
|||
const freeQVariant = @import("./qtshit/utils/free/freeQVariant.zig").freeQVariant;
|
||||
const QVariantMapToQVariantList = @import("./qtshit/utils/QVariantMapToQVariantList.zig").QVariantMapToQVariantList;
|
||||
|
||||
|
||||
fn dumpDebug(name: []const u8, list: std.ArrayList(u8)) !void {
|
||||
std.debug.print("dumpDebug list len {d}\n", .{list.items.len});
|
||||
|
||||
|
|
|
@ -26,7 +26,18 @@ pub fn readString(reader: anytype, allocator: *std.mem.Allocator) (@TypeOf(reade
|
|||
}
|
||||
|
||||
test "deserialize String" {
|
||||
var bytes = &[_]u8{ 0, 0, 0, 6, 0, 111, 0, 119, 0, 111, };
|
||||
var bytes = &[_]u8{
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
6,
|
||||
0,
|
||||
111,
|
||||
0,
|
||||
119,
|
||||
0,
|
||||
111,
|
||||
};
|
||||
var fBS = std.io.fixedBufferStream(bytes);
|
||||
|
||||
var str = try readString(fBS.reader(), std.testing.allocator);
|
||||
|
@ -34,4 +45,3 @@ test "deserialize String" {
|
|||
|
||||
try std.testing.expectEqualStrings("owo", str);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,6 @@ const readQVariantMap = @import("../readQVariantMap.zig").readQVariantMap;
|
|||
const readBufferInfo = @import("./readBufferInfo.zig").readBufferInfo;
|
||||
const readMessage = @import("./readMessage.zig").readMessage;
|
||||
|
||||
|
||||
pub fn readUserType(reader: anytype, allocator: *std.mem.Allocator) !UserType {
|
||||
var userTypeName = try readQByteArray(reader, allocator);
|
||||
userTypeName = userTypeName[0 .. userTypeName.len - 1];
|
||||
|
|
|
@ -7,7 +7,6 @@ const freeQByteArray = @import("./freeQByteArray.zig").freeQByteArray;
|
|||
const freeString = @import("./freeString.zig").freeString;
|
||||
const freeUserType = @import("./freeUserType.zig").freeUserType;
|
||||
|
||||
|
||||
pub fn freeQVariant(variant: QVariant, allocator: *std.mem.Allocator) void {
|
||||
switch (variant) {
|
||||
.Byte, .Int, .UInt, .Short, .QDateTime => {
|
||||
|
|
|
@ -4,7 +4,6 @@ const writeString = @import("./writeString.zig").writeString;
|
|||
const writeUInt = @import("./writeUInt.zig").writeUInt;
|
||||
const writeQVariant = @import("./writeQVariant.zig").writeQVariant;
|
||||
|
||||
|
||||
pub fn writeQVariantMap(writer: anytype, allocator: *std.mem.Allocator, map: std.StringHashMap(QVariantType)) !void {
|
||||
var data = std.ArrayList(u8).init(allocator);
|
||||
defer data.deinit();
|
||||
|
|
Loading…
Reference in a new issue