Example #1
0
        public ParameterInf(AbstractBufferedReader reader, IFieldHandlerFactory fieldHandlerFactory)
        {
            _name = reader.ReadString();
            var handlerName = reader.ReadString();

            _fieldHandler = fieldHandlerFactory.CreateFromName(handlerName, reader.ReadByteArray(), FieldHandlerOptions.None);
        }
Example #2
0
        public static IFieldHandler CreateFromReader(this IFieldHandlerFactory factory, AbstractBufferedReader reader, FieldHandlerOptions options)
        {
            var handlerName          = reader.ReadString();
            var handlerConfiguration = reader.ReadByteArray();

            return(factory.CreateFromName(handlerName, handlerConfiguration, options));
        }
Example #3
0
        internal static UnresolvedTableFieldInfo Load(AbstractBufferedReader reader,
                                                      string tableName, FieldHandlerOptions handlerOptions)
        {
            var name          = reader.ReadString();
            var handlerName   = reader.ReadString();
            var configuration = reader.ReadByteArray();

            return(new UnresolvedTableFieldInfo(name, handlerName, configuration, tableName, handlerOptions));
        }
Example #4
0
        internal static TableFieldInfo Load(AbstractBufferedReader reader, IFieldHandlerFactory fieldHandlerFactory, string tableName)
        {
            var name          = reader.ReadString();
            var handlerName   = reader.ReadString();
            var configuration = reader.ReadByteArray();
            var fieldHandler  = fieldHandlerFactory.CreateFromName(tableName, name, handlerName, configuration);

            if (fieldHandler == null)
            {
                throw new BTDBException(string.Format("FieldHandlerFactory did not created handler {0} in {1}.{2}", handlerName, tableName, name));
            }
            return(new TableFieldInfo(name, fieldHandler));
        }
Example #5
0
            public EncryptedString LoadEncryptedString()
            {
                var cipher = _mapping.GetSymmetricCipher();
                var enc    = _reader.ReadByteArray();
                var size   = cipher !.CalcPlainSizeFor(enc);
                var dec    = new byte[size];

                if (!cipher.Decrypt(enc, dec))
                {
                    throw new CryptographicException();
                }
                var r = new ByteArrayReader(dec);

                return(r.ReadString());
            }
Example #6
0
        internal static TableFieldInfo Load(AbstractBufferedReader reader, IFieldHandlerFactory fieldHandlerFactory,
                                            string tableName, FieldHandlerOptions handlerOptions)
        {
            var name          = reader.ReadString();
            var handlerName   = reader.ReadString();
            var configuration = reader.ReadByteArray();
            var fieldHandler  = fieldHandlerFactory.CreateFromName(handlerName !, configuration, handlerOptions);

            if (fieldHandler == null)
            {
                throw new BTDBException(
                          $"FieldHandlerFactory did not created handler {handlerName} in {tableName}.{name}");
            }
            return(new TableFieldInfo(name !, fieldHandler));
        }
Example #7
0
        public MethodInf(AbstractBufferedReader reader, IFieldHandlerFactory fieldHandlerFactory)
        {
            _name      = reader.ReadString();
            _ifaceName = reader.ReadString();
            var resultFieldHandlerName = reader.ReadString();

            if (resultFieldHandlerName != null)
            {
                _resultFieldHandler = fieldHandlerFactory.CreateFromName(resultFieldHandlerName, reader.ReadByteArray(), FieldHandlerOptions.None);
            }
            var parameterCount = reader.ReadVUInt32();

            _parameters = new ParameterInf[parameterCount];
            for (int i = 0; i < _parameters.Length; i++)
            {
                _parameters[i] = new ParameterInf(reader, fieldHandlerFactory);
            }
        }