<commit_before>#include "FileReaderMPACK.hpp"

#include "InputResource.hpp"

namespace MVFS
{
	FileReaderMPACK::FileReaderMPACK(const char *pPath)
	{
		m_pInputResource = MPACK::Core::GetInputResource(pPath);
		m_pInputResource->Open();
	}

	FileReaderMPACK::~FileReaderMPACK()
	{
		delete m_pInputResource;
	}

	int FileReaderMPACK::Size()
	{
		return m_pInputResource->GetLength();
	}

	void FileReaderMPACK::Reset()
	{
		m_pInputResource->SetOffset(0);
	}

	void FileReaderMPACK::Read(char *pBuffer, int size)
	{
		m_pInputResource->Read(pBuffer,size);
	}

	void FileReaderMPACK::ReadFrom(int offset, char *pBuffer, int size)
	{
		m_pInputResource->ReadFrom(offset,pBuffer,size);
	}

	void FileReaderMPACK::Skip(int size)
	{
		m_pInputResource->Skip(size);
	}

	int FileReaderMPACK::GetOffset()
	{
		return m_pInputResource->GetOffset();
	}

	void FileReaderMPACK::SetOffset(int offset)
	{
		m_pInputResource->SetOffset(offset);
	}

	FileReaderMPACK* FileReaderMPACK::Open(const char *pPath)
	{
		return new FileReaderMPACK(pPath);
	}
}
<commit_msg>Resources: add sanity check for FileReaderMPACK::Open<commit_after>#include "FileReaderMPACK.hpp"

#include "InputResource.hpp"

namespace MVFS
{
	FileReaderMPACK::FileReaderMPACK(const char *pPath)
	{
		m_pInputResource = MPACK::Core::GetInputResource(pPath);
		m_pInputResource->Open();
	}

	FileReaderMPACK::~FileReaderMPACK()
	{
		delete m_pInputResource;
	}

	int FileReaderMPACK::Size()
	{
		return m_pInputResource->GetLength();
	}

	void FileReaderMPACK::Reset()
	{
		m_pInputResource->SetOffset(0);
	}

	void FileReaderMPACK::Read(char *pBuffer, int size)
	{
		m_pInputResource->Read(pBuffer,size);
	}

	void FileReaderMPACK::ReadFrom(int offset, char *pBuffer, int size)
	{
		m_pInputResource->ReadFrom(offset,pBuffer,size);
	}

	void FileReaderMPACK::Skip(int size)
	{
		m_pInputResource->Skip(size);
	}

	int FileReaderMPACK::GetOffset()
	{
		return m_pInputResource->GetOffset();
	}

	void FileReaderMPACK::SetOffset(int offset)
	{
		m_pInputResource->SetOffset(offset);
	}

	FileReaderMPACK* FileReaderMPACK::Open(const char *pPath)
	{
		FileReaderMPACK *fileReaderMPACK = new FileReaderMPACK(pPath);
		if(fileReaderMPACK)
		{
			return fileReaderMPACK;
		}
		LOGE("FileReaderMPACK::Open fileReaderMPACK is NULL");
		return NULL;
	}
}

{'fraction_non_alphanumeric': 0.12690134724033028, 'fraction_numerical': 0.000869187309865276, 'mean_word_length': 5.892215568862276, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6197340', 'n_tokens_mistral': 901, 'n_tokens_neox': 852, 'n_words': 125}