mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.5.1.1'
This commit is contained in:
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.langs.jsons; import gplx.*; import gplx.langs.*;
|
||||
class Json_itm_str extends Json_itm_base {
|
||||
private final boolean exact; private final Json_doc doc;
|
||||
private final boolean exact; private final Json_doc doc;
|
||||
private String data_str; private byte[] data_bry = null;
|
||||
public Json_itm_str(Json_doc doc, int src_bgn, int src_end, boolean exact) {this.Ctor(src_bgn + 1, src_end - 1); this.doc = doc; this.exact = exact;}
|
||||
@Override public byte Tid() {return Json_itm_.Tid__str;}
|
||||
@@ -57,7 +57,7 @@ class Json_itm_str extends Json_itm_base {
|
||||
case Byte_ascii.Ltr_b: bfr.Add_byte(Byte_ascii.Backfeed); break;
|
||||
case Byte_ascii.Ltr_f: bfr.Add_byte(Byte_ascii.Formfeed); break;
|
||||
case Byte_ascii.Ltr_u:
|
||||
int utf8_val = gplx.core.texts.HexDecUtl.parse_or(src, i + 1, i + 5, -1);
|
||||
int utf8_val = gplx.core.encoders.Hex_utl_.Parse_or(src, i + 1, i + 5, -1);
|
||||
int len = gplx.core.intls.Utf16_.Encode_int(utf8_val, utf8_bry, 0);
|
||||
bfr.Add_mid(utf8_bry, 0, len);
|
||||
i += 4;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class Json_wtr {
|
||||
public Json_wtr Nde_bgn(byte[] key) {
|
||||
Write_indent_itm();
|
||||
if (key == Bry_.Empty) {
|
||||
bfr.Del_by_1(); // remove trailing space from Write_indent_itm
|
||||
if (opt_ws) bfr.Del_by_1(); // remove trailing space from Write_indent_itm
|
||||
++idx;
|
||||
}
|
||||
else
|
||||
@@ -55,9 +55,15 @@ public class Json_wtr {
|
||||
Write_grp_end(Bool_.Y, Sym_nde_end);
|
||||
return Write_nl();
|
||||
}
|
||||
public Json_wtr Ary_bgn_ary() {return Ary_bgn(String_.Empty);}
|
||||
public Json_wtr Ary_bgn(String nde) {
|
||||
Write_indent_itm();
|
||||
Write_key(Bry_.new_u8(nde));
|
||||
if (nde == String_.Empty) {
|
||||
if (opt_ws) bfr.Del_by_1(); // remove trailing space from Write_indent_itm
|
||||
++idx;
|
||||
}
|
||||
else
|
||||
Write_key(Bry_.new_u8(nde));
|
||||
return Ary_bgn_keyless();
|
||||
}
|
||||
private Json_wtr Ary_bgn_keyless() {
|
||||
@@ -203,9 +209,7 @@ public class Json_wtr {
|
||||
}
|
||||
}
|
||||
}
|
||||
// else {
|
||||
bfr.Add_byte_nl();
|
||||
// }
|
||||
bfr.Add_byte_nl();
|
||||
Write_grp_bgn(Sym_nde_bgn, Bool_.Y);
|
||||
Json_nde sub_nde = (Json_nde)obj;
|
||||
int sub_nde_len = sub_nde.Len();
|
||||
|
||||
Reference in New Issue
Block a user