Click here to Skip to main content
15,886,689 members
Articles / Programming Languages / C#

Managed C++ wrapper for ZLib

Rate me:
Please Sign up or sign in to vote.
4.56/5 (14 votes)
3 Mar 2005CPOL9 min read 155.2K   5.7K   46  
.NET wrapper for ZLib, written in MC++
/*
http://www.developdotnet.com

File Created by: Alberto Ferrazzoli
Date: 06/06/2004

Description:
Implements a collection of ZipFile

Notes:

Revision Log - Please mark significant changes in source code in the following format:

Date  -  Time -  Reviewer  -  Comments

*/

#pragma once

#include "ZipEntry.h"

using namespace System::Collections;
using namespace System::Reflection;

namespace DevelopDotNet
{
	namespace Compression
	{
		//
		// class ZipEntryCollection
		//
		[DefaultMember(S"Item")] 
		public __gc class ZipEntryCollection : public ICollection
		{
		public private:
			ZipEntryCollection(ZipArchive* archive);

			// Properties
		public:
			__property int get_Count() { return _zipEntries->Count; }
			__property Object* get_SyncRoot() { return _zipEntries->SyncRoot; }
			__property bool get_IsSynchronized() { return _zipEntries->IsSynchronized; }

			__property ZipEntry* get_Item(int index) { return static_cast<ZipEntry*>(_zipEntries->Item[index]); }
			__property void set_Item(int index, ZipEntry* obj) { _zipEntries->set_Item(index, obj); }

			// Methods
		public:
			IEnumerator* GetEnumerator();
			void CopyTo(System::Array __gc * array, int start);
			void CopyTo(ZipEntry* entries __gc [], int start);

			int Add(ZipEntry* entry);
			int Add(ZipEntry* entry, bool recursive);
			
			void Remove(ZipEntry* entry);
			void Remove(ZipEntry* entry, bool recursive);
			
			void ExtractTo(ZipEntry* entry, String* path);
			void ExtractTo(ZipEntry* entry, String* path, bool recursive);
			
			bool Test(ZipEntry* entry);
			bool Test(ZipEntry* entry, bool recursive);

			int IndexOf(String* file);
			int IndexOf(ZipEntry* entry);

		private public:
			ArrayList* GetZipEntries() { return _zipEntries; }

		private:
			ZipArchive* _archive;
			ArrayList* _zipEntries;
		};
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
Italy Italy
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions