mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.10.3.1
This commit is contained in:
@@ -132,7 +132,7 @@ public class Sql_file_parser {
|
||||
default: throw Err_.new_unhandled(mode);
|
||||
}
|
||||
}
|
||||
Io_mgr.I.AppendFilByt(trg_fil_gen.Nxt_url(), fil_bfr.Xto_bry_and_clear());
|
||||
Io_mgr.Instance.AppendFilByt(trg_fil_gen.Nxt_url(), fil_bfr.To_bry_and_clear());
|
||||
}
|
||||
finally {rdr.Rls();}
|
||||
}
|
||||
@@ -141,7 +141,7 @@ public class Sql_file_parser {
|
||||
if (fil_bfr.Len() > trg_len) {
|
||||
Io_url trg_fil = trg_fil_gen.Nxt_url();
|
||||
usr_dlg.Prog_one(GRP_KEY, "make", "making ~{0}", trg_fil.NameAndExt());
|
||||
Io_mgr.I.AppendFilByt(trg_fil, fil_bfr.Xto_bry_and_clear());
|
||||
Io_mgr.Instance.AppendFilByt(trg_fil, fil_bfr.To_bry_and_clear());
|
||||
}
|
||||
}
|
||||
private void Commit_fld(int fld_idx, Bry_bfr val_bfr, Bry_bfr fil_bfr, Sql_file_parser_data data) {
|
||||
|
||||
@@ -28,7 +28,7 @@ class Sql_file_parser_cmd_max_len implements Sql_file_parser_cmd {
|
||||
String itm = (String)log.Get_at(i);
|
||||
sb.Add(String_.Len(itm) + "|" + itm + "\n");
|
||||
}
|
||||
Io_mgr.I.SaveFilStr(url, sb.To_str());
|
||||
Io_mgr.Instance.SaveFilStr(url, sb.To_str());
|
||||
}
|
||||
public int Max_len() {return max_len;} private int max_len;
|
||||
public void Exec(byte[] src, byte[] fld_key, int fld_idx, int fld_bgn, int fld_end, Bry_bfr file_bfr, Sql_file_parser_data data) {
|
||||
|
||||
@@ -58,16 +58,16 @@ public class Sql_file_parser_tst {
|
||||
}
|
||||
class Sql_file_parser_fxt {
|
||||
Sql_file_parser parser = new Sql_file_parser().Src_len_(Io_mgr.Len_kb).Trg_len_(Io_mgr.Len_kb);
|
||||
public Sql_file_parser_fxt Clear() {Io_mgr.I.InitEngine_mem(); return this;}
|
||||
public Sql_file_parser_fxt Clear() {Io_mgr.Instance.InitEngine_mem(); return this;}
|
||||
public Sql_file_parser_fxt Init_flds_req_idx_(int flds_all_len, int... idxs) {parser.Flds_req_idx_(flds_all_len, idxs); return this;}
|
||||
public Sql_file_parser_fxt Init_cmd_(Sql_file_parser_cmd cmd) {parser.Fld_cmd_(cmd); return this;}
|
||||
public void Test_parse(String raw_str, String expd) {
|
||||
Io_url src_fil = Io_url_.new_fil_("mem/test.sql");
|
||||
Io_mgr.I.SaveFilBry(src_fil, Bry_.new_u8(raw_str));
|
||||
Io_mgr.Instance.SaveFilBry(src_fil, Bry_.new_u8(raw_str));
|
||||
Io_url trg_fil = Io_url_.new_fil_("mem/test.csv");
|
||||
parser.Src_fil_(src_fil).Trg_fil_gen_(Io_url_gen_.fil_(trg_fil));
|
||||
parser.Parse(Gfo_usr_dlg_.Test());
|
||||
byte[] actl = Io_mgr.I.LoadFilBry(trg_fil);
|
||||
byte[] actl = Io_mgr.Instance.LoadFilBry(trg_fil);
|
||||
Tfds.Eq(expd, String_.new_u8(actl));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class Sql_fld_mgr {
|
||||
public Sql_fld_itm Get_by_key(String fld) {return Get_by_key(Bry_.new_u8(fld));}
|
||||
public Sql_fld_itm Get_by_key(byte[] fld) {
|
||||
return (Sql_fld_itm)hash.Get_by(fld);
|
||||
} private Ordered_hash hash = Ordered_hash_.new_bry_();
|
||||
} private Ordered_hash hash = Ordered_hash_.New_bry();
|
||||
public Sql_fld_mgr Parse(byte[] raw) {
|
||||
hash.Clear();
|
||||
int bgn = Bry_find_.Find_fwd(raw, Tkn_create_table); if (bgn == Bry_.NotFound) throw Err_.new_wo_type("could not find 'CREATE TABLE'");
|
||||
|
||||
Reference in New Issue
Block a user