当前位置: 首页>>代码示例>>C++>>正文


C++ path::make_preferred方法代码示例

本文整理汇总了C++中path::make_preferred方法的典型用法代码示例。如果您正苦于以下问题:C++ path::make_preferred方法的具体用法?C++ path::make_preferred怎么用?C++ path::make_preferred使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在path的用法示例。


在下文中一共展示了path::make_preferred方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: unsubscribe

void file_system_watcher::unsubscribe( path path )
{ path_watchers.erase(path.make_preferred()); }
开发者ID:frederikaalund,项目名称:sfj,代码行数:2,代码来源:file_system_watcher.windows.cpp

示例2: ExtractCurrentFile

long ExtractCurrentFile ( path parent, unzFile zip_file )
{
    long error = UNZ_OK;
	
    char filename_inzip[PATH_MAX];
    unz_file_info64 file_info;
	
    error = unzGetCurrentFileInfo64 ( zip_file, &file_info, filename_inzip, sizeof ( filename_inzip ), NULL, 0, NULL, 0 );
	
	path file = filename_inzip;
	
	file.make_preferred();
	parent.make_preferred();
	
	if ( error == UNZ_OK ) {
		
		std::string macos = "__MACOSX";
		if ( file.string().compare ( 0, macos.length(), macos ) == 0 ) {
			return kNoError;
		}
		
		path to_write = parent / file;
		create_directories ( to_write.parent_path() );
		
		if ( file.filename().string() == "." ) {
			
			create_directory ( to_write );
			
		} else {
			
			error = unzOpenCurrentFilePassword ( zip_file, NULL );
			
			if ( error == UNZ_OK ) {
				
				char * buffer = new char [ WRITEBUFFERSIZE ];
				
				boost::filesystem::ofstream output_file ( to_write, std::ios_base::binary );
				output_file.exceptions ( boost::filesystem::ofstream::badbit | boost::filesystem::ofstream::failbit );
				
				long bytes_read = 0;
				do {
					bytes_read = unzReadCurrentFile ( zip_file, (void *)buffer, WRITEBUFFERSIZE );
					
					if ( bytes_read > 0 ) {
						output_file.write ( buffer, bytes_read );
					} else if ( bytes_read < 0 ) {
						error = bytes_read;
					}
				} while ( bytes_read > 0 );
				
				output_file.close();
                ChangeFileDate ( to_write, file_info.tmu_date );
				delete [] buffer;
				
			}
			
			// don't lose the error
			int close_error = unzCloseCurrentFile ( zip_file );
			if ( error == UNZ_OK ) {
				error = close_error;
			}
		}
	}
	
	return error;
	
} // ExtractCurrentFile
开发者ID:coopc,项目名称:BaseElements-Plugin,代码行数:67,代码来源:BEZlib.cpp

示例3: subscribe

////////////////////////////////////////////////////////////////////////////////
/// File System Watcher
////////////////////////////////////////////////////////////////////////////////
void file_system_watcher::subscribe( path path, const filter filter_ )
{
	path_watchers.insert({
		path.make_preferred(), 
		std::make_shared<path_watcher>(this, path, filter_)});
}
开发者ID:frederikaalund,项目名称:sfj,代码行数:9,代码来源:file_system_watcher.windows.cpp


注:本文中的path::make_preferred方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。