Пример #1
0
const char* Application::get_user_settings_path()
{
    static char user_settings_buffer[FOUNDATION_MAX_PATH_LENGTH + 1];
    static bool user_settings_initialized = false;

    if (!user_settings_initialized)
    {
// Windows.
#if defined _WIN32

        return 0;

// OS X.
#elif defined __APPLE__

        return 0;

// Other Unices.
#elif defined __linux__ || defined __FreeBSD__

        bf::path p(get_home_directory());
        p /= ".appleseed/settings";
        copy_directory_path_to_buffer(p, user_settings_buffer);

// Other platforms.
#else

        #error Unsupported platform.

#endif
        user_settings_initialized = true;
    }

    return user_settings_buffer;
}
Пример #2
0
const char* Application::get_root_path()
{
    static char root_path_buffer[FOUNDATION_MAX_PATH_LENGTH + 1];
    static bool root_path_initialized = false;

    if (!root_path_initialized)
    {
        filesystem::path root_path;

        if (compute_root_path(root_path))
        {
            copy_directory_path_to_buffer(root_path, root_path_buffer);
        }
        else
        {
            root_path_buffer[0] = '\0';
        }

        root_path_initialized = true;
    }

    return root_path_buffer;
}
Пример #3
0
const char* Application::get_tests_root_path()
{
    static char tests_root_path_buffer[FOUNDATION_MAX_PATH_LENGTH + 1];
    static bool tests_root_path_initialized = false;

    if (!tests_root_path_initialized)
    {
        filesystem::path root_path;

        if (compute_root_path(root_path))
        {
            root_path = root_path / filesystem::path("tests");
            copy_directory_path_to_buffer(root_path, tests_root_path_buffer);
        }
        else
        {
            tests_root_path_buffer[0] = '\0';
        }

        tests_root_path_initialized = true;
    }

    return tests_root_path_buffer;
}