godot/core/config/project_settings.cpp

/**************************************************************************/
/*  project_settings.cpp                                                  */
/**************************************************************************/
/*                         This file is part of:                          */
/*                             GODOT ENGINE                               */
/*                        https://godotengine.org                         */
/**************************************************************************/
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                  */
/*                                                                        */
/* Permission is hereby granted, free of charge, to any person obtaining  */
/* a copy of this software and associated documentation files (the        */
/* "Software"), to deal in the Software without restriction, including    */
/* without limitation the rights to use, copy, modify, merge, publish,    */
/* distribute, sublicense, and/or sell copies of the Software, and to     */
/* permit persons to whom the Software is furnished to do so, subject to  */
/* the following conditions:                                              */
/*                                                                        */
/* The above copyright notice and this permission notice shall be         */
/* included in all copies or substantial portions of the Software.        */
/*                                                                        */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,        */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF     */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY   */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,   */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE      */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                 */
/**************************************************************************/

#include "project_settings.h"

#include "core/core_bind.h" // For Compression enum.
#include "core/input/input_map.h"
#include "core/io/config_file.h"
#include "core/io/dir_access.h"
#include "core/io/file_access.h"
#include "core/io/file_access_pack.h"
#include "core/io/marshalls.h"
#include "core/io/resource_uid.h"
#include "core/object/script_language.h"
#include "core/os/keyboard.h"
#include "core/templates/rb_set.h"
#include "core/variant/typed_array.h"
#include "core/variant/variant_parser.h"
#include "core/version.h"

#ifdef TOOLS_ENABLED
#include "modules/modules_enabled.gen.h" // For mono.
#endif // TOOLS_ENABLED

const String ProjectSettings::PROJECT_DATA_DIR_NAME_SUFFIX =;

ProjectSettings *ProjectSettings::singleton =;

ProjectSettings *ProjectSettings::get_singleton() {}

String ProjectSettings::get_project_data_dir_name() const {}

String ProjectSettings::get_project_data_path() const {}

String ProjectSettings::get_resource_path() const {}

String ProjectSettings::get_imported_files_path() const {}

#ifdef TOOLS_ENABLED
// Returns the features that a project must have when opened with this build of Godot.
// This is used by the project manager to provide the initial_settings for config/features.
const PackedStringArray ProjectSettings::get_required_features() {}

// Returns the features supported by this build of Godot. Includes all required features.
const PackedStringArray ProjectSettings::_get_supported_features() {}

// Returns the features that this project needs but this build of Godot lacks.
const PackedStringArray ProjectSettings::get_unsupported_features(const PackedStringArray &p_project_features) {}

// Returns the features that both this project has and this build of Godot has, ensuring required features exist.
const PackedStringArray ProjectSettings::_trim_to_supported_features(const PackedStringArray &p_project_features) {}
#endif // TOOLS_ENABLED

String ProjectSettings::localize_path(const String &p_path) const {}

void ProjectSettings::set_initial_value(const String &p_name, const Variant &p_value) {}

void ProjectSettings::set_restart_if_changed(const String &p_name, bool p_restart) {}

void ProjectSettings::set_as_basic(const String &p_name, bool p_basic) {}

void ProjectSettings::set_as_internal(const String &p_name, bool p_internal) {}

void ProjectSettings::set_ignore_value_in_docs(const String &p_name, bool p_ignore) {}

bool ProjectSettings::get_ignore_value_in_docs(const String &p_name) const {}

void ProjectSettings::add_hidden_prefix(const String &p_prefix) {}

String ProjectSettings::globalize_path(const String &p_path) const {}

bool ProjectSettings::_set(const StringName &p_name, const Variant &p_value) {}

bool ProjectSettings::_get(const StringName &p_name, Variant &r_ret) const {}

Variant ProjectSettings::get_setting_with_override(const StringName &p_name) const {}

struct _VCSort {};

void ProjectSettings::_get_property_list(List<PropertyInfo> *p_list) const {}

void ProjectSettings::_queue_changed() {}

void ProjectSettings::_emit_changed() {}

bool ProjectSettings::_load_resource_pack(const String &p_pack, bool p_replace_files, int p_offset) {}

void ProjectSettings::_convert_to_last_version(int p_from_version) {}

/*
 * This method is responsible for loading a project.godot file and/or data file
 * using the following merit order:
 *  - If using NetworkClient, try to lookup project file or fail.
 *  - If --main-pack was passed by the user (`p_main_pack`), load it or fail.
 *  - Search for project PCKs automatically. For each step we try loading a potential
 *    PCK, and if it doesn't work, we proceed to the next step. If any step succeeds,
 *    we try loading the project settings, and abort if it fails. Steps:
 *    o Bundled PCK in the executable.
 *    o [macOS only] PCK with same basename as the binary in the .app resource dir.
 *    o PCK with same basename as the binary in the binary's directory. We handle both
 *      changing the extension to '.pck' (e.g. 'win_game.exe' -> 'win_game.pck') and
 *      appending '.pck' to the binary name (e.g. 'linux_game' -> 'linux_game.pck').
 *    o PCK with the same basename as the binary in the current working directory.
 *      Same as above for the two possible PCK file names.
 *  - On relevant platforms (Android/iOS), lookup project file in OS resource path.
 *    If found, load it or fail.
 *  - Lookup project file in passed `p_path` (--path passed by the user), i.e. we
 *    are running from source code.
 *    If not found and `p_upwards` is true (--upwards passed by the user), look for
 *    project files in parent folders up to the system root (used to run a game
 *    from command line while in a subfolder).
 *    If a project file is found, load it or fail.
 *    If nothing was found, error out.
 */
Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, bool p_upwards, bool p_ignore_override) {}

