forked from mirror/vulkan-zig
Xml parser
This commit is contained in:
@@ -1,10 +1,20 @@
|
||||
const std = @import("std");
|
||||
const xml = @import("xml.zig");
|
||||
|
||||
pub fn main() void {
|
||||
std.debug.warn("Test\n");
|
||||
pub fn main() !void {
|
||||
const file = try std.fs.cwd().openFileC(std.os.argv[1], .{});
|
||||
defer file.close();
|
||||
|
||||
const size = try file.seekableStream().stream.getEndPos();
|
||||
const source = try std.heap.page_allocator.alloc(u8, size);
|
||||
defer std.heap.page_allocator.free(source);
|
||||
|
||||
_ = try file.inStream().stream.read(source);
|
||||
|
||||
var doc = try xml.parse(std.heap.page_allocator, source);
|
||||
defer doc.deinit();
|
||||
}
|
||||
|
||||
test "main" {
|
||||
_ = @import("xml.zig");
|
||||
_ = @import("utf8.zig");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user