Exemplo n.º 1
0
        public JValue QueryCopy(string path, out string foundPath)
        {
            object cpy = CSOCore.QueryRef(content, path, out foundPath, sep).DeepClone();

            if (cpy is JLeaf jl)
            {
                return(jl);
            }
            else
            {
                if (cpy is StringContainer sc)
                {
                    return(JObject.CreateFromRef(sc));
                }
                else
                {
                    return(JArray.CreateFromRef((ArrayContainer)cpy));
                }
            }
        }
Exemplo n.º 2
0
        public JValue Query(string path, out string foundPath)
        {
            if (!validPath(path))
            {
                throw new Exception("Illegal path");
            }
            object ptr = CSOCore.QueryRef(content, path, out foundPath, sep);

            if (ptr is JLeaf jl)
            {
                return(jl);
            }
            else
            {
                if (ptr is StringContainer sc)
                {
                    return(JObject.CreateFromRef(sc));
                }
                else
                {
                    return(JArray.CreateFromRef((ArrayContainer)ptr));
                }
            }
        }