Exemplo n.º 1
0
        public DatabaseItemType GetNextType()
        {
            if (_currentType != null)
            {
                var currentType = _currentType.Value;
                _currentType = null;

                return(currentType);
            }

            var type = ReadType();

            if (type == null)
            {
                return(DatabaseItemType.None);
            }

            while (type.Equals("Transformers", StringComparison.OrdinalIgnoreCase))
            {
                SkipArray();
                type = ReadType();
                if (type == null)
                {
                    break;
                }
            }

            return(GetType(type));
        }
Exemplo n.º 2
0
        public DatabaseItemType GetNextType()
        {
            if (_currentType != null)
            {
                var currentType = _currentType.Value;
                _currentType = null;

                return(currentType);
            }

            var type       = ReadType();
            var dbItemType = GetType(type);

            while (dbItemType == DatabaseItemType.Unknown)
            {
                var msg = $"You are trying to import items of type '{type}' which is unknown or not supported in {RavenVersionAttribute.Instance.Version}. Ignoring items.";
                if (_log.IsOperationsEnabled)
                {
                    _log.Operations(msg);
                }
                _result.AddWarning(msg);

                SkipArray(onSkipped: null, token: CancellationToken.None);
                type       = ReadType();
                dbItemType = GetType(type);
            }

            return(dbItemType);
        }
Exemplo n.º 3
0
        public DatabaseItemType GetNextType()
        {
            if (_currentType != null)
            {
                var currentType = _currentType.Value;
                _currentType = null;

                return(currentType);
            }

            var type       = ReadType();
            var dbItemType = GetType(type);

            while (dbItemType == DatabaseItemType.Unknown)
            {
                var msg = $"You are trying to import items of type '{type}' which is unknown or not supported in 4.0. Ignoring items.";
                if (_log.IsOperationsEnabled)
                {
                    _log.Operations(msg);
                }
                _result.AddWarning(msg);

                SkipArray();
                type       = ReadType();
                dbItemType = GetType(type);
            }

            return(dbItemType);
        }
Exemplo n.º 4
0
        private long ReadBuildVersion()
        {
            var type = ReadType();

            if (type == null)
            {
                return(0);
            }

            if (type.Equals("BuildVersion", StringComparison.OrdinalIgnoreCase) == false)
            {
                _currentType = GetType(type);
                return(0);
            }

            if (UnmanagedJsonParserHelper.Read(_peepingTomStream, _parser, _state, _buffer) == false)
            {
                UnmanagedJsonParserHelper.ThrowInvalidJson("Unexpected end of json.", _peepingTomStream, _parser);
            }

            if (_state.CurrentTokenType != JsonParserToken.Integer)
            {
                UnmanagedJsonParserHelper.ThrowInvalidJson("Expected integer BuildVersion, but got " + _state.CurrentTokenType, _peepingTomStream, _parser);
            }

            return(_state.Long);
        }