29 #ifndef RESOURCE_LOADER_H 30 #define RESOURCE_LOADER_H 43 static void _bind_methods();
46 virtual void set_local_path(
const String& p_local_path)=0;
48 virtual Error poll()=0;
49 virtual int get_stage()
const=0;
50 virtual int get_stage_count()
const=0;
61 virtual RES load(
const String &p_path,
const String& p_original_path=
"",Error *r_error=NULL);
62 virtual void get_recognized_extensions(
List<String> *p_extensions)
const=0;
63 virtual void get_recognized_extensions_for_type(
const String& p_type,
List<String> *p_extensions)
const;
64 bool recognize(
const String& p_extension)
const;
65 virtual bool handles_type(
const String& p_type)
const=0;
66 virtual String get_resource_type(
const String &p_path)
const=0;
67 virtual void get_dependencies(
const String& p_path,
List<String> *p_dependencies,
bool p_add_types=
false);
75 typedef void (*ResourceLoadErrorNotify)(
void *p_ud,
const String& p_text);
76 typedef void (*DependencyErrorNotify)(
void *p_ud,
const String& p_loading,
const String& p_which,
const String& p_type);
86 static int loader_count;
87 static bool timestamp_on_load;
89 static void* err_notify_ud;
90 static ResourceLoadErrorNotify err_notify;
91 static void* dep_err_notify_ud;
92 static DependencyErrorNotify dep_err_notify;
93 static bool abort_on_missing_resource;
101 static RES load(
const String &p_path,
const String& p_type_hint=
"",
bool p_no_cache=
false,Error *r_error=NULL);
104 static void get_recognized_extensions_for_type(
const String& p_type,
List<String> *p_extensions);
107 static void get_dependencies(
const String& p_path,
List<String> *p_dependencies,
bool p_add_types=
false);
112 static void set_timestamp_on_load(
bool p_timestamp) { timestamp_on_load=p_timestamp; }
114 static void notify_load_error(
const String& p_err) {
if (err_notify) err_notify(err_notify_ud,p_err); }
115 static void set_error_notify_func(
void* p_ud,ResourceLoadErrorNotify p_err_notify) { err_notify=p_err_notify; err_notify_ud=p_ud;}
117 static void notify_dependency_error(
const String& p_path,
const String& p_dependency,
const String& p_type) {
if (dep_err_notify) dep_err_notify(dep_err_notify_ud,p_path,p_dependency,p_type); }
118 static void set_dependency_error_notify_func(
void* p_ud,DependencyErrorNotify p_err_notify) { dep_err_notify=p_err_notify; dep_err_notify_ud=p_ud;}
121 static void set_abort_on_missing_resources(
bool p_abort) { abort_on_missing_resource=p_abort; }
122 static bool get_abort_on_missing_resources() {
return abort_on_missing_resource; }
Definition: resource_loader.h:79
Definition: reference.h:40
Definition: resource_loader.h:38