Пример #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
        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));
            }
        }