<commit_before>#ifndef FILEHANDLER_H
#define FILEHANDLER_H
#define WINDOWS 1
#define UNIX 2
#ifdef _WIN32
    #include <windows.h>
    #include "stringhelper.h"
#elif __APPLE__
#endif
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <mutex>
#include "project.h"
#include "dir.h"

#ifdef _WIN32
    #define WORKSPACE "C:/"
#elif __APPLE__
    #define WORKSPACE "/Applications"
#endif
typedef int FH_ERROR;
typedef int ID;
struct Project; // fix for include issue
class FileHandler
{
public:
    FileHandler();
    std::string workSpace;
    //
    //  Project manipulation
    //
    Project* openProject(std::string dirpath);
    Project* createProject(std::string projName);

    void saveProject(Project* proj);
    Project* loadProject(std::string filePath);
    void addVideo(Project* proj, std::string filePath);
    void extract_proj_obj(std::string line);
    FH_ERROR deleteProject(Project* proj);
    //varying implementation
    ID createDirectory(std::string dirpath);
    FH_ERROR deleteDirectory(std::string dirpath);

    ID createFile(std::string filename, ID dirID);
    FH_ERROR deleteFile(ID id);<commit_msg>added comments<commit_after>#ifndef FILEHANDLER_H
#define FILEHANDLER_H
#define WINDOWS 1
#define UNIX 2
#ifdef _WIN32
    #include <windows.h>
    #include "stringhelper.h"
#elif __APPLE__
#endif
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <mutex>
#include "project.h"
#include "dir.h"

#ifdef _WIN32
    #define WORKSPACE "C:/"
#elif __APPLE__
    #define WORKSPACE "/Applications"
#endif

typedef int FH_ERROR; // file handler error code
typedef int ID;
struct Project; // fix for include issue
class FileHandler
{
public:
    FileHandler();
    std::string workSpace;
    //
    //  Project manipulation
    //
    Project* openProject(std::string dirpath);
    Project* createProject(std::string projName);

    void saveProject(Project* proj);
    Project* loadProject(std::string filePath);
    void addVideo(Project* proj, std::string filePath);
    void extract_proj_obj(std::string line);
    FH_ERROR deleteProject(Project* proj);
    //varying implementation
    ID createDirectory(std::string dirpath);
    FH_ERROR deleteDirectory(std::string dirpath);

    ID createFile(std::string filename, ID dirID);
    FH_ERROR deleteFile(ID id);
{'fraction_non_alphanumeric': 0.11229264142917907, 'fraction_numerical': 0.005104210974053594, 'mean_word_length': 4.444444444444445, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '2736938', 'n_tokens_mistral': 778, 'n_tokens_neox': 741, 'n_words': 210}