1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2014-07-20 23:42:54 -04:00
parent bc10cd76b6
commit e882217c62
408 changed files with 3648 additions and 2687 deletions

View File

@@ -157,7 +157,7 @@ class Sql_cmd_wtr_ansi implements Sql_cmd_wtr {
|| valType == Integer.class || valType == Long.class
|| valType == Float.class || valType == Double.class
)
sb.Add(Object_.XtoStr_OrNull(val));
sb.Add(Object_.Xto_str_strict_or_null(val));
else if (valType == DateAdp.class)
XtoSqlVal_DateAdp(sb, prm, (DateAdp)val);
else if (valType == DecimalAdp.class) {
@@ -167,7 +167,7 @@ class Sql_cmd_wtr_ansi implements Sql_cmd_wtr {
// else if (valType == System.Enum.class)
// sb.Add_any(Enm_.XtoInt(val)); // save enum as 0 or 1, since (a) no db supports enum datatype; (b) names are fungible; (c) int is less space than name
else {
String valString = Object_.XtoStr_OrNull(val);
String valString = Object_.Xto_str_strict_or_null(val);
XtoSqlVal_Str(sb, prm, valString);
}
}
@@ -268,7 +268,7 @@ class Sql_cmd_wtr_ansi implements Sql_cmd_wtr {
sb.Add(fld.Name());
sb.Add("=");
if (quote) sb.Add("'");
sb.Add(Object_.XtoStr_OrEmpty(val));
sb.Add(Object_.Xto_str_strict_or_empty(val));
if (quote) sb.Add("'");
}
sb.Add(")");

View File

@@ -18,7 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
package gplx.dbs; import gplx.*;
public class Db_cmd_mode {
public static final byte Create = 1, Update = 2, Delete = 3, Ignore = 4;
public static byte X_to_update(byte cur) {
public static byte Xto_update(byte cur) {
switch (cur) {
case Create: // ignore update if item is already marked for create
case Delete: // ignore update if item is already marked for delete (might want to throw error)

View File

@@ -66,7 +66,7 @@ class DataTypes_base_fxt {
Tfds.Eq(rdr.ReadStr("full_name"), "John Doe");
Tfds.Eq(rdr.ReadBool("is_active"), true);
Tfds.Eq_date(rdr.ReadDate("last_update"), DateAdp_.parse_gplx("2006-03-30 22:22:00.000"));
Tfds.Eq(floatStr, Object_.XtoStr_OrEmpty(rdr.ReadFloat("quantity")));
Tfds.Eq(floatStr, Object_.Xto_str_strict_or_empty(rdr.ReadFloat("quantity")));
Tfds.Eq_decimal(rdr.ReadDecimal("amount"), DecimalAdp_.parts_(12, 345));
}
public void UpdateDate_hook() {

View File

@@ -20,12 +20,12 @@ public class GfoNdeTstr {
public static void tst_ValsByCol(GfoNde nde, String fld, Object... expdAry) {
ListAdp expd = ListAdp_.new_();
for (int i = 0; i < expdAry.length; i++) {
expd.Add(Object_.XtoStr_OrEmpty(expdAry[i]));
expd.Add(Object_.Xto_str_strict_or_empty(expdAry[i]));
}
ListAdp actl = ListAdp_.new_();
for (int i = 0; i < nde.Subs().Count(); i++) {
GfoNde sub = nde.Subs().FetchAt_asGfoNde(i);
actl.Add(Object_.XtoStr_OrEmpty(sub.Read(fld)));
actl.Add(Object_.Xto_str_strict_or_empty(sub.Read(fld)));
}
Tfds.Eq_ary(expd.XtoStrAry(), actl.XtoStrAry());
}

View File

@@ -220,8 +220,8 @@ public class SqliteDbMain {
byte[] orig = Bry_.new_ascii_(flds[4]);
int orig_mode = orig[0] - Byte_ascii.Num_0;
int comma_pos = Bry_finder.Find_fwd(orig, Byte_ascii.Comma);
int orig_w = Bry_.X_to_int_or(orig, 2, comma_pos, -1);
int orig_h = Bry_.X_to_int_or(orig, comma_pos + 1, orig.length, -1);
int orig_w = Bry_.Xto_int_or(orig, 2, comma_pos, -1);
int orig_h = Bry_.Xto_int_or(orig, comma_pos + 1, orig.length, -1);
stmt.setInt(4, orig_mode);
stmt.setInt(5, orig_w);
stmt.setInt(6, orig_h);