1 /**
2     INP2 Format
3 
4     Copyright: 
5         Copyright © 2020-2026, Inochi2D Project
6     
7     License:
8         $(LINK2 https://github.com/Inochi2D/inochi2d/blob/main/LICENSE, BSD 2-clause License)
9     
10     Authors:
11         Luna Nielsen
12 */
13 module inp.format.inp2;
14 
15 public import inp.format.inp2.reader;
16 public import inp.format.inp2.writer;
17 
18 /**
19     Magic bytes for INP 2 (Trans Rights 2: Electric Boogaloo)
20 */
21 enum char[8] INP2_MAGIC = "TRNSRTS2";
22 
23 /**
24     Mask used to get the tag portion of a tag.
25 */
26 enum uint INP2_TAG_MASK         = 0x000000FF;
27 
28 /**
29     Mask used to get the metadata portion of a tag.
30 */
31 enum uint INP2_META_MASK        = 0xFFFFFF00;
32 
33 /**
34     INP2 DataNode Tag specifying a key for a key-value pair.
35 
36     Notes:
37         Keys can maximum be 255 UTF8 characters.
38 */
39 enum uint INP2_TAG_KEY          = 0xF0;
40 
41 /**
42     INP2 DataNode Tag specifying a nil value.
43     Readers should just skip these.
44 */
45 enum uint INP2_TAG_NIL          = 0x00;
46 
47 /**
48     INP2 DataNode Tag for boolean values (padded to 32 bits)
49 */
50 enum uint INP2_TAG_BOOL         = 0x01;
51 
52 /**
53     INP2 DataNode Tag for 32-bit integers
54 */
55 enum uint INP2_TAG_INT          = 0x02;
56 
57 /**
58     INP2 DataNode Tag for 32-bit unsigned integers
59 */
60 enum uint INP2_TAG_UINT         = 0x03;
61 
62 /**
63     INP2 DataNode Tag for 32-bit floats
64 */
65 enum uint INP2_TAG_FLOAT        = 0x04;
66 
67 /**
68     INP2 DataNode Tag for UTF8 Strings
69 */
70 enum uint INP2_TAG_STRING       = 0x05;
71 
72 /**
73     INP2 DataNode Tag for data blobs
74 */
75 enum uint INP2_TAG_BLOB         = 0x06;
76 
77 /**
78     INP2 DataNode Tag for an array beginning.
79 
80     Note:
81         Uses Metadata
82 */
83 enum uint INP2_TAG_ARRAY_BEGIN  = 0x10;
84 
85 /**
86     INP2 DataNode Tag for an array ending.
87 */
88 enum uint INP2_TAG_ARRAY_END    = 0x11;
89 
90 /**
91     INP2 DataNode Tag for an object beginning.
92 
93     Note:
94         Uses Metadata
95 */
96 enum uint INP2_TAG_OBJECT_BEGIN = 0x12;
97 
98 /**
99     INP2 DataNode Tag for an object ending.
100 */
101 enum uint INP2_TAG_OBJECT_END   = 0x13;