#pragma once
#include "Workspace.h"
#include "SortArray.h"

class CMimeTypeMgr
{
public:
	class CFilter
	{
	public:
		CString	m_filter;
		CString	m_data;
	};
	typedef CSortArray<CFilter,CFilter &>	CFilterArray;


	CMimeTypeMgr();
	virtual ~CMimeTypeMgr(void);
	void Load(CWorkspaceAccess serverSetting);

	CString GetMimeTypeByName(CString name);	//	ファイル名からMIMEタイプを取得
	CString	GetIconPathByName(CString name);	//	ファイル名からアイコンを取得

protected:
	void LoadMime(void);
	void LoadIcon(void);

	CString	m_oldExt,m_oldType;

public:
	CWorkspaceAccess	m_serverSetting;
	CWorkspaceAccess	m_mimeTypeSetting;
	CWorkspaceAccess	m_iconTypeSetting;

	CFilterArray	m_mimeFilter;
	CFilterArray	m_iconFilter;
};
