mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.2.4.1
This commit is contained in:
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa; import gplx.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.ios.*; import gplx.xowa.tdbs.*;
|
||||
public class Io_sort_cmd_ns implements Io_make_cmd {
|
||||
Xob_xdat_file_wtr fil_wtr; Bry_bfr reg_bfr = Bry_bfr.new_(), key_bfr_0 = Bry_bfr.new_(512), key_bfr_n = Bry_bfr.new_(512);
|
||||
int fil_count = 0, itm_count = 0;
|
||||
@@ -27,7 +27,7 @@ public class Io_sort_cmd_ns implements Io_make_cmd {
|
||||
public void Sort_bgn() {
|
||||
fil_count = itm_count = 0;
|
||||
fil_wtr = Xob_xdat_file_wtr.new_file_(trg_fil_max, make_dir);
|
||||
reg_url = make_dir.GenSubFil(Xow_dir_info_.Name_reg_fil);
|
||||
reg_url = make_dir.GenSubFil(Xotdb_dir_info_.Name_reg_fil);
|
||||
}
|
||||
public void Sort_do(Io_line_rdr rdr) {
|
||||
int itm_bgn = rdr.Itm_pos_bgn(), itm_end = rdr.Itm_pos_end(), key_bgn = rdr.Key_pos_bgn(), key_end = rdr.Key_pos_end();
|
||||
|
||||
@@ -20,12 +20,12 @@ import gplx.xowa.bldrs.*; import gplx.xowa.apps.*; import gplx.xowa.bldrs.xmls.*
|
||||
import gplx.xowa.bldrs.cfgs.*; import gplx.xowa.bldrs.langs.*;
|
||||
public class Xob_bldr implements GfoInvkAble {
|
||||
private boolean pause_at_end = false;
|
||||
public Xob_bldr(Xoa_app app) {
|
||||
public Xob_bldr(Xoae_app app) {
|
||||
this.app = app;
|
||||
cmd_mgr = new Xob_cmd_mgr(this);
|
||||
wiki_cfg_bldr = new Xob_wiki_cfg_bldr(this);
|
||||
}
|
||||
public Xoa_app App() {return app;} private Xoa_app app;
|
||||
public Xoae_app App() {return app;} private Xoae_app app;
|
||||
public Gfo_usr_dlg Usr_dlg() {return app.Usr_dlg();}
|
||||
public Xob_cmd_mgr Cmd_mgr() {return cmd_mgr;} private Xob_cmd_mgr cmd_mgr;
|
||||
public int Sort_mem_len() {return sort_mem_len;} public Xob_bldr Sort_mem_len_(int v) {sort_mem_len = v; return this;} private int sort_mem_len = 16 * Io_mgr.Len_mb;
|
||||
@@ -33,7 +33,6 @@ public class Xob_bldr implements GfoInvkAble {
|
||||
public int Make_fil_len() {return make_fil_len;} public Xob_bldr Make_fil_len_(int v) {make_fil_len = v; return this;} private int make_fil_len = 64 * Io_mgr.Len_kb;
|
||||
public Xob_xml_parser Parser() {if (parser == null) parser = new Xob_xml_parser(); return parser;} private Xob_xml_parser parser;
|
||||
public Xob_wiki_cfg_bldr Wiki_cfg_bldr() {return wiki_cfg_bldr;} private Xob_wiki_cfg_bldr wiki_cfg_bldr;
|
||||
public Xob_i18n_parser I18n_parser() {return i18n_parser;} private Xob_i18n_parser i18n_parser = new Xob_i18n_parser();
|
||||
public void StatusMgr_prog_fmt(long cur, long end, int pct_idx, String fmt, Object... ary) {
|
||||
long now = Env_.TickCount(); if (now - StatusMgr_prog_prv < 100) return;
|
||||
StatusMgr_prog_prv = now;
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa; import gplx.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.ios.*; import gplx.xowa.tdbs.*;
|
||||
public class Xob_make_cmd_site implements Io_make_cmd {
|
||||
Xob_xdat_file_wtr fil_wtr; Bry_bfr cur_bfr = Bry_bfr.new_(), reg_bfr = Bry_bfr.new_(), reg_key_0 = Bry_bfr.new_(512), reg_key_n = Bry_bfr.new_(512);
|
||||
int make_fil_max = 65 * Io_mgr.Len_kb, fil_count = 0, itm_count = 0, itm_key_end = 0; Io_url reg_url;
|
||||
@@ -25,7 +25,7 @@ public class Xob_make_cmd_site implements Io_make_cmd {
|
||||
public byte Line_dlm() {return line_dlm;} public Xob_make_cmd_site Line_dlm_(byte v) {line_dlm = v; return this;} private byte line_dlm = Byte_ascii.Nil;
|
||||
public void Sort_bgn() {
|
||||
fil_count = itm_count = itm_key_end = 0;
|
||||
reg_url = make_dir.GenSubFil(Xow_dir_info_.Name_reg_fil);
|
||||
reg_url = make_dir.GenSubFil(Xotdb_dir_info_.Name_reg_fil);
|
||||
fil_wtr = Xob_xdat_file_wtr.new_file_(make_fil_max, make_dir);
|
||||
}
|
||||
public void Sort_do(Io_line_rdr rdr) {
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa; import gplx.*;
|
||||
import gplx.core.strings.*;
|
||||
import gplx.core.strings.*; import gplx.xowa.tdbs.*;
|
||||
public class Xob_stat_mgr {
|
||||
public Xob_stat_type GetOrNew(byte tid) {
|
||||
Xob_stat_type rv = (Xob_stat_type)regy.Fetch(tid);
|
||||
@@ -30,7 +30,7 @@ public class Xob_stat_mgr {
|
||||
String_bldr sb = String_bldr_.new_();
|
||||
for (int i = 0; i < regy.Count(); i++) {
|
||||
Xob_stat_type typ = (Xob_stat_type)regy.FetchAt(i);
|
||||
sb.Add(String_.PadEnd(Xow_dir_info_.Tid_name(typ.Tid()), 6, " "));
|
||||
sb.Add(String_.PadEnd(Xotdb_dir_info_.Tid_name(typ.Tid()), 6, " "));
|
||||
}
|
||||
sb.Add_str_w_crlf("ns");
|
||||
String[] nsAry = GetNmsAry(nsMgr);
|
||||
|
||||
@@ -16,7 +16,7 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa; import gplx.*;
|
||||
import gplx.core.strings.*;
|
||||
import gplx.core.strings.*; import gplx.xowa.tdbs.*;
|
||||
public class Xob_stat_type {
|
||||
public byte Tid() {return tid;} private byte tid;
|
||||
public Xob_stat_type(byte tid) {this.tid = tid;}
|
||||
@@ -26,7 +26,7 @@ public class Xob_stat_type {
|
||||
public void XtoStr(String_bldr sb) {
|
||||
for (int i = 0; i < regy.Count(); i++) {
|
||||
Xob_stat_itm itm = (Xob_stat_itm)regy.FetchAt(i);
|
||||
sb.Add(Xow_dir_info_.Tid_name(tid)).Add(Xob_stat_itm.Dlm);
|
||||
sb.Add(Xotdb_dir_info_.Tid_name(tid)).Add(Xob_stat_itm.Dlm);
|
||||
itm.XtoStr(sb);
|
||||
sb.Add(Byte_ascii.NewLine);
|
||||
}
|
||||
|
||||
@@ -16,14 +16,14 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa; import gplx.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.ios.*; import gplx.xowa.tdbs.*;
|
||||
public class Xob_xdat_file_wtr {
|
||||
public static Xob_xdat_file_wtr new_file_(int fil_max, Io_url root_dir) {return new Xob_xdat_file_wtr(fil_max, root_dir, Io_stream_.Tid_file);}
|
||||
public static Xob_xdat_file_wtr new_by_tid_(int fil_max, Io_url root_dir, byte dir_tid, byte tid) {return new Xob_xdat_file_wtr(fil_max, root_dir.GenSubDir(Xow_dir_info_.Tid_name(dir_tid) + Xow_fsys_mgr.Wtr_dir(tid)), tid);}
|
||||
public static Xob_xdat_file_wtr new_by_tid_(int fil_max, Io_url root_dir, byte dir_tid, byte tid) {return new Xob_xdat_file_wtr(fil_max, root_dir.GenSubDir(Xotdb_dir_info_.Tid_name(dir_tid) + Xotdb_dir_info.Wtr_dir(tid)), tid);}
|
||||
Xob_xdat_file_wtr(int fil_max, Io_url root_dir, byte wtr_tid) {
|
||||
this.fil_max = fil_max;
|
||||
this.root_dir = root_dir;
|
||||
fil_ext = Xow_fsys_mgr.Wtr_ext(wtr_tid);
|
||||
fil_ext = Xotdb_dir_info.Wtr_ext(wtr_tid);
|
||||
bfr = Bry_bfr.new_(fil_max);
|
||||
idx = new int[fil_max / 8]; // ASSUME: any given row must at least be 8 bytes long
|
||||
Url_gen(fil_idx); // set 1st url
|
||||
@@ -109,7 +109,7 @@ public class Xob_xdat_file_wtr {
|
||||
public void Clear() {idx_pos = 0; bfr.Clear();}
|
||||
public void Rls() {bfr.Rls(); idx = null;}
|
||||
public void Url_gen_add() {Url_gen(++fil_idx);}
|
||||
private void Url_gen(int newIdx) {fil_url = Xow_fsys_mgr.Url_fil(root_dir, newIdx, fil_ext);} Io_url fil_url; Io_url root_dir;
|
||||
private void Url_gen(int newIdx) {fil_url = Xotdb_fsys_mgr.Url_fil(root_dir, newIdx, fil_ext);} Io_url fil_url; Io_url root_dir;
|
||||
private void Idx_resize(int newLen) {idx = (int[])Array_.Resize(idx, newLen);}
|
||||
static final String GRP_KEY = "xowa.bldr.xdat_wtr";
|
||||
private static final byte Dlm_fld = Byte_ascii.Pipe;
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa; import gplx.*;
|
||||
import gplx.ios.*; import gplx.xowa.bldrs.*; import gplx.xowa.bldrs.xmls.*;
|
||||
public class Xobd_rdr implements Xob_cmd {
|
||||
public Xobd_rdr(Xob_bldr bldr, Xow_wiki wiki) {this.bldr = bldr; this.wiki = wiki;} private Xob_bldr bldr; Xow_wiki wiki;
|
||||
public Xobd_rdr(Xob_bldr bldr, Xowe_wiki wiki) {this.bldr = bldr; this.wiki = wiki;} private Xob_bldr bldr; Xowe_wiki wiki;
|
||||
public String Cmd_key() {return KEY;} public static final String KEY = "dump_mgr";
|
||||
public void Cmd_ini(Xob_bldr bldr) {
|
||||
Xobd_wkr[] wkr_ary = (Xobd_wkr[])wkrs.Xto_ary(Xobd_wkr.class); int wkr_ary_len = wkr_ary.length;
|
||||
|
||||
@@ -16,8 +16,8 @@ You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa; import gplx.*;
|
||||
import gplx.ios.*;
|
||||
import gplx.lists.*;
|
||||
import gplx.ios.*; import gplx.lists.*;
|
||||
import gplx.xowa.tdbs.*;
|
||||
class Io_sort_filCmd_reg implements Io_sort_filCmd { // 123|bgn|end|1
|
||||
public Io_sort_filCmd_reg() {}
|
||||
public void Bfr_add(Io_line_rdr stream) {
|
||||
@@ -40,11 +40,11 @@ class Io_sort_filCmd_reg implements Io_sort_filCmd { // 123|bgn|end|1
|
||||
}
|
||||
class Io_url_gen_nest implements gplx.ios.Io_url_gen {
|
||||
public Io_url Cur_url() {return cur_url;} Io_url cur_url;
|
||||
public Io_url Nxt_url() {cur_url = Xow_fsys_mgr.Url_fil(root_dir, fil_idx++, ext); return cur_url;}
|
||||
public Io_url Nxt_url() {cur_url = Xotdb_fsys_mgr.Url_fil(root_dir, fil_idx++, ext); return cur_url;}
|
||||
public Io_url[] Prv_urls() {
|
||||
Io_url[] rv = new Io_url[fil_idx];
|
||||
for (int i = 0; i < fil_idx; i++) {
|
||||
rv[i] = Xow_fsys_mgr.Url_fil(root_dir, fil_idx++, ext);
|
||||
rv[i] = Xotdb_fsys_mgr.Url_fil(root_dir, fil_idx++, ext);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa; import gplx.*;
|
||||
import gplx.core.brys.*; import gplx.ios.*;
|
||||
public class Xodb_page_raw_parser {
|
||||
public void Init(Gfo_usr_dlg usr_dlg, Xow_wiki wiki, int load_len) {
|
||||
public void Init(Gfo_usr_dlg usr_dlg, Xowe_wiki wiki, int load_len) {
|
||||
this.wiki = wiki; ns_mgr = wiki.Ns_mgr();
|
||||
rdr = new Io_line_rdr(usr_dlg, new Io_url[1]);
|
||||
rdr.Line_dlm_(Byte_ascii.Tab).Load_len_(load_len).Key_gen_(Io_line_rdr_key_gen_all._);
|
||||
@@ -27,11 +27,11 @@ public class Xodb_page_raw_parser {
|
||||
public void Reset_one(Io_url url) {
|
||||
rdr.Reset_one(url);
|
||||
}
|
||||
public void Load(Gfo_usr_dlg usr_dlg, Xow_wiki wiki, Xow_ns ns_itm, Io_url[] urls, int load_len) {
|
||||
public void Load(Gfo_usr_dlg usr_dlg, Xowe_wiki wiki, Xow_ns ns_itm, Io_url[] urls, int load_len) {
|
||||
this.wiki = wiki; ns_mgr = wiki.Ns_mgr(); this.ns_itm = ns_itm;
|
||||
rdr = new Io_line_rdr(usr_dlg, urls);
|
||||
rdr.Line_dlm_(Byte_ascii.Tab).Load_len_(load_len).Key_gen_(Io_line_rdr_key_gen_all._);
|
||||
} Io_line_rdr rdr; Xow_wiki wiki; Xow_ns_mgr ns_mgr; Xow_ns ns_itm;
|
||||
} Io_line_rdr rdr; Xowe_wiki wiki; Xow_ns_mgr ns_mgr; Xow_ns ns_itm;
|
||||
public void Skip_first_line() {
|
||||
rdr.Read_next();
|
||||
int pos = Bry_finder.Find_fwd(rdr.Bfr(), Byte_ascii.NewLine);
|
||||
|
||||
Reference in New Issue
Block a user