This commit is contained in:
Kitteh 2021-06-02 12:43:48 +01:00
parent a55a44e9c1
commit f5b075730d
2 changed files with 5 additions and 5 deletions

View file

@ -4,14 +4,15 @@ const write = @import("./qtshit/write.zig");
const qvar = @import("./qtshit/qvariant.zig"); const qvar = @import("./qtshit/qvariant.zig");
fn dumpDebug(name: []const u8, list: std.ArrayList(u8)) !void { fn dumpDebug(name: []const u8, list: std.ArrayList(u8)) !void {
std.debug.print("dumpDebug list len {d}\n", .{list.items.len});
const file = try std.fs.cwd().createFile( const file = try std.fs.cwd().createFile(
name, name,
.{ .read = true }, .{ .read = !true },
); );
defer file.close(); defer file.close();
try file.writeAll(list.items); try file.writeAll(list.items);
try file.seekTo(0);
} }
pub const Client = struct { pub const Client = struct {
@ -50,7 +51,6 @@ pub const Client = struct {
try map.put("ClientDate", .{ .string = "0" }); try map.put("ClientDate", .{ .string = "0" });
try write.add_qvariantmap(list.writer(), map); try write.add_qvariantmap(list.writer(), map);
try dumpDebug("ClientInit.bin", list); try dumpDebug("ClientInit.bin", list);
try s.stream.writer().writeAll(list.items); try s.stream.writer().writeAll(list.items);

View file

@ -66,7 +66,7 @@ pub fn add_qvariant(writer: anytype, variant: qvar.QVariant) !void {
} }
} }
pub fn add_qvariantmap(writer: anytype, map: std.StringHashMap(qvar.QVariant)) !void { pub fn add_qvariantmap(writer: anytype, map: std.StringHashMap(qvar.QVariant)) @TypeOf(writer).Error!void {
var size: u32 = 0; var size: u32 = 0;
var iterator = map.iterator(); var iterator = map.iterator();