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

'v3.8.1.1'

This commit is contained in:
gnosygnu
2016-07-31 21:41:19 -04:00
parent 8e91ac0bc4
commit b0fdf78a41
388 changed files with 3517 additions and 2553 deletions

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.langs.gfs; import gplx.*; import gplx.langs.*;
import gplx.core.gfo_regys.*;
public class Gfs_msg_bldr implements GfoMsgParser {
private final Gfs_parser parser = new Gfs_parser();
private final Gfs_parser parser = new Gfs_parser();
public GfoMsg ParseToMsg(String s) {return Bld(s);}
public GfoMsg Bld(String src) {return Bld(Bry_.new_u8(src));}
public GfoMsg Bld(byte[] src) {
@@ -45,6 +45,6 @@ public class Gfs_msg_bldr implements GfoMsgParser {
}
return rv;
}
public static final Gfs_msg_bldr Instance = new Gfs_msg_bldr(); Gfs_msg_bldr() {}
public static final Gfs_msg_bldr Instance = new Gfs_msg_bldr(); Gfs_msg_bldr() {} // TS.static
public static final String Tkn_mutator = "_";
}

View File

@@ -18,11 +18,14 @@ 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;
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);
return encoder_id.Encode(escaped);
Bry_bfr tmp_bfr = Bry_bfr_.Get();
try {
byte[] escaped = Escape_html_as_bry(tmp_bfr, key, Bool_.N, Bool_.N, Bool_.N, Bool_.Y, Bool_.Y);
return encoder_id.Encode(escaped);
} finally {tmp_bfr.Mkr_rls();}
}
public static String Escape_for_atr_val_as_str(Bry_bfr bfr, byte quote_byte, String s) {return String_.new_u8(Escape_for_atr_val_as_bry(bfr, quote_byte, s));}
public static byte[] Escape_for_atr_val_as_bry(Bry_bfr bfr, byte quote_byte, String s) {
@@ -58,9 +61,16 @@ public class Gfh_utl {
}
public static String Escape_html_as_str(String v) {return String_.new_u8(Escape_html_as_bry(Bry_.new_u8(v)));}
public static byte[] Escape_html_as_bry(Bry_bfr tmp, byte[] bry) {return Escape_html(false, tmp, bry, 0, bry.length, true, true, true, true, true);}
public static byte[] Escape_html_as_bry(byte[] bry) {return Escape_html(false, tmp_bfr, bry, 0, bry.length, true, true, true, true, true);}
public static byte[] Escape_html_as_bry(byte[] bry, boolean lt, boolean gt, boolean amp, boolean quote, boolean apos)
{return Escape_html(false, tmp_bfr, bry, 0, bry.length, lt, gt, amp, quote, apos);}
public static byte[] Escape_html_as_bry(byte[] bry) {
Bry_bfr tmp_bfr = Bry_bfr_.Get();
try {return Escape_html(false, tmp_bfr, bry, 0, bry.length, true, true, true, true, true);}
finally {tmp_bfr.Mkr_rls();}
}
public static byte[] Escape_html_as_bry(byte[] bry, boolean lt, boolean gt, boolean amp, boolean quote, boolean apos) {
Bry_bfr tmp_bfr = Bry_bfr_.Get();
try {return Escape_html(false, tmp_bfr, bry, 0, bry.length, lt, gt, amp, quote, apos);}
finally {tmp_bfr.Mkr_rls();}
}
public static byte[] Escape_html_as_bry(Bry_bfr bfr, byte[] bry, boolean lt, boolean gt, boolean amp, boolean quote, boolean apos)
{return Escape_html(false, bfr, bry, 0, bry.length, lt, gt, amp, quote, apos);}
public static void Escape_html_to_bfr(Bry_bfr bfr, byte[] bry, int bgn, int end, boolean escape_lt, boolean escape_gt, boolean escape_amp, boolean escape_quote, boolean escape_apos) {

View File

@@ -53,7 +53,7 @@ public class Gfo_url_encoder_ {
private static Gfo_url_encoder_mkr New__html_href_qarg() { // same as regular href encoder, but also do not encode qarg characters "?" and "="
return New__html_href_mw(Bool_.Y).Init__same__many(Byte_ascii.Question, Byte_ascii.Eq);
}
private static Gfo_url_encoder_mkr New__html_href_quotes() {// same as href encoder, but do not encode ?, =, #, +; also, don't encode "%" vals
public static Gfo_url_encoder_mkr New__html_href_quotes() {// same as href encoder, but do not encode ?, =, #, +; also, don't encode "%" vals
return new Gfo_url_encoder_mkr().Init(Byte_ascii.Percent).Init_common(Bool_.Y)
.Init__diff__one(Byte_ascii.Space, Byte_ascii.Underline)
.Init__same__many

View File

@@ -24,7 +24,7 @@ public interface Gfo_url_encoder_itm {
class Gfo_url_encoder_itm_same implements Gfo_url_encoder_itm {
public int Encode(Bry_bfr bfr, byte[] src, int end, int idx, byte b) {bfr.Add_byte(b); return 0;}
public int Decode(Bry_bfr bfr, byte[] src, int end, int idx, byte b, boolean fail_when_invalid) {bfr.Add_byte(b); return 0;}
public static final Gfo_url_encoder_itm Instance = new Gfo_url_encoder_itm_same();
public static final Gfo_url_encoder_itm Instance = new Gfo_url_encoder_itm_same(); // TS.static
}
class Gfo_url_encoder_itm_diff implements Gfo_url_encoder_itm {
private final byte orig, repl;

View File

@@ -33,7 +33,7 @@ public class Json_doc {
public Json_nde Root_nde() {return root_nde;} private Json_nde root_nde;
public Json_ary Root_ary() {return root_ary;} private Json_ary root_ary;
public Bry_bfr Bfr() {return bfr;} private final Bry_bfr bfr = Bry_bfr_.New();
public Number_parser Utl_num_parser() {return utl_num_parser;} private final Number_parser utl_num_parser = new Number_parser();
public Gfo_number_parser Utl_num_parser() {return utl_num_parser;} private final Gfo_number_parser utl_num_parser = new Gfo_number_parser();
public byte[] Tmp_u8_bry() {return tmp_u8_bry;} private final byte[] tmp_u8_bry = new byte[6]; // tmp bry[] for decoding sequences like \u0008
public byte[] Get_val_as_bry_or(byte[] qry_bry, byte[] or) {tmp_qry_bry[0] = qry_bry; return Get_val_as_bry_or(tmp_qry_bry, or);}
public byte[] Get_val_as_bry_or(byte[][] qry_bry, byte[] or) {

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.langs.jsons; import gplx.*; import gplx.langs.*;
import gplx.core.primitives.*;
public class Json_parser {
private byte[] src; private int src_len, pos; private final Number_parser num_parser = new Number_parser();
private byte[] src; private int src_len, pos; private final Gfo_number_parser num_parser = new Gfo_number_parser();
public Json_factory Factory() {return factory;} private final Json_factory factory = new Json_factory();
public Json_doc Parse_by_apos_ary(String... ary) {return Parse_by_apos(String_.Concat_lines_nl(ary));}
public Json_doc Parse_by_apos(String s) {return Parse(Bry_.Replace(Bry_.new_u8(s), Byte_ascii.Apos, Byte_ascii.Quote));}

View File

@@ -29,7 +29,7 @@ public abstract class Json_parser__itm__base {
this.keys = keys;
this.keys_len = keys.length;
for (int i = 0; i < keys_len; ++i)
hash.Add(Bry_.new_u8(keys[i]), Int_obj_val.new_(i));
hash.Add(Bry_.new_u8(keys[i]), new Int_obj_val(i));
this.atrs = new Json_kv[keys_len];
}
public int Kv__int(Json_kv[] ary, int i) {return Bry_.To_int(ary[i].Val_as_bry());}