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


C++ Path::GetExtension方法代码示例

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


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

示例1: ASSERT

bool CatalogImages::Impl::FileScan(Path path, int64 file_length, const CFileFind& find, int dir_visited, bool scanSubdirs)
{
    if (break_)
        return false;

    bool generate_thumbnails= true;

    PhotoFactory::CreateFn fn= 0;
    int id= 0;

    if (!GetPhotoFactory().MatchPhotoType(path.GetExtension(), fn, id))
        return true;

    const size_t size= scan_types_.size();
    if (id >= size)
    {
        ASSERT(false);
        return true;
    }
    if (!scan_types_[id])
        return true;

    files_.push_back(make_pair(path, cur_dir_));

    // reserved_capacity_ keeps track of max amount of files in a given folder; real number
    // can be smaller when decoding fails and some images are not saved;
    cur_dir_->reserved_capacity_++;

    if (parentWnd_)
        ::PostMessage(parentWnd_, MESSAGE, files_.size(), DIR_SCANNING);

    return true;
}
开发者ID:mikekov,项目名称:ExifPro,代码行数:33,代码来源:CatalogImages.cpp

示例2: Copy

void CopyPhoto::Copy(const Path& file_path, const TCHAR* dest_folder, const TCHAR* rename_pattern)
{
	DWORD start= ::GetTickCount();

	CFile file(file_path.c_str(), CFile::modeRead | CFile::shareDenyWrite);// | CFile::osSequentialScan);

	const uint64 length= file.SeekToEnd();

	if (length == 0)
		return;		// do not create empty copies

	Progress(0, length);	// call progress after opening file

	file.SeekToBegin();

	auto_ptr<PhotoInfo> photo;
	PhotoFactory::CreateFn create= 0;
	int type_id= 0;
	if (GetPhotoFactory().MatchPhotoType(file_path.GetExtension(), create, type_id) && type_id != FT_CATALOG)
		photo.reset(create());

	// if there is 'photo' object available try to decode EXIF block
	if (photo.get())
	{
//		FileStream str;
//		VERIFY(str.Open(buffer));

		ReadImage(photo.get(), file_path, length, 0);
	}

	// create destination name
	Path dest= CreateDestPath(file_path, length, photo.get());

	// copy source file to the destination

	const size_t CHUNK= 0x10000;	// 64 KB
	vector<uint8> buffer(CHUNK, 0);

	size_t block= static_cast<size_t>(min<uint64>(CHUNK, length));

	if (file.Read(&buffer.front(), block) != block)
		throw 11111;

}
开发者ID:mikekov,项目名称:ExifPro,代码行数:44,代码来源:CopyPhoto.cpp


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