Error ProjectSettings::setup(const String &p_path, const String &p_main_pack, bool p_upwards, bool p_ignore_override) {}

bool ProjectSettings::has_setting(const String &p_var) const {}

Error ProjectSettings::_load_settings_binary(const String &p_path) {}

Error ProjectSettings::_load_settings_text(const String &p_path) {}

Error ProjectSettings::_load_settings_text_or_binary(const String &p_text_path, const String &p_bin_path) {}

Error ProjectSettings::load_custom(const String &p_path) {}

int ProjectSettings::get_order(const String &p_name) const {}

void ProjectSettings::set_order(const String &p_name, int p_order) {}

void ProjectSettings::set_builtin_order(const String &p_name) {}

bool ProjectSettings::is_builtin_setting(const String &p_name) const {}

void ProjectSettings::clear(const String &p_name) {}

Error ProjectSettings::save() {}

Error ProjectSettings::_save_settings_binary(const String &p_file, const RBMap<String, List<String>> &p_props, const CustomMap &p_custom, const String &p_custom_features) {}

Error ProjectSettings::_save_settings_text(const String &p_file, const RBMap<String, List<String>> &p_props, const CustomMap &p_custom, const String &p_custom_features) {}

Error ProjectSettings::_save_custom_bnd(const String &p_file) {}

#ifdef TOOLS_ENABLED
bool _csproj_exists(const String &p_root_dir) {}
#endif // TOOLS_ENABLED

Error ProjectSettings::save_custom(const String &p_path, const CustomMap &p_custom, const Vector<String> &p_custom_features, bool p_merge_with_current) {}

Variant _GLOBAL_DEF(const String &p_var, const Variant &p_default, bool p_restart_if_changed, bool p_ignore_value_in_docs, bool p_basic, bool p_internal) {}

Variant _GLOBAL_DEF(const PropertyInfo &p_info, const Variant &p_default, bool p_restart_if_changed, bool p_ignore_value_in_docs, bool p_basic, bool p_internal) {}

void ProjectSettings::_add_property_info_bind(const Dictionary &p_info) {}

void ProjectSettings::set_custom_property_info(const PropertyInfo &p_info) {}

const HashMap<StringName, PropertyInfo> &ProjectSettings::get_custom_property_info() const {}

bool ProjectSettings::is_using_datapack() const {}

bool ProjectSettings::is_project_loaded() const {}

bool ProjectSettings::_property_can_revert(const StringName &p_name) const {}

bool ProjectSettings::_property_get_revert(const StringName &p_name, Variant &r_property) const {}

void ProjectSettings::set_setting(const String &p_setting, const Variant &p_value) {}

Variant ProjectSettings::get_setting(const String &p_setting, const Variant &p_default_value) const {}

void ProjectSettings::refresh_global_class_list() {}

TypedArray<Dictionary> ProjectSettings::get_global_class_list() {}

String ProjectSettings::get_global_class_list_path() const {}

void ProjectSettings::store_global_class_list(const Array &p_classes) {}

bool ProjectSettings::has_custom_feature(const String &p_feature) const {}

const HashMap<StringName, ProjectSettings::AutoloadInfo> &ProjectSettings::get_autoload_list() const {}

void ProjectSettings::add_autoload(const AutoloadInfo &p_autoload) {}

void ProjectSettings::remove_autoload(const StringName &p_autoload) {}

bool ProjectSettings::has_autoload(const StringName &p_autoload) const {}

ProjectSettings::AutoloadInfo ProjectSettings::get_autoload(const StringName &p_name) const {}

const HashMap<StringName, String> &ProjectSettings::get_global_groups_list() const {}

void ProjectSettings::add_global_group(const StringName &p_name, const String &p_description) {}

void ProjectSettings::remove_global_group(const StringName &p_name) {}

bool ProjectSettings::has_global_group(const StringName &p_name) const {}

void ProjectSettings::remove_scene_groups_cache(const StringName &p_path) {}

void ProjectSettings::add_scene_groups_cache(const StringName &p_path, const HashSet<StringName> &p_cache) {}

void ProjectSettings::save_scene_groups_cache() {}

String ProjectSettings::get_scene_groups_cache_path() const {}

void ProjectSettings::load_scene_groups_cache() {}

const HashMap<StringName, HashSet<StringName>> &ProjectSettings::get_scene_groups_cache() const {}

#ifdef TOOLS_ENABLED
void ProjectSettings::get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const {}
#endif

void ProjectSettings::_bind_methods() {}

void ProjectSettings::_add_builtin_input_map() {}

ProjectSettings::ProjectSettings() {}

ProjectSettings::ProjectSettings(const String &p_path) {}

ProjectSettings::~ProjectSettings() {}