Ejemplo n.º 1
0
            public Encoder(Base16Settings settings)
            {
                if (settings == null)
                {
                    throw new ArgumentNullException(nameof(settings));
                }

                _encoder = new Base16Encoder(settings);
            }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructs a new instance of the <see cref="Base16Codec"/> with the specified settings.
        /// </summary>
        /// <param name="settings">The <see cref="Base16Settings"/> that determine how the instance operates.</param>
        /// <exception cref="ArgumentNullException">The <paramref name="settings"/> parameter is <c>null</c>.</exception>
        public Base16Codec(Base16Settings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            Settings = settings.ToReadOnly();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates a new instance of the class with settings supplied by <paramref name="inheritedSettings"/>.
        /// </summary>
        /// <param name="inheritedSettings">The settings to duplicate.</param>
        /// <exception cref="ArgumentNullException"><paramref name="inheritedSettings"/> is <c>null</c>.</exception>
        public Base16Settings(Base16Settings inheritedSettings)
            : this(true)
        {
            if (inheritedSettings == null)
            {
                throw new ArgumentNullException(nameof(inheritedSettings));
            }

            InheritSettings(inheritedSettings);
        }
Ejemplo n.º 4
0
            public Base16Decoder(Base16Settings settings)
            {
                if (settings == null)
                {
                    throw new ArgumentNullException(nameof(settings));
                }

                // initialize all fields to default values..
                this = default;

                settings.GetDecoderSettings(
                    out _decodingTable,
                    out _decodingAffixTable,
                    out _decodingPrefixes,
                    out _decodingPostfixes,
                    out _flags
                    );

                Reset();
            }
Ejemplo n.º 5
0
            public Base16Encoder(Base16Settings settings)
            {
                if (settings == null)
                {
                    throw new ArgumentNullException(nameof(settings));
                }

                // initialize all fields to defaults..
                this = default;

                settings.GetEncoderSettings(
                    out _alphabet,
                    out _flags,
                    out _lineSeparator,
                    out _maximumLineLength,
                    out _initialAffix,
                    out _finalAffix
                    );

                Reset();
            }
Ejemplo n.º 6
0
 private Base16Settings(Base16Settings inheritedSettings, bool isProtected)
     : this(inheritedSettings)
 {
     IsProtected = isProtected;
 }
Ejemplo n.º 7
0
 public Decoder(Base16Settings settings)
 {
     _codecDecoder = new Base16Decoder(settings);
 }