def _add_joliet_dir(self, joliet_path):
        # type: (bytes) -> int
        '''
        An internal method to add a joliet directory to the ISO.

        Parameters:
         joliet_path - The path to add to the Joliet portion of the ISO.
        Returns:
         The number of additional bytes needed on the ISO to fit this directory.
        '''

        if self.joliet_vd is None:
            raise pycdlibexception.PyCdlibInternalError('Tried to add joliet dir to non-Joliet ISO')

        (joliet_name, joliet_parent) = self._joliet_name_and_parent_from_path(joliet_path)

        log_block_size = self.joliet_vd.logical_block_size()

        rec = dr.DirectoryRecord()
        rec.new_dir(self.joliet_vd, joliet_name, joliet_parent,
                    self.joliet_vd.sequence_number(), '', b'',
                    log_block_size, False, False,
                    False, -1)
        num_bytes_to_add = self._add_child_to_dr(rec, log_block_size)

        self._create_dot(self.joliet_vd, rec, '', False, -1)
        self._create_dotdot(self.joliet_vd, rec, '', False, False, -1)

        num_bytes_to_add += log_block_size
        if self.joliet_vd.add_to_ptr_size(path_table_record.PathTableRecord.record_length(len(joliet_name))):
            num_bytes_to_add += 4 * log_block_size

        # We always need to add an entry to the path table record
        ptr = path_table_record.PathTableRecord()
        ptr.new_dir(joliet_name)
        rec.set_ptr(ptr)

        return num_bytes_to_add
An internal method to add a joliet directory to the ISO.

        Parameters:
         joliet_path - The path to add to the Joliet portion of the ISO.
        Returns:
         The number of additional bytes needed on the ISO to fit this directory.