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

'v3.9.2.1'

This commit is contained in:
gnosygnu
2016-09-11 21:49:20 -04:00
parent 232838c732
commit 35d78f6106
310 changed files with 4358 additions and 5116 deletions

View File

@@ -79,6 +79,7 @@ public class Bry_fmt {
public static Bry_fmt New(byte[] fmt, String... keys) {return new Bry_fmt(fmt , Bry_.Ary(keys), Bfr_fmt_arg.Ary_empty);}
public static String Make_str(String fmt_str, Object... vals) {return Auto(fmt_str).Vals_(vals).To_str();}
public static Bry_fmt Auto_nl_apos(String... lines) {return Auto(Bry_.New_u8_nl_apos(lines));}
public static Bry_fmt Auto_nl_skip_last(String... lines) {return Auto(Bry_.new_u8(String_.Concat_lines_nl_skip_last(lines)));}
public static Bry_fmt Auto(String fmt_str) {return Auto(Bry_.new_u8(fmt_str));}
public static Bry_fmt Auto(byte[] fmt_bry) {
byte[][] keys_bry = Bry_fmt_parser_.Parse_keys(fmt_bry);

View File

@@ -64,6 +64,8 @@ public class Io_mgr implements Gfo_evt_mgr_owner { // exists primarily to gather
public void DeleteDirDeep(Io_url url) {IoEngine_xrg_deleteDir.new_(url).Recur_().Exec();}
public void DeleteDirDeep_ary(Io_url... urls) {for (Io_url url : urls) IoEngine_xrg_deleteDir.new_(url).Recur_().Exec();}
public int Delete_dir_empty(Io_url url) {return Io_mgr_.Delete_dir_empty(url);}
public void Delete_sub_by_wildcard() {
}
public boolean Truncate_fil(Io_url url, long size) {return IoEnginePool.Instance.Get_by(url.Info().EngineKey()).Truncate_fil(url, size);}
public void MoveDirDeep(Io_url src, Io_url trg) {IoEngine_xrg_xferDir.move_(src, trg).Recur_().Exec();}
public IoEngine_xrg_xferDir CopyDir_cmd(Io_url src, Io_url trg) {return IoEngine_xrg_xferDir.copy_(src, trg);}

View File

@@ -19,15 +19,10 @@ package gplx;
import gplx.core.strings.*;
public class Time_span implements CompareAble { // NOTE: gplx.Time_span b/c System.TimeSpan
public long Fracs() {return fracs;} long fracs; public int FracsAsInt() {return (int)fracs;}
public Decimal_adp TotalSecs() {
return Decimal_adp_.divide_(fracs, Time_span_.Divisors[Time_span_.Idx_Sec]);
}
public Decimal_adp Total_days() {
return Decimal_adp_.divide_(fracs, Time_span_.Divisors[Time_span_.Idx_Hour] * 24);
}
public Decimal_adp Total_hours() {
return Decimal_adp_.divide_(fracs, Time_span_.Divisors[Time_span_.Idx_Hour]);
}
public Decimal_adp Total_days() {return Decimal_adp_.divide_(fracs, Time_span_.Divisors[Time_span_.Idx_Hour] * 24);}
public Decimal_adp Total_hours() {return Decimal_adp_.divide_(fracs, Time_span_.Divisors[Time_span_.Idx_Hour]);}
public Decimal_adp Total_mins() {return Decimal_adp_.divide_(fracs, Time_span_.Divisors[Time_span_.Idx_Min]);}
public Decimal_adp Total_secs() {return Decimal_adp_.divide_(fracs, Time_span_.Divisors[Time_span_.Idx_Sec]);}
public int[] Units() {return Time_span_.Split_long(fracs, Time_span_.Divisors);}
public int Units_fracs() {
int[] ary = Time_span_.Split_long(fracs, Time_span_.Divisors);

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.core.ios; import gplx.*; import gplx.core.*;
import gplx.langs.gfs.*;
public class IoItmFil extends IoItm_base {
@Override public int TypeId() {return IoItmFil.Type_Fil;} @Override public boolean Type_dir() {return false;} @Override public boolean Type_fil() {return true;} public static final int Type_Fil = 2;
@Override public int TypeId() {return IoItmFil.Type_Fil;} @Override public boolean Type_dir() {return false;} @Override public boolean Type_fil() {return true;} public static final int Type_Fil = 2;
public boolean Exists() {return size != Size_invalid;} // NOTE: questionable logic, but preserved for historical reasons; requires that length be set to -1 if !.exists
public DateAdp ModifiedTime() {return modifiedTime;}
public IoItmFil ModifiedTime_(DateAdp val) {modifiedTime = val; return this;} DateAdp modifiedTime;

View File

@@ -22,4 +22,5 @@ public interface Gfo_prog_ui extends Cancelable {
long Prog_data_cur();
long Prog_data_end();
boolean Prog_notify_and_chk_if_suspended(long cur, long max);
void Prog_notify_by_msg(String msg);
}

View File

@@ -35,6 +35,7 @@ class Gfo_prog_ui__noop implements Gfo_prog_ui {
public long Prog_data_cur() {return 0;}
public long Prog_data_end() {return 0;}
public boolean Prog_notify_and_chk_if_suspended(long cur, long max) {return false;}
public void Prog_notify_by_msg(String msg) {}
}
class Gfo_prog_ui__always implements Gfo_prog_ui {
public boolean Canceled() {return false;}
@@ -44,4 +45,5 @@ class Gfo_prog_ui__always implements Gfo_prog_ui {
public long Prog_data_cur() {return 0;}
public long Prog_data_end() {return 0;}
public boolean Prog_notify_and_chk_if_suspended(long cur, long max) {return false;}
public void Prog_notify_by_msg(String msg) {}
}

View File

@@ -25,7 +25,7 @@ public class Time_span__basic_tst {
}
@Test public void TotalSecs() {
Time_span val = Time_span_.fracs_(1987);
Tfds.Eq_decimal(Decimal_adp_.parts_(1, 987), val.TotalSecs());
Tfds.Eq_decimal(Decimal_adp_.parts_(1, 987), val.Total_secs());
}
@Test public void Units() {
tst_Units("01:02:03.987", 1, 2, 3, 987);

View File

@@ -21,7 +21,7 @@ public class TimeSpanAdpClassXtn extends ClassXtn_base implements ClassXtn {
@Override public Class<?> UnderClass() {return Time_span.class;}
public Object DefaultValue() {return Time_span_.Zero;}
@Override public Object ParseOrNull(String raw) {return Time_span_.parse(raw);}
@Override public Object XtoDb(Object obj) {return Time_span_.cast(obj).TotalSecs();}
@Override public Object XtoDb(Object obj) {return Time_span_.cast(obj).Total_secs();}
@Override public String XtoUi(Object obj, String fmt) {return Time_span_.cast(obj).To_str(fmt);}
public boolean Eq(Object lhs, Object rhs) {try {return Time_span_.cast(lhs).Eq(rhs);} catch (Exception e) {Err_.Noop(e); return false;}}
public static final TimeSpanAdpClassXtn Instance = new TimeSpanAdpClassXtn(); TimeSpanAdpClassXtn() {} // added to ClassXtnPool by default