15 if (ptr->is_our_path(p_path,p_ext))
30 if (ptr->is_our_content_type(p_content_type))
46 if (filesystem::g_get_interface(fs,p_path)) {
47 if (fs->supports_content_types()) {
48 fs->open(p_file,p_path,p_open_mode,p_abort);
56 if (p_file->get_content_type(content_type))
65 if (p_from_redirect && p_service->is_redirect())
throw exception_io_unsupported_format();
69 throw exception_io_unsupported_format();
80 if (!(p_from_redirect && ptr->is_redirect())) {
81 if (ptr->is_our_content_type(p_content_type)) {p_out.add_item(ptr); ret =
true;}
93 if (!(p_from_redirect && ptr->is_redirect())) {
94 if (ptr->is_our_path(p_path,extension)) {p_out.add_item(ptr); ret =
true;}
101 const t_size count = p_list.get_count();
103 p_list[0]->open(p_instance,p_filehint,p_path,p_abort);
105 unsigned bad_data_count = 0;
107 for(
t_size n=0;n<count;n++) {
109 p_list[n]->open(p_instance,p_filehint,p_path,p_abort);
111 }
catch(exception_io_unsupported_format) {
113 }
catch(exception_io_data
const & e) {
114 if (bad_data_count ++ == 0) bad_data_message = e.what();
117 if (bad_data_count > 1)
throw exception_io_data();
118 else if (bad_data_count == 0) pfc::throw_exception_with_message<exception_io_data>(bad_data_message);
119 else throw exception_io_unsupported_format();
123 template<
typename t_service>
bool needs_write_access() {
return false;}
124 template<>
bool needs_write_access<input_info_writer>() {
return true;}
130 if (filesystem::g_get_interface(fs,p_path)) {
131 if (fs->supports_content_types()) {
132 fs->open(l_file,p_path,needs_write_access<t_service>() ? filesystem::open_mode_write_existing : filesystem::open_mode_read,p_abort);
139 if (l_file->get_content_type(content_type)) {
141 if (g_find_inputs_by_content_type(list,content_type,p_from_redirect)) {
142 g_open_from_list(p_instance,list,l_file,p_path,p_abort);
150 if (g_find_inputs_by_path(list,p_path,p_from_redirect)) {
151 g_open_from_list(p_instance,list,l_file,p_path,p_abort);
156 throw exception_io_unsupported_format();
161 TRACK_CALL_TEXT(
"input_entry::g_open_for_decoding");
163 g_open_t(p_instance,p_filehint,p_path,p_abort,p_from_redirect);
168 prepare_for_open(entry,filehint,p_path,filesystem::open_mode_read,p_abort,p_from_redirect);
170 entry->open_for_decoding(p_instance,filehint,p_path,p_abort);
176 TRACK_CALL_TEXT(
"input_entry::g_open_for_info_read");
178 g_open_t(p_instance,p_filehint,p_path,p_abort,p_from_redirect);
183 prepare_for_open(entry,filehint,p_path,filesystem::open_mode_read,p_abort,p_from_redirect);
185 entry->open_for_info_read(p_instance,filehint,p_path,p_abort);
190 TRACK_CALL_TEXT(
"input_entry::g_open_for_info_write");
192 g_open_t(p_instance,p_filehint,p_path,p_abort,p_from_redirect);
197 prepare_for_open(entry,filehint,p_path,filesystem::open_mode_write_existing,p_abort,p_from_redirect);
199 entry->open_for_info_write(p_instance,filehint,p_path,p_abort);
210 }
catch(exception_io_sharing_violation) {
211 if (timer.
query() > p_timeout)
throw;
224 if (ptr->is_our_path(p_path,ext))
return true;
239 filesystem::g_open(p_file,p_path,filesystem::open_mode_read,p_abort);
242 filesystem::g_open(p_file,p_path,filesystem::open_mode_write_existing,p_abort);
246 p_file->reopen(p_abort);
static bool g_find_service_by_content_type(service_ptr_t< input_entry > &p_out, const char *p_content_type)
static bool g_find_service_by_path(service_ptr_t< input_entry > &p_out, const char *p_path)
static bool g_is_supported_path(const char *p_path)
static void g_open_for_info_write(service_ptr_t< input_info_writer > &p_instance, service_ptr_t< file > p_filehint, const char *p_path, abort_callback &p_abort, bool p_from_redirect=false)
static void g_open_for_info_read(service_ptr_t< input_info_reader > &p_instance, service_ptr_t< file > p_filehint, const char *p_path, abort_callback &p_abort, bool p_from_redirect=false)
static void g_open_for_decoding(service_ptr_t< input_decoder > &p_instance, service_ptr_t< file > p_filehint, const char *p_path, abort_callback &p_abort, bool p_from_redirect=false)
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
static void g_open_for_info_write_timeout(service_ptr_t< input_info_writer > &p_instance, service_ptr_t< file > p_filehint, const char *p_path, abort_callback &p_abort, double p_timeout, bool p_from_redirect=false)
PFC_NORETURN void SHARED_EXPORT uBugCheck()
bool next(service_ptr_t< t_query > &p_out)