Kaynağa Gözat

Delete core/compressors

Daniele Bartolini 11 yıl önce
ebeveyn
işleme
69028bf92f

+ 0 - 64
engine/core/compressors/compressor.h

@@ -1,64 +0,0 @@
-/*
-Copyright (c) 2013 Daniele Bartolini, Michele Rossi
-Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#pragma once
-
-#include "types.h"
-#include "allocator.h"
-
-namespace crown
-{
-
-class Compressor
-{
-public:
-						Compressor(Allocator& allocator);
-	virtual 			~Compressor() {}
-
-	/// Compresses the data pointed by @a data of size @a in_size (in bytes) and returns it.
-	/// The function also returns the size in bytes of the compressed data in @a out_size.
-	/// @note
-	/// The returned data is automatically allocated using the passed allocator.
-	virtual uint8_t* 	compress(const void* data, size_t in_size, size_t& out_size) = 0;
-
-	/// Uncompresses the data pointed by @a data of size @a in_size (in bytes) and returns it.
-	/// The function also returns the size in bytes of the uncompressed data in @a out_size.
-	/// @note
-	/// The returned data is automatically allocated using the passed allocator.
-	virtual uint8_t* 	uncompress(const void* data, size_t in_size, size_t& out_size) = 0;
-
-protected:
-
-	Allocator& 			m_allocator;
-};
-
-//-----------------------------------------------------------------------------
-inline Compressor::Compressor(Allocator& allocator) :
-	m_allocator(allocator)
-{
-}
-
-} // namespace crown

+ 0 - 60
engine/core/compressors/zip_compressor.cpp

@@ -1,60 +0,0 @@
-/*
-Copyright (c) 2013 Daniele Bartolini, Michele Rossi
-Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#include <cstring>
-
-//#include "zlib.h"
-#include "assert.h"
-#include "zip_compressor.h"
-
-namespace crown
-{
-
-//-----------------------------------------------------------------------------
-ZipCompressor::ZipCompressor(Allocator& allocator) :
-	Compressor(allocator)
-{
-}
-
-//-----------------------------------------------------------------------------
-ZipCompressor::~ZipCompressor()
-{
-}
-
-//-----------------------------------------------------------------------------
-uint8_t* ZipCompressor::compress(const void* /*data*/, size_t /*in_size*/, size_t& /*out_size*/)
-{
-	return NULL;
-}
-
-//-----------------------------------------------------------------------------
-uint8_t* ZipCompressor::uncompress(const void* /*data*/, size_t /*in_size*/, size_t& /*out_size*/)
-{
-	return NULL;
-}
-
-} // namespace crown
-

+ 0 - 49
engine/core/compressors/zip_compressor.h

@@ -1,49 +0,0 @@
-/*
-Copyright (c) 2013 Daniele Bartolini, Michele Rossi
-Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#pragma once
-
-#include "compressor.h"
-
-namespace crown
-{
-
-/// Generic data compressor which uses zlib.
-class ZipCompressor : public Compressor
-{
-public:
-
-				ZipCompressor(Allocator& allocator);
-				~ZipCompressor();
-
-	/// @copydoc Compressor::compress()
-	uint8_t* 	compress(const void* data, size_t in_size, size_t& out_size);
-
-	/// @copydoc Compressor::uncompress()
-	uint8_t* 	uncompress(const void* data, size_t in_size, size_t& out_size);
-};
-
-} // namespace crown

+ 0 - 65
engine/core/filesystem/file.cpp

@@ -1,65 +0,0 @@
-/*
-Copyright (c) 2013 Daniele Bartolini, Michele Rossi
-Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#include "file.h"
-#include "types.h"
-#include "compressor.h"
-#include "memory.h"
-
-namespace crown
-{
-
-//-----------------------------------------------------------------------------
-bool File::compress_to(File& file, size_t size, size_t& zipped_size, Compressor& compressor)
-{
-	void* in_buffer = (void*) default_allocator().allocate(size);
-
-	read(in_buffer, size);
-
-	void* compressed_buffer = compressor.compress(in_buffer, size, zipped_size);
-
-	file.write(compressed_buffer, zipped_size);
-
-	return true;
-}
-
-//-----------------------------------------------------------------------------
-bool File::uncompress_to(File& file, size_t& unzipped_size, Compressor& compressor)
-{
-	size_t file_size = size();
-	void* in_buffer = (void*) default_allocator().allocate(file_size);
-
-	read(in_buffer, file_size);
-
-	void* uncompressed_buffer = compressor.uncompress(in_buffer, file_size, unzipped_size);
-
-	file.write(uncompressed_buffer, unzipped_size);
-
-	return true;
-}
-
-} // namespace crown
-

+ 0 - 6
engine/core/filesystem/file.h

@@ -74,12 +74,6 @@ public:
 	/// Copies a chunk of 'size' bytes of data from this to another file.
 	virtual bool copy_to(File& file, size_t size = 0) = 0;
 
-	/// Zips a chunk of 'size' bytes of data from this to another file using compressor.
-	virtual bool compress_to(File& file, size_t size, size_t& compressed_size, Compressor& compressor);
-
-	/// Unzip a zipped file of data from this to another file using compressor.
-	virtual bool uncompress_to(File& file, size_t& uncompressed_size, Compressor& compressor);
-
 	/// Forces the previouses write operations to complete.
 	/// Generally, when a File is attached to a file,
 	/// write operations are not performed instantly, the output data

+ 0 - 1
premake/premake4.lua

@@ -145,7 +145,6 @@ solution "crown"
 			CROWN_SOURCE_DIR .. "/engine",
 			CROWN_SOURCE_DIR .. "/engine/core",
 			CROWN_SOURCE_DIR .. "/engine/core/bv",
-			CROWN_SOURCE_DIR .. "/engine/core/compressors",
 			CROWN_SOURCE_DIR .. "/engine/core/containers",
 			CROWN_SOURCE_DIR .. "/engine/core/filesystem",
 			CROWN_SOURCE_DIR .. "/engine/core/json",