#pragma once

namespace Mix{ namespace Tool{

	public ref class Archiver
	{
	public:
		delegate void DelegatePreCreate( unsigned int fileCount, unsigned long long totalFileSze, unsigned long long totalSize );
		delegate void DelegateProcessFile( System::String^ name, unsigned int size );
		delegate void DelegateUpdateFileProgress( int progress );
		delegate void DelegateUpdateTotalProgress( int progress );
		delegate void DelegateEnd( void );

	private:
		System::String^ m_RootDirectoryName;
		System::String^ m_InputDirectoryName;
		System::String^ m_OutputFileName;
		unsigned int m_Alignment;
		unsigned int m_TemporaryBufferSize;

		DelegatePreCreate^ preCreate;
		DelegateProcessFile^ processFile;
		DelegateUpdateFileProgress^ updateFileProgress;
		DelegateUpdateTotalProgress^ updateTotalProgress;
		DelegateEnd^ end;

	public:
		property System::String^ RootDirectoryName
		{
			System::String^ get( void );
			void set( System::String^ value );
		}

		property System::String^ InputDirectoryName
		{
			System::String^ get( void );
			void set( System::String^ value );
		}

		property System::String^ OutputFileName
		{
			System::String^ get( void );
			void set( System::String^ value );
		}

		property unsigned int Alignment
		{
			unsigned int get( void );
			void set( unsigned int alignment );
		}

		property unsigned int TemporaryBufferSize
		{
			unsigned int get( void );
			void set( unsigned int alignment );
		}

		property DelegatePreCreate^ PreCreate
		{
			void set( DelegatePreCreate^ value );
		}

		property DelegateProcessFile^ ProcessFile
		{
			void set( DelegateProcessFile^ value );
		}

		property DelegateUpdateFileProgress^ UpdateFileProgress
		{
			void set( DelegateUpdateFileProgress^ value );
		}

		property DelegateUpdateTotalProgress^ UpdateTotalProgress
		{
			void set( DelegateUpdateTotalProgress^ value );
		}

		property DelegateEnd^ End
		{
			void set( DelegateEnd^ value );
		}

	public:
		Archiver( void );

	public:
		void Run( void );
	};

}}
