<commit_before>#include "stdafx.h"
#include "Storage.h"


Storage::Storage()
{
}


FoneOSString Storage::GetBasePath()
{
    char * prefPath;
#ifdef SIMULATOR_BUILD
    prefPath = SDL_GetPrefPath("Flippers", "foneOS");
#else
    prefPath = "/fone/";
#endif
	FoneOSString prefPathStr;

	prefPathStr = Utils::CharArrayToFoneOSString(prefPath);

	return prefPathStr;
}


FoneOSString Storage::GetFullPath(FoneOSString baseStr)
{
	return Storage::GetBasePath() + baseStr;
}


bool Storage::FileExists(FoneOSString fileName)
{
	std::ifstream test(Storage::GetFullPath(fileName));
	bool resp = test.good();
	test.close();
	return resp;
}


bool Storage::RemoveFile(FoneOSString fileName)
{
	// "Why isn't this called DeleteFile?"
	// "Because then Windows' macros would change it to DeleteFileW."<commit_msg>Change pref path organization name<commit_after>#include "stdafx.h"
#include "Storage.h"


Storage::Storage()
{
}


FoneOSString Storage::GetBasePath()
{
    char * prefPath;
#ifdef SIMULATOR_BUILD
    prefPath = SDL_GetPrefPath("foneOS", "foneOS");
#else
    prefPath = "/fone/";
#endif
	FoneOSString prefPathStr;

	prefPathStr = Utils::CharArrayToFoneOSString(prefPath);

	return prefPathStr;
}


FoneOSString Storage::GetFullPath(FoneOSString baseStr)
{
	return Storage::GetBasePath() + baseStr;
}


bool Storage::FileExists(FoneOSString fileName)
{
	std::ifstream test(Storage::GetFullPath(fileName));
	bool resp = test.good();
	test.close();
	return resp;
}


bool Storage::RemoveFile(FoneOSString fileName)
{
	// "Why isn't this called DeleteFile?"
	// "Because then Windows' macros would change it to DeleteFileW."
{'fraction_non_alphanumeric': 0.12939001848428835, 'fraction_numerical': 0.0, 'mean_word_length': 5.683127572016461, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6567821', 'n_tokens_mistral': 575, 'n_tokens_neox': 565, 'n_words': 119}