コード例 #1
0
        public static ParsedJsonN ParseJson(byte *jsonDataPtr, long jsonDataLength, bool reallocifneeded = true)
        {
            ParsedJsonN pj = new ParsedJsonN();
            bool        ok = pj.AllocateCapacity((uint)jsonDataLength, 1024);

            if (ok)
            {
                JsonParse(jsonDataPtr, jsonDataLength, pj, reallocifneeded);
            }
            else
            {
                throw new InvalidOperationException("failure during memory allocation");
            }
            return(pj);
        }
コード例 #2
0
ファイル: Bindings.cs プロジェクト: liyic/SimdJsonSharp
        public static ParsedJsonN ParseJson(byte *jsonDataPtr, int jsonDataLength, bool reallocifneeded = true)
        {
            ParsedJsonN pj = new ParsedJsonN();
            bool        ok = pj.AllocateCapacity((uint32_t)jsonDataLength);

            if (ok)
            {
                Global_json_parse(jsonDataPtr, (size_t)jsonDataLength, pj.Handle, reallocifneeded);
            }
            else
            {
                throw new InvalidOperationException("failure during memory allocation");
            }
            return(pj);
        }