Some data struct now use file instead of = struct {
This commit is contained in:
parent
78213df3ff
commit
ee9d5c92f2
@ -2,7 +2,8 @@ const std = @import("std");
|
||||
const UUID = @import("dtype").UUID;
|
||||
const ArenaAllocator = std.heap.ArenaAllocator;
|
||||
|
||||
pub const UUIDIndexMap = struct {
|
||||
pub const UUIDIndexMap = @This();
|
||||
|
||||
arena: *ArenaAllocator,
|
||||
map: *std.AutoHashMap(UUID, usize),
|
||||
|
||||
@ -44,7 +45,6 @@ pub const UUIDIndexMap = struct {
|
||||
pub fn get(self: UUIDIndexMap, uuid: UUID) ?usize {
|
||||
return self.map.get(uuid);
|
||||
}
|
||||
};
|
||||
|
||||
test "Create empty UUIDIndexMap" {
|
||||
const allocator = std.testing.allocator;
|
||||
|
@ -9,7 +9,8 @@ const DataType = dtype.DataType;
|
||||
const ZipponError = @import("errors.zig").ZipponError;
|
||||
|
||||
/// This is the [] part
|
||||
pub const AdditionalData = struct {
|
||||
pub const AdditionalData = @This();
|
||||
|
||||
allocator: Allocator,
|
||||
limit: usize = 0,
|
||||
childrens: std.ArrayList(AdditionalDataMember),
|
||||
@ -31,7 +32,6 @@ pub const AdditionalData = struct {
|
||||
pub fn addMember(self: *AdditionalData, name: []const u8, index: usize) ZipponError!void {
|
||||
self.childrens.append(AdditionalDataMember.init(self.allocator, name, index)) catch return ZipponError.MemoryError;
|
||||
}
|
||||
};
|
||||
|
||||
// This is name in: [name]
|
||||
// There is an additional data because it can be [friend [1; name]]
|
||||
|
@ -28,7 +28,7 @@ pub const JsonString = struct {
|
||||
init: bool = false,
|
||||
};
|
||||
|
||||
pub const RelationMap = struct {
|
||||
pub const RelationMap = @This();
|
||||
struct_name: []const u8,
|
||||
member_name: []const u8,
|
||||
additional_data: AdditionalData,
|
||||
@ -72,4 +72,3 @@ pub const RelationMap = struct {
|
||||
}
|
||||
return start;
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user