/// <summary> /// Creates a JSString wrapper from a JS string pointer. /// If the pointer is zero, null is returned. /// </summary> public static JSString New(JSContextPtr context, JSStringPtr str) { if (str.IsZero) { return(null); } return(new JSString(context, str)); }
/// <summary> /// Wraps existing reference and roots it. /// </summary> /// <param name="context"></param> /// <param name="str"></param> public JSString( JSContextPtr context, JSStringPtr str ) { if (context.IsZero) { throw new ArgumentNullException("context"); } Context = context; Root = new Rooted <JSStringPtr>(Context, str); }
public bool TryGetNested(out JSStringPtr result, params string[] propertyNames) { JS.Value temp; if (TryGetNested(out temp, propertyNames)) { if (temp.ValueType == JSValueType.STRING) { result = temp.AsString; return(true); } } result = default(JSStringPtr); return(false); }
/// <summary> /// WARNING: Make sure this string is already rooted! /// </summary> /// <param name="s"></param> public Value(JSStringPtr s) { this = default(Value); tag = JSValueTag.STRING; packed.str = s; }