本文整理汇总了C++中service_ptr_t类的典型用法代码示例。如果您正苦于以下问题:C++ service_ptr_t类的具体用法?C++ service_ptr_t怎么用?C++ service_ptr_t使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了service_ptr_t类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: prepare_for_open
static void prepare_for_open(service_ptr_t<input_entry> & p_service,service_ptr_t<file> & p_file,const char * p_path,filesystem::t_open_mode p_open_mode,abort_callback & p_abort,bool p_from_redirect)
{
if (p_file.is_empty())
{
service_ptr_t<filesystem> fs;
if (filesystem::g_get_interface(fs,p_path)) {
if (fs->supports_content_types()) {
fs->open(p_file,p_path,p_open_mode,p_abort);
}
}
}
if (p_file.is_valid())
{
pfc::string8 content_type;
if (p_file->get_content_type(content_type))
{
if (input_entry::g_find_service_by_content_type(p_service,content_type))
return;
}
}
if (input_entry::g_find_service_by_path(p_service,p_path))
{
if (p_from_redirect && p_service->is_redirect()) throw exception_io_unsupported_format();
return;
}
throw exception_io_unsupported_format();
}
开发者ID:unjello,项目名称:foo_input_amr,代码行数:30,代码来源:input.cpp
示例2: g_multiskip
void tag_processor_id3v2::g_remove_ex(tag_write_callback & p_callback,const service_ptr_t<file> & p_file,t_uint64 & p_size_removed,abort_callback & p_abort)
{
p_file->ensure_seekable();
t_filesize len;
len = p_file->get_size(p_abort);
if (len == filesize_invalid) throw exception_io_no_length();
p_file->seek(0,p_abort);
t_uint64 offset;
g_multiskip(p_file,offset,p_abort);
if (offset>0 && offset<len)
{
len-=offset;
service_ptr_t<file> temp;
if (p_callback.open_temp_file(temp,p_abort)) {
file::g_transfer_object(p_file,temp,len,p_abort);
} else {
if (len > 16*1024*1024) filesystem::g_open_temp(temp,p_abort);
else filesystem::g_open_tempmem(temp,p_abort);
file::g_transfer_object(p_file,temp,len,p_abort);
p_file->seek(0,p_abort);
p_file->set_eof(p_abort);
temp->seek(0,p_abort);
file::g_transfer_object(temp,p_file,len,p_abort);
}
}
p_size_removed = offset;
}
开发者ID:KolorKode,项目名称:Stg,代码行数:33,代码来源:tag_processor_id3v2.cpp
示例3: g_seekabilize
void seekabilizer::g_seekabilize(service_ptr_t<file> & p_reader,t_size p_buffer_size,abort_callback & p_abort) {
if (p_reader.is_valid() && p_reader->is_remote() && p_buffer_size > 0) {
service_ptr_t<seekabilizer> instance = new service_impl_t<seekabilizer>();
instance->initialize(p_reader,p_buffer_size,p_abort);
p_reader = instance.get_ptr();
}
}
开发者ID:9060,项目名称:columns_ui,代码行数:7,代码来源:seekabilizer.cpp
示例4: load_id666
static void load_id666(service_ptr_t<file> & p_file, LPID666TAG lpTag, abort_callback & p_abort)//must be seeked to correct spot before calling
{
t_uint8 szBuf[4];
p_file->read_object( &szBuf, 4, p_abort );
if( ! memcmp( szBuf, xid6_signature, 4 ) )
{
t_uint32 tag_size;
p_file->read_lendian_t( tag_size, p_abort );
t_filesize offset = p_file->get_position( p_abort );
service_ptr_t< reader_limited > m_file = new service_impl_t< reader_limited >;
m_file->init( p_file, offset, offset + tag_size, p_abort );
service_ptr_t<file> p_file = m_file.get_ptr();
try
{
parse_id666( p_file, lpTag, false, p_abort );
}
catch ( const exception_io_data & )
{
p_file->seek( 0, p_abort );
memset( lpTag, 0, sizeof( *lpTag ) );
parse_id666( p_file, lpTag, true, p_abort );
}
}
else throw exception_tag_not_found();
}
开发者ID:xomniversex,项目名称:foo_gep,代码行数:32,代码来源:spc.cpp
示例5: g_transfer_file
void file::g_transfer_file(const service_ptr_t<file> & p_from,const service_ptr_t<file> & p_to,abort_callback & p_abort) {
t_filesize length = p_from->get_size_ex(p_abort);
p_from->seek(0,p_abort);
p_to->seek(0,p_abort);
p_to->set_eof(p_abort);
if (length > 0) {
g_transfer_object(p_from,p_to,length,p_abort);
}
}
开发者ID:KolorKode,项目名称:Stg,代码行数:9,代码来源:filesystem.cpp
示例6: g_transfer_object
void file::g_transfer_object(service_ptr_t<file> p_src,service_ptr_t<file> p_dst,t_filesize p_bytes,abort_callback & p_abort) {
if (p_bytes > 1024) /* don't bother on small objects */
{
t_filesize oldsize = p_dst->get_size(p_abort);
if (oldsize != filesize_invalid) {
t_filesize newpos = p_dst->get_position(p_abort) + p_bytes;
if (newpos > oldsize) p_dst->resize(newpos ,p_abort);
}
}
g_transfer_object(pfc::implicit_cast<stream_reader*>(p_src.get_ptr()),pfc::implicit_cast<stream_writer*>(p_dst.get_ptr()),p_bytes,p_abort);
}
开发者ID:KolorKode,项目名称:Stg,代码行数:11,代码来源:filesystem.cpp
示例7: load_feature_list_from_json_file
bool load_feature_list_from_json_file(pfc::list_base_t<feature_handle_ptr> &p_list, const service_ptr_t<file> &p_file, abort_callback &p_abort)
{
t_filesize size = p_file->get_size(p_abort);
pfc::string8 json;
{
pfc::string_buffer buffer(json, size);
p_file->read_object(buffer, size, p_abort);
}
return load_feature_list_from_json_string(p_list, json);
}
开发者ID:stengerh,项目名称:foo_whatsnew,代码行数:12,代码来源:feature_log_reader_json.cpp
示例8: open
void open(service_ptr_t<file> p_filehint, const char *p_path, t_input_open_reason p_reason, abort_callback &p_abort)
{
if (p_reason == input_open_info_write) {
int len = strlen(p_path);
if (len < 4 || _stricmp(p_path + len - 4, ".sap") != 0)
throw exception_io_unsupported_format();
filename = strdup(p_path);
}
if (p_filehint.is_empty())
filesystem::g_open(p_filehint, p_path, filesystem::open_mode_read, p_abort);
m_file = p_filehint;
module_len = m_file->read(module, sizeof(module), p_abort);
if (!ASAP_Load(asap, p_path, module, module_len))
throw exception_io_unsupported_format();
}
开发者ID:hudokkow,项目名称:audiodecoder.asap,代码行数:15,代码来源:foo_asap.cpp
示例9: on_watched_object_changed
void config_object_callback::on_watched_object_changed(const service_ptr_t<config_object> & p_object)
{
GUID guid = p_object->get_guid();
bool boolval = false;
unsigned msg = 0;
p_object->get_data_bool(boolval);
if (guid == standard_config_objects::bool_playlist_stop_after_current)
msg = CALLBACK_UWM_PLAYLIST_STOP_AFTER_CURRENT;
else if (guid == standard_config_objects::bool_cursor_follows_playback)
msg = CALLBACK_UWM_CURSOR_FOLLOW_PLAYBACK;
else
msg = CALLBACK_UWM_PLAYBACK_FOLLOW_CURSOR;
panel_manager::instance().post_msg_to_all(msg, TO_VARIANT_BOOL(boolval));
}
开发者ID:neonmori,项目名称:foo_uie_wsh_panel_sp,代码行数:17,代码来源:panel_manager.cpp
示例10: open
void open( service_ptr_t<file> m_file, const char * p_path, t_input_open_reason p_reason, abort_callback & p_abort )
{
if ( p_reason == input_open_info_write ) throw exception_io_data();
input_open_file_helper( m_file, p_path, p_reason, p_abort );
m_stats = m_file->get_stats( p_abort );
t_uint8 * ptr;
unsigned size;
t_filesize size64 = m_file->get_size_ex( p_abort );
if ( size64 > ( 1 << 24 ) )
throw exception_io_data();
size = (unsigned) size64;
file_buffer.set_size( size );
ptr = file_buffer.get_ptr();
m_file->read_object( ptr, size, p_abort );
m_player = ModPlug_Load(ptr, size);
if ( !m_player ) throw exception_io_data();
}
开发者ID:FauxFaux,项目名称:foo_mudlord,代码行数:17,代码来源:input_modplug.cpp
示例11: input_open_file_helper
void input_open_file_helper(service_ptr_t<file> & p_file,const char * p_path,t_input_open_reason p_reason,abort_callback & p_abort)
{
if (p_file.is_empty()) {
switch(p_reason) {
default:
uBugCheck();
case input_open_info_read:
case input_open_decode:
filesystem::g_open(p_file,p_path,filesystem::open_mode_read,p_abort);
break;
case input_open_info_write:
filesystem::g_open(p_file,p_path,filesystem::open_mode_write_existing,p_abort);
break;
}
} else {
p_file->reopen(p_abort);
}
}
开发者ID:unjello,项目名称:foo_input_amr,代码行数:18,代码来源:input.cpp
示例12: open
void open(service_ptr_t<file> file, const char *path,
t_input_open_reason reason, abort_callback &abort)
{
m_pfile = file;
input_open_file_helper(m_pfile, path, reason, abort);
m_pfile->ensure_seekable();
m_demuxer = std::make_shared<CAFFile>(m_pfile, abort);
m_decoder = IDecoder::create_decoder(m_demuxer, abort);
}
开发者ID:,项目名称:,代码行数:9,代码来源:
示例13: open
void open(service_ptr_t<file> p_filehint, const char *p_path, t_input_open_reason p_reason, abort_callback &p_abort)
{
if (p_reason == input_open_info_write) {
int len = strlen(p_path);
if (len >= MAX_PATH || !ASAP_CanSetModuleInfo(p_path))
throw exception_io_unsupported_format();
memcpy(filename, p_path, len + 1);
}
if (p_filehint.is_empty())
filesystem::g_open(p_filehint, p_path, filesystem::open_mode_read, p_abort);
m_file = p_filehint;
module_len = m_file->read(module, sizeof(module), p_abort);
if (!ASAP_GetModuleInfo(&module_info, p_path, module, module_len))
throw exception_io_unsupported_format();
if (p_reason == input_open_decode)
if (!ASAP_Load(&asap, p_path, module, module_len))
throw exception_io_unsupported_format();
}
开发者ID:070499,项目名称:xbmc,代码行数:18,代码来源:foo_asap.cpp
示例14: write
void write(const service_ptr_t<file> & p_file,abort_callback & p_abort,const char * p_string,bool is_utf8)
{
p_file->seek(0,p_abort);
p_file->set_eof(p_abort);
if (is_utf8)
{
p_file->write_object(utf8_header,sizeof(utf8_header),p_abort);
p_file->write_object(p_string,strlen(p_string),p_abort);
}
else
{
#ifdef _WIN32
pfc::stringcvt::string_ansi_from_utf8 bah(p_string);
p_file->write_object(bah,bah.length(),p_abort);
#else
throw exception_io_data();
#endif
}
}
开发者ID:unjello,项目名称:foo_input_amr,代码行数:19,代码来源:text_file_loader.cpp
示例15: process_fullbuffer
static void process_fullbuffer(service_ptr_t<file> & p_file,const char * p_path,t_filesize p_fullbuffer,abort_callback & p_abort) {
if (p_fullbuffer > 0) {
if (p_file.is_empty()) {
service_ptr_t<filesystem> fs;
if (filesystem::g_get_interface(fs,p_path)) {
fs->open(p_file,p_path,filesystem::open_mode_read,p_abort);
}
}
if (p_file.is_valid()) {
t_filesize size = p_file->get_size(p_abort);
if (size != filesize_invalid && size <= p_fullbuffer) {
service_ptr_t<file> l_file_buffered;
if (reader_membuffer_mirror::g_create(l_file_buffered,p_file,p_abort)) {
p_file = l_file_buffered;
}
}
}
}
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:20,代码来源:input_helpers.cpp
示例16: instantiate
bool dsp_rate_entry::instantiate(service_ptr_t<dsp>& p_out, const dsp_preset& p_preset)
{
bool ret = false;
if (p_preset.get_owner() == get_guid())
{
t_dsp_rate_params params;
params.set_data(p_preset);
p_out = reinterpret_cast<dsp*>(new service_impl_t<dsp_rate>(params));
ret = p_out.is_valid();
}
return ret;
}
开发者ID:cxn4689,项目名称:GPU-real-time-resampler-for-Foobar2000,代码行数:12,代码来源:foo_dsp_resampler.cpp
示例17: g_open
void unpacker::g_open(service_ptr_t<file> & p_out,const service_ptr_t<file> & p,abort_callback & p_abort)
{
service_enum_t<unpacker> e;
service_ptr_t<unpacker> ptr;
if (e.first(ptr)) do {
p->reopen(p_abort);
try {
ptr->open(p_out,p,p_abort);
return;
} catch(exception_io_data const &) {}
} while(e.next(ptr));
throw exception_io_data();
}
开发者ID:KolorKode,项目名称:Stg,代码行数:13,代码来源:filesystem.cpp
示例18: open
void open(service_ptr_t<file> m_file, const char * p_path, t_input_open_reason p_reason, abort_callback & p_abort)
{
if (p_reason == input_open_info_write)
{
throw exception_io_data();
}
input_open_file_helper(m_file, p_path, p_reason, p_abort);
m_stats = m_file->get_stats(p_abort);
m_decoder = new dts_decode();
if (!m_decoder->load( m_file, p_abort))
{
throw exception_io_data();
}
}
开发者ID:vsu,项目名称:foo-input-dts,代码行数:16,代码来源:foo_input_dts.cpp
示例19: index_tracks_helper
static void index_tracks_helper(const char * p_path,const service_ptr_t<file> & p_reader,const t_filestats & p_stats,playlist_loader_callback::t_entry_type p_type,playlist_loader_callback::ptr p_callback, abort_callback & p_abort,bool & p_got_input)
{
TRACK_CALL_TEXT("index_tracks_helper");
if (p_reader.is_empty() && filesystem::g_is_remote_safe(p_path))
{
TRACK_CALL_TEXT("remote");
metadb_handle_ptr handle;
p_callback->handle_create(handle,make_playable_location(p_path,0));
p_got_input = true;
p_callback->on_entry(handle,p_type,p_stats,true);
} else {
TRACK_CALL_TEXT("hintable");
service_ptr_t<input_info_reader> instance;
input_entry::g_open_for_info_read(instance,p_reader,p_path,p_abort);
t_filestats stats = instance->get_file_stats(p_abort);
t_uint32 subsong,subsong_count = instance->get_subsong_count();
bool bInfoGetError = false;
for(subsong=0;subsong<subsong_count;subsong++)
{
TRACK_CALL_TEXT("subsong-loop");
p_abort.check();
metadb_handle_ptr handle;
t_uint32 index = instance->get_subsong(subsong);
p_callback->handle_create(handle,make_playable_location(p_path,index));
p_got_input = true;
if (! bInfoGetError && p_callback->want_info(handle,p_type,stats,true) )
{
file_info_impl info;
try {
TRACK_CODE("get_info",instance->get_info(index,info,p_abort));
} catch(std::exception const & e) {
bInfoGetError = true;
}
p_callback->on_entry_info(handle,p_type,stats,info,true);
}
else
{
p_callback->on_entry(handle,p_type,stats,true);
}
}
}
}
开发者ID:Sektorka,项目名称:AltaCast,代码行数:45,代码来源:playlist_loader.cpp
示例20: catch
void tag_processor::read_id3v2_trailing(const service_ptr_t<file> & p_file,file_info & p_info,abort_callback & p_abort)
{
file_info_impl id3v2, trailing;
bool have_id3v2 = true, have_trailing = true;
try {
read_id3v2(p_file,id3v2,p_abort);
} catch(exception_io_data) {
have_id3v2 = false;
}
if (!have_id3v2 || !p_file->is_remote()) try {
read_trailing(p_file,trailing,p_abort);
} catch(exception_io_data) {
have_trailing = false;
}
if (!have_id3v2 && !have_trailing) throw exception_tag_not_found();
if (have_id3v2) {
p_info._set_tag(id3v2);
if (have_trailing) p_info._add_tag(trailing);
} else {
p_info._set_tag(trailing);
}
}
开发者ID:kazukioishi,项目名称:foo_nowplayingtunes,代码行数:24,代码来源:tag_processor.cpp
注:本文中的service_ptr_t类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论