t.
This commit is contained in:
parent
a55a44e9c1
commit
f5b075730d
|
@ -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 {
|
||||||
|
@ -49,8 +50,7 @@ pub const Client = struct {
|
||||||
try map.put("ClientVersion", .{ .string = "0.1 (quasselclient)" });
|
try map.put("ClientVersion", .{ .string = "0.1 (quasselclient)" });
|
||||||
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);
|
||||||
|
|
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue