1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

'v3.6.3.1'

This commit is contained in:
gnosygnu
2016-06-19 23:58:10 -04:00
parent 96636f3161
commit d4e8590345
1960 changed files with 20790 additions and 9272 deletions

View File

@@ -51,7 +51,7 @@ public class Gfh_nde {
return null;
}
byte[] Atrs_vals_by_pos(byte[] src, int quote_byte, int bgn, int end) {
Bry_bfr tmp_bfr = Bry_bfr.new_();
Bry_bfr tmp_bfr = Bry_bfr_.New();
boolean dirty = false;
for (int i = bgn; i < end; i++) {
byte b = src[i];

View File

@@ -29,7 +29,7 @@ public class Gfh_parser {
public Gfh_nde[] Parse_as_ary(byte[] src, int bgn, int end) {return Parse_as_ary(src, bgn, end, Wildcard, Wildcard);}
public Gfh_nde[] Parse_as_ary(byte[] src, int bgn, int end, byte[] find_key, byte[] find_val) { // flattens html into a list of hndes; only used for Options
this.src = src; pos = bgn; this.end = end;
List_adp rv = List_adp_.new_();
List_adp rv = List_adp_.New();
while (pos < end) {
byte b = src[pos++];
switch (b) {
@@ -159,7 +159,7 @@ public class Gfh_parser {
}
return Scan_invalid;
}
private static final byte Scan_invalid = 0, Scan_valid = 1, Scan_stop = 2;
public static final byte[] Wildcard = null;
public static final String Wildcard_str = null;
private static final byte Scan_invalid = 0, Scan_valid = 1, Scan_stop = 2;
public static final byte[] Wildcard = null;
public static final String Wildcard_str = null;
}

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.langs.htmls; import gplx.*; import gplx.langs.*;
public class Gfh_selecter {
public static Gfh_nde[] Select(byte[] src, Gfh_nde[] ary, Hash_adp_bry hash) {
List_adp list = List_adp_.new_();
List_adp list = List_adp_.New();
int xndes_len = ary.length;
for (int i = 0; i < xndes_len; i++) {
Gfh_nde hnde = ary[i];

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.langs.htmls; import gplx.*; import gplx.langs.*;
import gplx.core.primitives.*; import gplx.core.btries.*; import gplx.langs.htmls.encoders.*;
public class Gfh_utl {
private static final Gfo_url_encoder encoder_id = Gfo_url_encoder_.Id; private static final Bry_bfr tmp_bfr = Bry_bfr.reset_(255);
private static final Gfo_url_encoder encoder_id = Gfo_url_encoder_.Id; private static final Bry_bfr tmp_bfr = Bry_bfr_.Reset(255);
public static String Encode_id_as_str(byte[] key) {return String_.new_u8(Encode_id_as_bry(key));}
public static byte[] Encode_id_as_bry(byte[] key) {
byte[] escaped = Escape_html_as_bry(tmp_bfr, key, Bool_.N, Bool_.N, Bool_.N, Bool_.Y, Bool_.Y);
@@ -102,7 +102,7 @@ public class Gfh_utl {
else
return dirty ? bfr.To_bry_and_clear() : bry;
}
private static final Btrie_slim_mgr unescape_trie = Btrie_slim_mgr.ci_a7()
private static final Btrie_slim_mgr unescape_trie = Btrie_slim_mgr.ci_a7()
.Add_bry_byte(Gfh_entity_.Lt_bry , Byte_ascii.Lt)
.Add_bry_byte(Gfh_entity_.Gt_bry , Byte_ascii.Gt)
.Add_bry_byte(Gfh_entity_.Amp_bry , Byte_ascii.Amp)
@@ -110,7 +110,7 @@ public class Gfh_utl {
.Add_bry_byte(Gfh_entity_.Apos_num_bry , Byte_ascii.Apos)
;
public static String Unescape_as_str(String src) {
Bry_bfr bfr = Bry_bfr.reset_(255);
Bry_bfr bfr = Bry_bfr_.Reset(255);
byte[] bry = Bry_.new_u8(src);
Unescape(Bool_.Y, bfr, bry, 0, bry.length, Bool_.Y, Bool_.Y, Bool_.Y, Bool_.Y, Bool_.Y);
return bfr.To_str_and_clear();
@@ -178,7 +178,7 @@ public class Gfh_utl {
}
public static String Replace_apos(String s) {return String_.Replace(s, "'", "\"");}
public static String Replace_apos_concat_lines(String... lines) {
Bry_bfr bfr = Bry_bfr.new_();
Bry_bfr bfr = Bry_bfr_.New();
int len = lines.length;
for (int i = 0; i < len; ++i) {
String line_str = lines[i];

View File

@@ -38,7 +38,7 @@ public class Gfh_utl_tst {
}
}
class Gfh_class_fxt {
private Bry_bfr tmp_bfr = Bry_bfr.reset_(255);
private Bry_bfr tmp_bfr = Bry_bfr_.Reset(255);
public void Clear() {
tmp_bfr.Clear();
}

View File

@@ -17,8 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.langs.htmls; import gplx.*; import gplx.langs.*;
public class Gfh_wtr {
private Bry_bfr bfr = Bry_bfr.reset_(255);
private List_adp nde_stack = List_adp_.new_();
private Bry_bfr bfr = Bry_bfr_.Reset(255);
private List_adp nde_stack = List_adp_.New();
public byte Atr_quote() {return atr_quote;} public Gfh_wtr Atr_quote_(byte v) {atr_quote = v; return this;} private byte atr_quote = Byte_ascii.Quote;
public Gfh_wtr Nde_full_atrs(byte[] tag, byte[] text, boolean text_escape, byte[]... atrs) {
Nde_bgn(tag);

View File

@@ -18,12 +18,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.langs.htmls.clses; import gplx.*; import gplx.langs.*; import gplx.langs.htmls.*;
import org.junit.*;
public class Gfh_class_parser__tst {
private final Gfh_class_parser__fxt fxt = new Gfh_class_parser__fxt();
private final Gfh_class_parser__fxt fxt = new Gfh_class_parser__fxt();
@Test public void Basic() {fxt.Test__parse("v1" , "v1");}
@Test public void Many() {fxt.Test__parse("v1 v2" , "v1", "v2");}
}
class Gfh_class_parser__fxt {
private final Gfh_class_wkr__list wkr = new Gfh_class_wkr__list();
private final Gfh_class_wkr__list wkr = new Gfh_class_wkr__list();
public void Test__parse(String src_str, String... expd) {
byte[] src_bry = Bry_.new_u8(src_str);
String[] actl = wkr.Parse(src_bry, 0, src_bry.length);
@@ -31,7 +31,7 @@ class Gfh_class_parser__fxt {
}
}
class Gfh_class_wkr__list implements Gfh_class_parser_wkr {
private final List_adp list = List_adp_.new_();
private final List_adp list = List_adp_.New();
public boolean On_cls(byte[] src, int atr_idx, int atr_bgn, int atr_end, int val_bgn, int val_end) {
String s = String_.new_u8(src, val_bgn, val_end);
list.Add(s); //

View File

@@ -78,7 +78,7 @@ public class Gfh_tag implements Mwh_atr_wkr {
byte rv = Gfh_class_.Find_1st(src, cls_atr.Val_bgn(), cls_atr.Val_end(), hash); if (rv == Byte_.Max_value_127) return or;
return rv;
}
private static final Gfh_style_wkr__val_as_int style_wkr = new Gfh_style_wkr__val_as_int();
private static final Gfh_style_wkr__val_as_int style_wkr = new Gfh_style_wkr__val_as_int();
public int Atrs__style_get_as_int(byte[] key) {
if (atrs_null) Atrs__make();
Gfh_atr rv = (Gfh_atr)atrs_hash.Get_by(Gfh_atr_.Bry__style); if (rv == null) return -1;
@@ -117,7 +117,7 @@ public class Gfh_tag implements Mwh_atr_wkr {
}
public String Atrs__print() {
if (atrs_null) Atrs__make();
Bry_bfr bfr = Bry_bfr.new_();
Bry_bfr bfr = Bry_bfr_.New();
int len = atrs_hash.Count();
for (int i = 0; i < len; ++i) {
Gfh_atr atr = (Gfh_atr)atrs_hash.Get_at(i);

View File

@@ -22,7 +22,7 @@ public class Gfh_tag_rdr {
private final Hash_adp_bry name_hash;
private final Mwh_atr_parser atr_parser = new Mwh_atr_parser();
private final Gfh_tag tag__tmp__move = new Gfh_tag(), tag__tmp__peek = new Gfh_tag(), tag__eos = new Gfh_tag(), tag__comment = new Gfh_tag();
private final Int_obj_ref tmp_depth = Int_obj_ref.zero_();
private final Int_obj_ref tmp_depth = Int_obj_ref.New_zero();
Gfh_tag_rdr(Hash_adp_bry name_hash) {this.name_hash = name_hash;}
public byte[] Src() {return src;} private byte[] src;
public int Src_end() {return src_end;} private int src_end;

View File

@@ -28,7 +28,7 @@ public class Gfo_url_encoder_tst {
@Test public void Id__space() {fxt.Encoder_id().Test__bicode("a b", "a_b");}
@Test public void Id__err() {
byte[] raw = Bry_.new_a7("0%.jpg");
Bry_bfr tmp_bfr = Bry_bfr.new_();
Bry_bfr tmp_bfr = Bry_bfr_.New();
fxt.Encoder_id().Encoder().Decode(tmp_bfr, Bool_.N, raw, 0, raw.length);
Tfds.Eq("0%.jpg", tmp_bfr.To_str_and_clear());
}

View File

@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.langs.htmls.styles; import gplx.*; import gplx.langs.*; import gplx.langs.htmls.*;
public class Gfh_style_wkr__ary implements Gfh_style_wkr {
private final List_adp list = List_adp_.new_();
private final List_adp list = List_adp_.New();
public boolean On_atr(byte[] src, int atr_idx, int atr_val_bgn, int atr_val_end, int itm_bgn, int itm_End, int key_bgn, int key_end, int val_bgn, int val_end) {
byte[] key = Bry_.Mid(src, key_bgn, key_end);
byte[] val = Bry_.Mid(src, val_bgn, val_end);
@@ -28,5 +28,5 @@ public class Gfh_style_wkr__ary implements Gfh_style_wkr {
Gfh_style_parser_.Parse(src, src_bgn, src_end, this);
return (Gfh_style_itm[])list.To_ary_and_clear(Gfh_style_itm.class);
}
public static final Gfh_style_wkr__ary Instance = new Gfh_style_wkr__ary(); Gfh_style_wkr__ary() {}
public static final Gfh_style_wkr__ary Instance = new Gfh_style_wkr__ary(); Gfh_style_wkr__ary() {}
}