mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v1.10.2.1
This commit is contained in:
@@ -86,7 +86,7 @@ public class Xoa_url {
|
||||
bfr.Add_byte(Byte_ascii.Eq);
|
||||
bfr.Add(arg.Val_bry());
|
||||
}
|
||||
return bfr.XtoAryAndClear();
|
||||
return bfr.Xto_bry_and_clear();
|
||||
}
|
||||
private int Page_bgn(int raw_len) {
|
||||
int wiki_pos = Bry_finder.Find_fwd(raw, Xoh_href_parser.Href_wiki_bry, 0, raw_len); // look for /wiki/
|
||||
|
||||
@@ -47,7 +47,7 @@ public class Xoa_url_arg_hash {
|
||||
Gfo_url_arg itm = Get_arg(key); if (itm == null) continue;
|
||||
bfr.Add_byte(Byte_ascii.Amp).Add(itm.Key_bry()).Add_byte(Byte_ascii.Eq).Add(itm.Val_bry());
|
||||
}
|
||||
return bfr.XtoAryAndClear();
|
||||
return bfr.Xto_bry_and_clear();
|
||||
}
|
||||
public Xoa_url_arg_hash Load(Xoa_url url) {
|
||||
hash.Clear();
|
||||
@@ -60,7 +60,7 @@ public class Xoa_url_arg_hash {
|
||||
return this;
|
||||
}
|
||||
public void Save(Xoa_url url) {
|
||||
Gfo_url_arg[] ary = (Gfo_url_arg[])hash.XtoAry(Gfo_url_arg.class);
|
||||
Gfo_url_arg[] ary = (Gfo_url_arg[])hash.Xto_ary(Gfo_url_arg.class);
|
||||
url.Args_(ary);
|
||||
}
|
||||
public static void Concat_bfr(Bry_bfr bfr, Url_encoder href_encoder, Gfo_url_arg[] ary) {
|
||||
|
||||
@@ -35,7 +35,7 @@ public class Xoa_url_parser {
|
||||
}
|
||||
if (url.Anchor_bry() != null)
|
||||
tmp_bfr.Add_byte(Byte_ascii.Hash).Add(url.Anchor_bry()); // add anchor; EX: "#B"
|
||||
return tmp_bfr.XtoStrAndClear();
|
||||
return tmp_bfr.Xto_str_and_clear();
|
||||
}
|
||||
public Xoa_url Parse(byte[] src) {
|
||||
Xoa_url rv = Xoa_url.blank_();
|
||||
@@ -72,10 +72,10 @@ public class Xoa_url_parser {
|
||||
.Add(domain_bry).Add(Bry_dot_org); // add type + .org; EX: "wikipedia.org"; "wikimedia.org";
|
||||
url.Segs_ary_(Xoa_url_parser.Bry_wiki_name_bry); // NOTE: add "wiki" as seg else will have "/site/commons.wikimedia.org/File:A" which will be invalid (needs to be "/site/commons.wikimedia.org/wiki/File:A")
|
||||
url.Lang_bry_(lang_bry);
|
||||
url.Wiki_bry_(tmp_bfr.XtoAryAndClear());
|
||||
url.Wiki_bry_(tmp_bfr.Xto_bry_and_clear());
|
||||
byte[][] segs = gfo_url.Segs();
|
||||
byte[] page_bry = segs.length > 5 && Bry_.Eq(segs[2], Xof_url_bldr.Bry_thumb) ? segs[5] : gfo_url.Page();
|
||||
url.Page_bry_(tmp_bfr.Add(Bry_file).Add(page_bry).XtoAryAndClear());
|
||||
url.Page_bry_(tmp_bfr.Add(Bry_file).Add(page_bry).Xto_bry_and_clear());
|
||||
url.Anchor_bry_(Bry_.Empty);
|
||||
}
|
||||
else {
|
||||
@@ -249,7 +249,7 @@ public class Xoa_url_parser {
|
||||
if (bfr.Len() > 0) bfr.Add_byte(Byte_ascii.Slash);
|
||||
bfr.Add(page);
|
||||
}
|
||||
return bfr.Mkr_rls().XtoAryAndClear();
|
||||
return bfr.Mkr_rls().Xto_bry_and_clear();
|
||||
}
|
||||
public static Xoa_url Parse_from_url_bar(Xoa_app app, Xow_wiki wiki, String s) {
|
||||
byte[] bry = Bry_.new_utf8_(s);
|
||||
|
||||
@@ -72,7 +72,7 @@ public class Xoh_href_parser {
|
||||
}
|
||||
}
|
||||
}
|
||||
public byte[] Build_to_bry(Xow_wiki wiki, Xoa_ttl ttl) {Build_to_bfr(tmp_bfr, wiki, ttl, Bool_.N); return tmp_bfr.XtoAryAndClear();}
|
||||
public byte[] Build_to_bry(Xow_wiki wiki, Xoa_ttl ttl) {Build_to_bfr(tmp_bfr, wiki, ttl, Bool_.N); return tmp_bfr.Xto_bry_and_clear();}
|
||||
public void Build_to_bfr(Bry_bfr bfr, Xow_wiki wiki, byte[] raw) {Build_to_bfr(bfr, wiki, Xoa_ttl.parse_(wiki, raw), Bool_.N);}
|
||||
public void Build_to_bfr(Bry_bfr bfr, Xow_wiki wiki, Xoa_ttl ttl) {Build_to_bfr(bfr, wiki, ttl, Bool_.N);}
|
||||
public void Build_to_bfr(Bry_bfr bfr, Xow_wiki wiki, Xoa_ttl ttl, boolean force_site) {
|
||||
|
||||
@@ -220,18 +220,18 @@ class Xoh_href_parser_fxt {
|
||||
if (expd_anch != null) Tfds.Eq(expd_anch, String_.new_utf8_(href.Anchor()));
|
||||
if (expd_full != null) {
|
||||
href.Print_to_bfr(tmp_bfr, true);
|
||||
Tfds.Eq(expd_full, tmp_bfr.XtoStrAndClear());
|
||||
Tfds.Eq(expd_full, tmp_bfr.Xto_str_and_clear());
|
||||
}
|
||||
}
|
||||
public void Test_parse(String raw, String expd) {
|
||||
href_parser.Parse(href, raw, wiki, Page_1_ttl);
|
||||
href.Print_to_bfr(tmp_bfr, wiki.Gui_mgr().Cfg_browser().Link_hover_full());
|
||||
Tfds.Eq(expd, tmp_bfr.XtoStrAndClear());
|
||||
Tfds.Eq(expd, tmp_bfr.Xto_str_and_clear());
|
||||
}
|
||||
public void Test_build(String raw, String expd) {
|
||||
Xoa_ttl ttl = Xoa_ttl.parse_(wiki, Bry_.new_utf8_(raw));
|
||||
href_parser.Build_to_bfr(tmp_bfr, wiki, ttl);
|
||||
Tfds.Eq(expd, tmp_bfr.XtoStrAndClear());
|
||||
Tfds.Eq(expd, tmp_bfr.Xto_str_and_clear());
|
||||
}
|
||||
public void Test_parse_protocol(String raw, byte expd_tid) {
|
||||
href_parser.Parse(href, raw, wiki, Page_1_ttl);
|
||||
|
||||
Reference in New Issue
Block a user