You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
booljsvIsBoolean(constJsVar*v) { if (!v) return false; charf=v->flags&JSV_VARTYPEMASK; returnJSV_IS_BOOL(f); }
130
130
booljsvIsString(constJsVar*v) { if (!v) return false; charf=v->flags&JSV_VARTYPEMASK; returnJSV_IS_STRING(f); } ///< String, or a NAME too
131
-
booljsvIsUnicodeString(constJsVar*v) { if (!v) return false; charf=v->flags&JSV_VARTYPEMASK; returnJSV_IS_UNICODE_STRING(f); } ///< Just a unicode string (Unicode JsVar, pointing to a string)
131
+
booljsvIsUTF8String(constJsVar*v) { if (!v) return false; charf=v->flags&JSV_VARTYPEMASK; returnJSV_IS_UNICODE_STRING(f); } ///< Just a unicode string (UTF8 JsVar, pointing to a string)
132
132
booljsvIsBasicString(constJsVar*v) { if (!v) return false; charf=v->flags&JSV_VARTYPEMASK; returnf>=JSV_STRING_0&&f<=JSV_STRING_MAX; } ///< Just a string (NOT a name/flatstr/nativestr or flashstr)
133
133
booljsvIsStringExt(constJsVar*v) { if (!v) return false; charf=v->flags&JSV_VARTYPEMASK; returnJSV_IS_STRING_EXT(f); } ///< The extra bits dumped onto the end of a string to store more data
134
134
booljsvIsFlatString(constJsVar*v) { if (!v) return false; charf=v->flags&JSV_VARTYPEMASK; returnJSV_IS_FLAT_STRING(f); }
JSV_FLAT_STRING=JSV_STRING_MAX+1, ///< Flat strings store the length (in chars) as an int, and then the subsequent JsVars (in memory) store data
74
74
JSV_NATIVE_STRING=JSV_FLAT_STRING+1, ///< Native strings store an address and length, and reference the underlying data directly
75
-
JSV_UNICODE_STRING=JSV_NATIVE_STRING+1, ///< Unicode just point to a normal string with firstChild, but just tag that the string is a unicode one
75
+
JSV_UTF8_STRING=JSV_NATIVE_STRING+1, ///< UTF8 just point to a normal string with firstChild, but just tag that the string is a unicode one
76
76
#ifdefSPIFLASH_BASE
77
-
JSV_FLASH_STRING=JSV_UNICODE_STRING+1, ///< Like a native String, but not writable and uses jshFlashRead
77
+
JSV_FLASH_STRING=JSV_UTF8_STRING+1, ///< Like a native String, but not writable and uses jshFlashRead
78
78
_JSV_STRING_END=JSV_FLASH_STRING,
79
79
#else
80
80
_JSV_STRING_END=JSV_NATIVE_STRING,
@@ -302,7 +302,7 @@ JsVar *jsvNewFromString(const char *str); ///< Create a new string
302
302
JsVar*jsvNewNameFromString(constchar*str); ///< Create a new name from a string
303
303
JsVar*jsvNewStringOfLength(unsigned intbyteLength, constchar*initialData); ///< Create a new string of the given length - full of 0s (or initialData if specified)
304
304
staticALWAYS_INLINEJsVar*jsvNewFromEmptyString() { returnjsvNewWithFlags(JSV_STRING_0); } ;///< Create a new empty string
305
-
JsVar*jsvNewUnicodeString(JsVar*dataString); ///< Create a new unicode string using the given data string for backing
305
+
JsVar*jsvNewUTF8String(JsVar*dataString); ///< Create a new unicode string using the given data string for backing
306
306
staticALWAYS_INLINEJsVar*jsvNewNull() { returnjsvNewWithFlags(JSV_NULL); } ;///< Create a new null variable
307
307
/** Create a new variable from a substring. argument must be a string. stridx = start char or str, maxLength = max number of characters (can be JSVAPPENDSTRINGVAR_MAXLENGTH) */
voidjsvAppendStringVar(JsVar*var, constJsVar*str, size_tstridx, size_tmaxLength); ///< Append str to var. Both must be strings. stridx = start char or str, maxLength = max number of characters (can be JSVAPPENDSTRINGVAR_MAXLENGTH)
515
515
voidjsvAppendStringVarComplete(JsVar*var, constJsVar*str); ///< Append all of str to var. Both must be strings.
516
-
charjsvGetCharInString(JsVar*v, size_tidx); ///< Get a character at the given index in the String
516
+
intjsvGetCharInString(JsVar*v, size_tidx); ///< Get a character at the given index in the String (handles unicode)
517
517
voidjsvSetCharInString(JsVar*v, size_tidx, charch, boolbitwiseOR); ///< Set a character at the given index in the String. If bitwiseOR, ch will be ORed with the character already at that position.
518
518
intjsvGetStringIndexOf(JsVar*str, charch); ///< Get the index of a character in a string, or -1
0 commit comments