<commit_before>// Copyright 2015-2020 <NAME>. All rights reserved.

#include <cstdlib>
#include <iostream>
#include <set>
#include <stdexcept>
#include "storage/Path.hpp"
#include "OuzelProject.hpp"
#include "makefile/Project.hpp"
#include "visualstudio/Project.hpp"
#include "xcode/Project.hpp"

enum class ProjectType
{
    Makefile,
    VisualStudio,
    Xcode
};

template <class T> void generateProject(const ouzel::OuzelProject& project)
{
    T output(project);
    output.generate();
}

int main(int argc, const char* argv[])
{
    try
    {
        enum class Action
        {
            None,
            GenerateProject,
            ExportAssets
        };

        Action action = Action::None;
        ouzel::storage::Path projectPath;
        std::set<ProjectType> projectTypes;

        for (int i = 1; i < argc; ++i)
        {
            if (std::string(argv[i]) == "--help")
            {
                std::cout << "Usage:\n";
                std::cout << argv[0] << " [--help] [--generate-project <project-file>]"
                    " [--project <all|makefile|visualstudio|xcode>]"
                    " [--export-assets <project-file>]\n";
                return EXIT_SUCCESS;
            }
            else if (std::string(argv[i]) == "--generate-project")
            {
                action = Action::GenerateProject;

                if (++i >= argc)
                    throw std::runtime_error("Invalid command");

                projectPath = std::string(argv[i]);
            }
            else if (std::string(argv[i]) == "--project")
            {
                if (++i >= argc)
                    throw std::runtime_error("Invalid command");

                if (std::string(argv[i]) == "all")
                {
                    projectTypes.insert(ProjectType::Makefile);
                    projectTypes.insert(ProjectType::VisualStudio);
                    projectTypes.insert(ProjectType::Xcode);
                }
                else if (std::string(argv[i]) == "makefile")
                    projectTypes.insert(ProjectType::Makefile);
                else if (std::string(argv[i]) == "visualstudio")
                    projectTypes.insert(ProjectType::VisualStudio);
                else if (std::string(argv[i]) == "xcode")
                    projectTypes.insert(ProjectType::Xcode);
                else
                    throw std::runtime_error("Invalid project");
            }
            else if (std::string(argv[i]) == "--export-assets")
            {
                action = Action::ExportAssets;

                if (++i >= argc)
                    throw std::runtime_error("Invalid command");

                projectPath = std::string(argv[i]);
            }
        }<commit_msg>Use native paths in ouzel tool<commit_after>// Copyright 2015-2020 <NAME>. All rights reserved.

#include <cstdlib>
#include <iostream>
#include <set>
#include <stdexcept>
#include "storage/Path.hpp"
#include "OuzelProject.hpp"
#include "makefile/Project.hpp"
#include "visualstudio/Project.hpp"
#include "xcode/Project.hpp"

enum class ProjectType
{
    Makefile,
    VisualStudio,
    Xcode
};

template <class T> void generateProject(const ouzel::OuzelProject& project)
{
    T output(project);
    output.generate();
}

int main(int argc, const char* argv[])
{
    try
    {
        enum class Action
        {
            None,
            GenerateProject,
            ExportAssets
        };

        Action action = Action::None;
        ouzel::storage::Path projectPath;
        std::set<ProjectType> projectTypes;

        for (int i = 1; i < argc; ++i)
        {
            if (std::string(argv[i]) == "--help")
            {
                std::cout << "Usage:\n";
                std::cout << argv[0] << " [--help] [--generate-project <project-file>]"
                    " [--project <all|makefile|visualstudio|xcode>]"
                    " [--export-assets <project-file>]\n";
                return EXIT_SUCCESS;
            }
            else if (std::string(argv[i]) == "--generate-project")
            {
                action = Action::GenerateProject;

                if (++i >= argc)
                    throw std::runtime_error("Invalid command");

                projectPath = ouzel::storage::Path{argv[i], ouzel::storage::Path::Format::Native};
            }
            else if (std::string(argv[i]) == "--project")
            {
                if (++i >= argc)
                    throw std::runtime_error("Invalid command");

                if (std::string(argv[i]) == "all")
                {
                    projectTypes.insert(ProjectType::Makefile);
                    projectTypes.insert(ProjectType::VisualStudio);
                    projectTypes.insert(ProjectType::Xcode);
                }
                else if (std::string(argv[i]) == "makefile")
                    projectTypes.insert(ProjectType::Makefile);
                else if (std::string(argv[i]) == "visualstudio")
                    projectTypes.insert(ProjectType::VisualStudio);
                else if (std::string(argv[i]) == "xcode")
                    projectTypes.insert(ProjectType::Xcode);
                else
                    throw std::runtime_error("Invalid project");
            }
            else if (std::string(argv[i]) == "--export-assets")
            {
                action = Action::ExportAssets;

                if (++i >= argc)
                    throw std::runtime_error("Invalid command");

                projectPath = ouzel::storage::Path{argv[i], ouzel::storage::Path::Format::Native};
            }
        }
{'fraction_non_alphanumeric': 0.13957628627381163, 'fraction_numerical': 0.0035606195478013174, 'mean_word_length': 1.6957773512476009, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 29, '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': '6052388', 'n_tokens_mistral': 1587, 'n_tokens_neox': 1484, 'n_words': 301}