本文整理汇总了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;
}
示例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;
}