Loads the field *value* for each :class:`Field` *nested* in the
        `Container` from an ``.ini`` *file*.

        :param str file: name and location of the ``.ini`` *file*.
        :keyword str section: section in the ``.ini`` *file* to lookup the
            value for each :class:`Field` in the `Container`.
            If no *section* is specified the class name of the instance is used.
        :keyword bool nested: if ``True`` all :class:`Pointer` fields in the
            `Container` load their referenced :attr:`~Pointer.data` object
            field valus as well (chained method call).
        :keyword bool verbose: if ``True`` the loading is executed in verbose
            mode.

        File `foo.ini`:

        .. code-block:: ini

            [Foo]
            stream =
            float = 0.0
            structure.decimal = 0
            array[0] = 0x0
            array[1] = 0x0
            array[2] = 0x0
            pointer = 0x0

        Example:

        >>> class Foo(Structure):
        ...     def __init__(self):
        ...         super().__init__()
        ...         self.stream = Stream()
        ...         self.float = Float()
        ...         self.structure = Structure()
        ...         self.structure.decimal = Decimal(8)
        ...         self.array = Array(Byte, 3)
        ...         self.pointer = Pointer()
        >>> foo = Foo()
        >>> foo.load('foo.ini')
        [Foo]
        Foo.stream =
        Foo.float = 0.0
        Foo.structure.decimal = 0
        Foo.array[0] = 0x0
        Foo.array[1] = 0x0
        Foo.array[2] = 0x0
        Foo.pointer = 0x0
        >>> foo.to_list(nested=True)
        [('Foo.stream', ''),
         ('Foo.float', 0.0),
         ('Foo.structure.decimal', 0),
         ('Foo.array[0]', '0x0'),
         ('Foo.array[1]', '0x0'),
         ('Foo.array[2]', '0x0'),
         ('Foo.pointer', '0x0')]
        >>> foo.to_json(nested=True)
        '{"stream": "",
          "float": 0.0,
          "structure": {"decimal": 0},
          "array": ["0x0", "0x0", "0x0"],
          "pointer": {"value": "0x0",
                      "data": null}}'

def load(self, file, **options):
        """ Loads the field *value* for each :class:`Field` *nested* in the
        `Container` from an ``.ini`` *file*.

        :param str file: name and location of the ``.ini`` *file*.
        :keyword str section: section in the ``.ini`` *file* to lookup the
            value for each :class:`Field` in the `Container`.
            If no *section* is specified the class name of the instance is used.
        :keyword bool nested: if ``True`` all :class:`Pointer` fields in the
            `Container` load their referenced :attr:`~Pointer.data` object
            field valus as well (chained method call).
        :keyword bool verbose: if ``True`` the loading is executed in verbose
            mode.

        File `foo.ini`:

        .. code-block:: ini

            [Foo]
            stream =
            float = 0.0
            structure.decimal = 0
            array[0] = 0x0
            array[1] = 0x0
            array[2] = 0x0
            pointer = 0x0

        Example:

        >>> class Foo(Structure):
        ...     def __init__(self):
        ...         super().__init__()
        ...         self.stream = Stream()
        ...         self.float = Float()
        ...         self.structure = Structure()
        ...         self.structure.decimal = Decimal(8)
        ...         self.array = Array(Byte, 3)
        ...         self.pointer = Pointer()
        >>> foo = Foo()
        >>> foo.load('foo.ini')
        [Foo]
        Foo.stream =
        Foo.float = 0.0
        Foo.structure.decimal = 0
        Foo.array[0] = 0x0
        Foo.array[1] = 0x0
        Foo.array[2] = 0x0
        Foo.pointer = 0x0
        >>> foo.to_list(nested=True)
        [('Foo.stream', ''),
         ('Foo.float', 0.0),
         ('Foo.structure.decimal', 0),
         ('Foo.array[0]', '0x0'),
         ('Foo.array[1]', '0x0'),
         ('Foo.array[2]', '0x0'),
         ('Foo.pointer', '0x0')]
        >>> foo.to_json(nested=True)
        '{"stream": "",
          "float": 0.0,
          "structure": {"decimal": 0},
          "array": ["0x0", "0x0", "0x0"],
          "pointer": {"value": "0x0",
                      "data": null}}'
        """
        section = options.pop('section', self.__class__.__name__)

        parser = ConfigParser()
        parser.read(file)

        if parser.has_section(section):
            verbose(options, "[{0}]".format(section))

            for field_path, field in self.field_items(**options):
                if field_path.startswith('['):
                    # Sequence element
                    option = '_' + field_path
                else:
                    option = field_path
                if parser.has_option(section, option):
                    # Bool fields
                    if field.is_bool():
                        field.value = parser.getboolean(section, option)
                    # Float fields
                    elif field.is_float():
                        field.value = parser.getfloat(section, option)
                    # String fields
                    elif field.is_string():
                        field.value = parser.get(section, option)
                    # Stream fields
                    elif field.is_stream():
                        value = parser.get(section, option)
                        stream = bytes.fromhex(value.replace("'", ""))
                        # Auto size a zero sized stream field to the current length
                        if not field:
                            field.resize(len(stream))
                        field.value = stream
                    # Decimal fields
                    else:
                        field.value = parser.get(section, option)
                    if field_path.startswith('['):
                        verbose(options,
                                "{0}{1} = {2}".format(section,
                                                      field_path,
                                                      field.value))
                    else:
                        verbose(options,
                                "{0}.{1} = {2}".format(section,
                                                       field_path,
                                                       field.value))
        else:
            verbose(options, "No section [{0}] found.".format(section))