コード例 #1
0
        public unsafe object Decode(Type objtype)
        {
            fixed(char *p = json)
            {
                if (objtype != null)
                {
                    if (CheckForTypeInJson(p) == false)
                    {
                        _parseJsonType = true;
                        SetupLookup();

                        BuildLookup(objtype);

                        // reset if no properties found
                        if (_parseJsonType == false || _lookup.Count() == 7)
                        {
                            _lookup = null;
                        }
                    }
                }
                var retV = ParseValue(p);

                SkipWhitespace(p);
                if (index != _len)
                {
                    throw new Exception($"Invalid character '{ p[index] }' at index { index }");
                }
                return(retV);
            }
        }
コード例 #2
0
        internal bool IsTypeRegistered(Type t)
        {
            if (_customSerializer.Count() == 0)
            {
                return(false);
            }
            Serialize s;

            return(_customSerializer.TryGetValue(t, out s));
        }
コード例 #3
0
ファイル: JsonParser.cs プロジェクト: WONGRUI/fastJSON
        public unsafe object Decode(Type objtype)
        {
            fixed(char *p = json)
            {
                if (objtype != null)
                {
                    if (CheckForTypeInJson(p) == false)
                    {
                        _parseJsonType = true;
                        SetupLookup();

                        BuildLookup(objtype);

                        // reset if no properties found
                        if (_parseJsonType == false || _lookup.Count() == 7)
                        {
                            _lookup = null;
                        }
                    }
                }
                return(ParseValue(p));
            }
        }