/*
 * Copyright © 2021-2026 Pierrick Caillon <pierrick.caillon+zipdirfs@megami.fr>
 */
#ifndef ZIPDIRFS_COMPONENTS_ENTRYLISTPROXYPROXY_H
#define ZIPDIRFS_COMPONENTS_ENTRYLISTPROXYPROXY_H

#include "ZipDirFs/Containers/Helpers/EntryListProxy.h"
#include <memory>

namespace ZipDirFs::Components
{
	/**
	 * @brief A proxy to an @link ZipDirFs::Containers::Helpers::EntryListProxy Entry List Proxy
	 * @endlink
	 * @remarks Used to change the underlying helper for all references.
	 * @authors Pierrick Caillon <pierrick.caillon+zipdirfs@megami.fr>
	 */
	class EntryListProxyProxy : public Containers::Helpers::EntryListProxy
	{
	public:
		typedef std::unique_ptr<EntryListProxy> parent_ptr;
		EntryListProxyProxy(parent_ptr&&);
		void swap(parent_ptr&);
		iterator begin() override;
		iterator end() override;
		iterator insert(iterator, const key_type&, const mapped_type&) override;
		iterator erase(iterator) override;
		[[nodiscard]] mapped_type find(const key_type& name) const override;

	private:
		parent_ptr entryListProxy;
	};

} // namespace ZipDirFs::Components

#endif // ZIPDIRFS_COMPONENTS_ENTRYLISTPROXYPROXY_H
