本文整理汇总了C++中PoolStringArray类的典型用法代码示例。如果您正苦于以下问题:C++ PoolStringArray类的具体用法?C++ PoolStringArray怎么用?C++ PoolStringArray使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PoolStringArray类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: get_script_instance
void EditorPlugin::get_breakpoints(List<String> *p_breakpoints) {
if (get_script_instance() && get_script_instance()->has_method("get_breakpoints")) {
PoolStringArray arr = get_script_instance()->call("get_breakpoints");
for (int i = 0; i < arr.size(); i++)
p_breakpoints->push_back(arr[i]);
}
}
示例2: mono_array_to_PoolStringArray
PoolStringArray mono_array_to_PoolStringArray(MonoArray *p_array) {
PoolStringArray ret;
int length = mono_array_length(p_array);
for (int i = 0; i < length; i++) {
MonoString *elem = mono_array_get(p_array, MonoString *, i);
ret.push_back(mono_string_to_godot(elem));
}
return ret;
}
示例3: get_response_headers
PoolStringArray HTTPClient::_get_response_headers() {
List<String> rh;
get_response_headers(&rh);
PoolStringArray ret;
ret.resize(rh.size());
int idx = 0;
for (const List<String>::Element *E = rh.front(); E; E = E->next()) {
ret.set(idx++, E->get());
}
return ret;
}
示例4: get_script_instance
void ResourceFormatLoader::get_recognized_extensions(List<String> *p_extensions) const {
if (get_script_instance() && get_script_instance()->has_method("get_recognized_extensions")) {
PoolStringArray exts = get_script_instance()->call("get_recognized_extensions");
{
PoolStringArray::Read r = exts.read();
for (int i = 0; i < exts.size(); ++i) {
p_extensions->push_back(r[i]);
}
}
}
}
示例5: debug_get_globals
void PluginScriptLanguage::debug_get_globals(List<String> *p_locals, List<Variant> *p_values, int p_max_subitems, int p_max_depth) {
if (_desc.debug_get_globals) {
PoolStringArray locals;
Array values;
_desc.debug_get_globals(_data, (godot_pool_string_array *)&locals, (godot_array *)&values, p_max_subitems, p_max_depth);
for (int i = 0; i < locals.size(); i++) {
p_locals->push_back(locals[i]);
}
for (int i = 0; i < values.size(); i++) {
p_values->push_back(values[i]);
}
}
}
示例6: debug_get_stack_level_members
void PluginScriptLanguage::debug_get_stack_level_members(int p_level, List<String> *p_members, List<Variant> *p_values, int p_max_subitems, int p_max_depth) {
if (_desc.debug_get_stack_level_members) {
PoolStringArray members;
Array values;
_desc.debug_get_stack_level_members(_data, p_level, (godot_pool_string_array *)&members, (godot_array *)&values, p_max_subitems, p_max_depth);
for (int i = 0; i < members.size(); i++) {
p_members->push_back(members[i]);
}
for (int i = 0; i < values.size(); i++) {
p_values->push_back(values[i]);
}
}
}
示例7: mono_array_to_PoolStringArray
PoolStringArray mono_array_to_PoolStringArray(MonoArray *p_array) {
PoolStringArray ret;
if (!p_array)
return ret;
int length = mono_array_length(p_array);
ret.resize(length);
for (int i = 0; i < length; i++) {
MonoString *elem = mono_array_get(p_array, MonoString *, i);
ret.set(i, mono_string_to_godot(elem));
}
return ret;
}
示例8: get_section_keys
PoolStringArray ConfigFile::_get_section_keys(const String &p_section) const {
List<String> s;
get_section_keys(p_section, &s);
PoolStringArray arr;
arr.resize(s.size());
int idx = 0;
for (const List<String>::Element *E = s.front(); E; E = E->next()) {
arr.set(idx++, E->get());
}
return arr;
}
示例9: _scan_dir
void FindInFiles::_scan_dir(String path, PoolStringArray &out_folders) {
DirAccess *dir = DirAccess::open(path);
if (dir == NULL) {
print_line("Cannot open directory! " + path);
return;
}
dir->list_dir_begin();
for (int i = 0; i < 1000; ++i) {
String file = dir->get_next();
if (file == "")
break;
// Ignore special dirs and hidden dirs (such as .git and .import)
if (file == "." || file == ".." || file.begins_with("."))
continue;
if (dir->current_is_dir())
out_folders.append(file);
else {
String file_ext = file.get_extension();
if (_extension_filter.has(file_ext)) {
_files_to_scan.push_back(path.plus_file(file));
}
}
}
}
示例10: get_stored_values
Dictionary InstancePlaceholder::get_stored_values(bool p_with_order) {
Dictionary ret;
PoolStringArray order;
for (List<PropSet>::Element *E = stored_values.front(); E; E = E->next()) {
ret[E->get().name] = E->get().value;
if (p_with_order)
order.push_back(E->get().name);
};
if (p_with_order)
ret[".order"] = order;
return ret;
};
示例11: get_connected_inputs
PoolStringArray MIDIDriverCoreMidi::get_connected_inputs() {
PoolStringArray list;
for (int i = 0; i < connected_sources.size(); i++) {
MIDIEndpointRef source = connected_sources[i];
CFStringRef ref = NULL;
char name[256];
MIDIObjectGetStringProperty(source, kMIDIPropertyDisplayName, &ref);
CFStringGetCString(ref, name, sizeof(name), kCFStringEncodingUTF8);
CFRelease(ref);
list.push_back(name);
}
return list;
}
示例12: validate
bool PluginScriptLanguage::validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path, List<String> *r_functions) const {
PoolStringArray functions;
if (_desc.validate) {
bool ret = _desc.validate(
_data,
(godot_string *)&p_script,
&r_line_error,
&r_col_error,
(godot_string *)&r_test_error,
(godot_string *)&p_path,
(godot_pool_string_array *)&functions);
for (int i = 0; i < functions.size(); i++) {
r_functions->push_back(functions[i]);
}
return ret;
}
return true;
}
示例13: memdelete
void ProjectManager::_files_dropped(PoolStringArray p_files, int p_screen) {
Set<String> folders_set;
DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
for (int i = 0; i < p_files.size(); i++) {
String file = p_files[i];
folders_set.insert(da->dir_exists(file) ? file : file.get_base_dir());
}
memdelete(da);
if (folders_set.size()>0) {
PoolStringArray folders;
for (Set<String>::Element *E=folders_set.front();E;E=E->next()) {
folders.append(E->get());
}
bool confirm = true;
if (folders.size()==1) {
DirAccess *dir = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
if (dir->change_dir(folders[0])==OK) {
dir->list_dir_begin();
String file = dir->get_next();
while(confirm && file!=String()) {
if (!dir->current_is_dir() && file.ends_with("godot.cfg")) {
confirm = false;
}
file = dir->get_next();
}
dir->list_dir_end();
}
memdelete(dir);
}
if (confirm) {
multi_scan_ask->get_ok()->disconnect("pressed", this, "_scan_multiple_folders");
multi_scan_ask->get_ok()->connect("pressed", this, "_scan_multiple_folders", varray(folders));
multi_scan_ask->set_text(vformat(TTR("You are about the scan %s folders for existing Godot projects. Do you confirm?"), folders.size()));
multi_scan_ask->popup_centered_minsize();
} else {
_scan_multiple_folders(folders);
}
}
}
示例14: get_drag_data_fw
Variant EditorAutoloadSettings::get_drag_data_fw(const Point2& p_point, Control *p_control) {
if (autoload_cache.size() <= 1)
return false;
PoolStringArray autoloads;
TreeItem *next = tree->get_next_selected(NULL);
while (next) {
autoloads.push_back(next->get_text(0));
next = tree->get_next_selected(next);
}
if (autoloads.size() == 0 || autoloads.size() == autoload_cache.size())
return Variant();
VBoxContainer *preview = memnew( VBoxContainer );
int max_size = MIN(PREVIEW_LIST_MAX_SIZE, autoloads.size());
for (int i = 0; i < max_size; i++) {
Label *label = memnew( Label(autoloads[i]) );
label->set_self_modulate(Color(1,1,1,Math::lerp(1, 0, float(i)/PREVIEW_LIST_MAX_SIZE)));
preview->add_child(label);
}
tree->set_drop_mode_flags(Tree::DROP_MODE_INBETWEEN);
tree->set_drag_preview(preview);
Dictionary drop_data;
drop_data["type"] = "autoload";
drop_data["autoloads"] = autoloads;
return drop_data;
}
示例15: _scan_multiple_folders
void ProjectManager::_scan_multiple_folders(PoolStringArray p_files)
{
for (int i = 0; i < p_files.size(); i++) {
_scan_begin(p_files.get(i));
}
}