mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.7.3.1
This commit is contained in:
@@ -81,18 +81,18 @@ public class Xof_meta_mgr implements GfoInvkAble {
|
||||
static final String GRP_KEY = "xowa.file_regy.";
|
||||
private static Xof_meta_fil Get_fil_or_null_recur(Object[] ary, int depth_max, byte[] md5, int md5_idx) {
|
||||
int ary_idx = Int_.Xto_int_hex(md5[md5_idx]);
|
||||
if (ary_idx < 0 || ary_idx > 15) throw Exc_.new_("md5_not_valid", "md5", String_.new_u8(md5), "idx", md5_idx);
|
||||
if (ary_idx < 0 || ary_idx > 15) throw Err_.new_wo_type("md5_not_valid", "md5", String_.new_u8(md5), "idx", md5_idx);
|
||||
Object o = ary[ary_idx];
|
||||
if (o == null) return null;
|
||||
if (md5_idx == depth_max) { // leaf; return fil
|
||||
try {return (Xof_meta_fil)o;} catch (Exception exc) {throw Exc_.new_cast(exc, Xof_meta_fil.class, o);}
|
||||
try {return (Xof_meta_fil)o;} catch (Exception exc) {throw Err_.new_cast(exc, Xof_meta_fil.class, o);}
|
||||
}
|
||||
Object[] nxt = null; try {nxt = (Object[])o;} catch(Exception exc) {throw Exc_.new_cast(exc, Object[].class, o);}
|
||||
Object[] nxt = null; try {nxt = (Object[])o;} catch(Exception exc) {throw Err_.new_cast(exc, Object[].class, o);}
|
||||
return Get_fil_or_null_recur(nxt, depth_max, md5, md5_idx + 1);
|
||||
}
|
||||
private static Xof_meta_fil Bld_new(Object[] ary, int depth_max, Xof_meta_mgr regy_mgr, byte[] md5, int md5_idx) {
|
||||
int ary_idx = Int_.Xto_int_hex(md5[md5_idx]);
|
||||
if (ary_idx < 0 || ary_idx > 15) throw Exc_.new_("md5_not_valid", "md", String_.new_u8(md5), "idx", md5_idx);
|
||||
if (ary_idx < 0 || ary_idx > 15) throw Err_.new_wo_type("md5_not_valid", "md", String_.new_u8(md5), "idx", md5_idx);
|
||||
Object o = ary[ary_idx];
|
||||
if (md5_idx == depth_max) { // leaf; create itm
|
||||
Xof_meta_fil rv = null;
|
||||
|
||||
@@ -21,9 +21,9 @@ public class Xof_meta_thumb_parser extends Obj_ary_parser_base {
|
||||
Int_ary_parser int_ary_parser = new Int_ary_parser();
|
||||
public Xof_meta_thumb[] Ary() {return ary;} private Xof_meta_thumb[] ary = new Xof_meta_thumb[Ary_max]; static final int Ary_max = 16;
|
||||
public int Len() {return ary_idx;} private int ary_idx;
|
||||
public void Parse_ary(byte[] bry, int bgn, int end) {super.Parse_core(bry, bgn, end, Byte_ascii.Semic, Byte_ascii.Nil);}
|
||||
public void Parse_ary(byte[] bry, int bgn, int end) {super.Parse_core(bry, bgn, end, Byte_ascii.Semic, Byte_ascii.Null);}
|
||||
public Xof_meta_thumb Parse_one(byte[] bry, int bgn, int end) {
|
||||
super.Parse_core(bry, bgn, end, Byte_ascii.Semic, Byte_ascii.Nil);
|
||||
super.Parse_core(bry, bgn, end, Byte_ascii.Semic, Byte_ascii.Null);
|
||||
return ary[0];
|
||||
}
|
||||
public void Clear() {if (ary.length > Ary_max) ary = new Xof_meta_thumb[Ary_max];}
|
||||
@@ -33,16 +33,16 @@ public class Xof_meta_thumb_parser extends Obj_ary_parser_base {
|
||||
}
|
||||
@Override protected void Parse_itm(byte[] bry, int bgn, int end) { // EX: "1:45,40"; "1:45,40:3,4"
|
||||
Xof_meta_thumb itm = new Xof_meta_thumb(); boolean height_found = false;
|
||||
if (end - 2 < bgn) throw Exc_.new_("itm must be at least 2 bytes long", "itm", String_.new_u8(bry, bgn, end)); // EX: 4,6
|
||||
if (end - 2 < bgn) throw Err_.new_wo_type("itm must be at least 2 bytes long", "itm", String_.new_u8(bry, bgn, end)); // EX: 4,6
|
||||
int pos = bgn;
|
||||
byte exists_byte = bry[pos];
|
||||
switch (exists_byte) {
|
||||
case Byte_ascii.Num_0: itm.Exists_(Xof_meta_itm.Exists_n); break;
|
||||
case Byte_ascii.Num_1: itm.Exists_(Xof_meta_itm.Exists_y); break;
|
||||
case Byte_ascii.Num_2: itm.Exists_(Xof_meta_itm.Exists_unknown); break;
|
||||
default: throw Exc_.new_("exists must be 0,1,2", "exists", exists_byte, "itm", String_.new_u8(bry, bgn, end));
|
||||
default: throw Err_.new_wo_type("exists must be 0,1,2", "exists", exists_byte, "itm", String_.new_u8(bry, bgn, end));
|
||||
}
|
||||
if (bry[pos + 1] != Dlm_exists) throw Exc_.new_("question must follow exists", "bad_char", bry[pos + 1], "itm", String_.new_u8(bry, bgn, end));
|
||||
if (bry[pos + 1] != Dlm_exists) throw Err_.new_wo_type("question must follow exists", "bad_char", bry[pos + 1], "itm", String_.new_u8(bry, bgn, end));
|
||||
pos += 2;
|
||||
int num_bgn = pos;
|
||||
while (pos < end) {
|
||||
|
||||
Reference in New Issue
Block a user