本文整理汇总了C++中ncom::CPropVariant::Detach方法的典型用法代码示例。如果您正苦于以下问题:C++ CPropVariant::Detach方法的具体用法?C++ CPropVariant::Detach怎么用?C++ CPropVariant::Detach使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ncom::CPropVariant
的用法示例。
在下文中一共展示了CPropVariant::Detach方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetProperty
STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value)
{
COM_TRY_BEGIN
NCOM::CPropVariant prop;
const CSegment &item = _sections[index];
switch(propID)
{
case kpidPath:
{
wchar_t sz[32];
ConvertUInt64ToString(index, sz);
prop = sz;
break;
}
case kpidSize: prop = (UInt64)item.VSize; break;
case kpidPackSize: prop = (UInt64)item.PSize; break;
case kpidOffset: prop = item.Offset; break;
case kpidVa: prop = item.Va; break;
case kpidType: TYPE_TO_PROP(g_SegnmentTypes, item.Type, prop); break;
case kpidCharacts: FLAGS_TO_PROP(g_SegmentFlags, item.Flags, prop); break;
}
prop.Detach(value);
return S_OK;
COM_TRY_END
}
示例2: GetArchiveProperty
IMP_IInArchive_Props
IMP_IInArchive_ArcProps
STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
{
NCOM::CPropVariant prop;
switch (propID)
{
case kpidPhySize: if (_packSize_Defined) prop = _packSize; break;
case kpidNumStreams: if (_numStreams_Defined) prop = _numStreams; break;
case kpidUnpackSize: if (_unpackSize_Defined) prop = _unpackSize; break;
case kpidErrorFlags:
{
UInt32 v = 0;
if (!_isArc) v |= kpv_ErrorFlags_IsNotArc;;
if (_needMoreInput) v |= kpv_ErrorFlags_UnexpectedEnd;
if (_dataAfterEnd) v |= kpv_ErrorFlags_DataAfterEnd;
if (_unsupported) v |= kpv_ErrorFlags_UnsupportedMethod;
if (_dataError) v |= kpv_ErrorFlags_DataError;
prop = v;
}
}
prop.Detach(value);
return S_OK;
}
示例3: GetArchiveProperty
STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
{
COM_TRY_BEGIN
NCOM::CPropVariant prop;
if (_stream)
{
const CVolumeDescriptor &vol = _archive.VolDescs[_archive.MainVolDescIndex];
switch (propID)
{
case kpidComment:
{
AString s;
ADD_STRING("System", SystemId);
ADD_STRING("Volume", VolumeId);
ADD_STRING("VolumeSet", VolumeSetId);
ADD_STRING("Publisher", PublisherId);
ADD_STRING("Preparer", DataPreparerId);
ADD_STRING("Application", ApplicationId);
ADD_STRING("Copyright", CopyrightFileId);
ADD_STRING("Abstract", AbstractFileId);
ADD_STRING("Bib", BibFileId);
prop = s;
break;
}
case kpidCTime: { FILETIME utc; if (vol.CTime.GetFileTime(utc)) prop = utc; break; }
case kpidMTime: { FILETIME utc; if (vol.MTime.GetFileTime(utc)) prop = utc; break; }
}
}
switch (propID)
{
case kpidPhySize: prop = _archive.PhySize; break;
case kpidErrorFlags:
{
UInt32 v = 0;
if (!_archive.IsArc) v |= kpv_ErrorFlags_IsNotArc;
if (_archive.UnexpectedEnd) v |= kpv_ErrorFlags_UnexpectedEnd;
if (_archive.HeadersError) v |= kpv_ErrorFlags_HeadersError;
prop = v;
break;
}
case kpidError:
{
AString s;
if (_archive.IncorrectBigEndian)
AddErrorMessage(s, "Incorrect big-endian headers");
if (_archive.SelfLinkedDirs)
AddErrorMessage(s, "Self-linked directory");
if (_archive.TooDeepDirs)
AddErrorMessage(s, "Too deep directory levels");
if (!s.IsEmpty())
prop = s;
break;
}
}
prop.Detach(value);
return S_OK;
COM_TRY_END
}
示例4: GetProperty
STDMETHODIMP CAltStreamsFolder::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value)
{
NCOM::CPropVariant prop;
{
CAltStream &ss = Streams[index];
switch (propID)
{
case kpidIsDir: prop = false; break;
case kpidIsAltStream: prop = true; break;
case kpidName: prop = ss.Name; break;
case kpidSize: prop = ss.Size; break;
case kpidPackSize:
#ifdef UNDER_CE
prop = ss.Size;
#else
if (!ss.PackSize_Defined)
{
ss.PackSize_Defined = true;
if (!NFsFolder::MyGetCompressedFileSizeW(_pathPrefix + us2fs(ss.Name), ss.PackSize))
ss.PackSize = ss.Size;
}
prop = ss.PackSize;
#endif
break;
}
}
prop.Detach(value);
return S_OK;
}
示例5: GetProperty
STDMETHODIMP COpenArchiveCallback::GetProperty(PROPID propID, PROPVARIANT *value)
{
NCOM::CPropVariant prop;
if (_subArchiveMode)
{
switch(propID)
{
case kpidName: prop = _subArchiveName; break;
}
}
else
{
switch(propID)
{
case kpidName: prop = _fileInfo.Name; break;
case kpidIsDir: prop = _fileInfo.IsDir(); break;
case kpidSize: prop = _fileInfo.Size; break;
case kpidAttrib: prop = (UInt32)_fileInfo.Attrib; break;
case kpidCTime: prop = _fileInfo.CTime; break;
case kpidATime: prop = _fileInfo.ATime; break;
case kpidMTime: prop = _fileInfo.MTime; break;
}
}
prop.Detach(value);
return S_OK;
}
示例6: GetRootProp
STDMETHODIMP CHandler::GetRootProp(PROPID propID, PROPVARIANT *value)
{
// COM_TRY_BEGIN
NCOM::CPropVariant prop;
if (_db.Images.Size() != 0 && _db.NumExludededItems != 0)
{
const CImage &image = _db.Images[_db.IndexOfUserImage];
const CItem &item = _db.Items[image.StartItem];
if (!item.IsDir || item.ImageIndex != _db.IndexOfUserImage)
return E_FAIL;
const Byte *metadata = image.Meta + item.Offset;
switch (propID)
{
case kpidIsDir: prop = true; break;
case kpidAttrib: prop = (UInt32)Get32(metadata + 8); break;
case kpidCTime: GetFileTime(metadata + (_db.IsOldVersion ? 0x18: 0x28), prop); break;
case kpidATime: GetFileTime(metadata + (_db.IsOldVersion ? 0x20: 0x30), prop); break;
case kpidMTime: GetFileTime(metadata + (_db.IsOldVersion ? 0x28: 0x38), prop); break;
}
}
prop.Detach(value);
return S_OK;
// COM_TRY_END
}
示例7: GetProperty
STDMETHODIMP COpenCallbackImp::GetProperty(PROPID propID, PROPVARIANT *value)
{
COM_TRY_BEGIN
NCOM::CPropVariant propVariant;
if (_subArchiveMode)
{
switch(propID)
{
case kpidName:
propVariant = _subArchiveName;
break;
}
propVariant.Detach(value);
return S_OK;
}
switch(propID)
{
case kpidName:
propVariant = _fileInfo.getFileName();
break;
case kpidIsFolder:
propVariant = _fileInfo.IsDirectory();
break;
case kpidSize:
propVariant = _fileInfo.getSize();
break;
case kpidAttributes:
propVariant = (UInt32)_fileInfo.getAttributes();
break;
case kpidLastAccessTime:
propVariant = _fileInfo.getLastAccessTime();
break;
case kpidCreationTime:
propVariant = _fileInfo.getCreationTime();
break;
case kpidLastWriteTime:
propVariant = _fileInfo.getLastWriteTime();
break;
}
propVariant.Detach(value);
return S_OK;
COM_TRY_END
}
示例8: GetItemFullSize
STDMETHODIMP CFSFolder::GetItemFullSize(UInt32 index, PROPVARIANT *value, IProgress *progress)
{
NCOM::CPropVariant prop;
if (index >= (UInt32)_refs.Size())
return E_INVALIDARG;
UInt64 size = 0;
HRESULT result = GetItemFullSize(index, size, progress);
prop = size;
prop.Detach(value);
return result;
}
示例9: GetProperty
STDMETHODIMP CRootFolder::GetProperty(UInt32 itemIndex, PROPID propID, PROPVARIANT *value)
{
NCOM::CPropVariant prop;
switch(propID)
{
case kpidIsDir: prop = true; break;
case kpidName: prop = _names[itemIndex]; break;
}
prop.Detach(value);
return S_OK;
}
示例10: GetFolderProperty
STDMETHODIMP CRootFolder::GetFolderProperty(PROPID propID, PROPVARIANT *value)
{
NCOM::CPropVariant prop;
switch (propID)
{
case kpidType: prop = "RootFolder"; break;
case kpidPath: prop = ""; break;
}
prop.Detach(value);
return S_OK;
}
示例11: GetItemFullSize
STDMETHODIMP CPhysDriveFolder::GetItemFullSize(UInt32 index, PROPVARIANT *value, IProgress * /* progress */)
{
NCOM::CPropVariant prop;
if (index >= 1)
return E_INVALIDARG;
UInt64 size = 0;
HRESULT result = GetLength(size);
prop = size;
prop.Detach(value);
return result;
}
示例12: GetArchiveProperty
IMP_IInArchive_Props
IMP_IInArchive_ArcProps_NO_Table
STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
{
NCOM::CPropVariant prop;
switch(propID)
{
case kpidPhySize: if (_packSizeDefined) prop = _packSize; break;
}
prop.Detach(value);
return S_OK;
}
示例13: GetProperty
STDMETHODIMP CPhysDriveFolder::GetProperty(UInt32 itemIndex, PROPID propID, PROPVARIANT *value)
{
NCOM::CPropVariant prop;
if (itemIndex >= 1)
return E_INVALIDARG;
switch(propID)
{
case kpidIsDir: prop = false; break;
case kpidName: prop = _name; break;
case kpidSize: prop = _length; break;
}
prop.Detach(value);
return S_OK;
}
示例14: GetRootProp
STDMETHODIMP CArchiveUpdateCallback::GetRootProp(PROPID propID, PROPVARIANT *value)
{
NCOM::CPropVariant prop;
switch (propID)
{
case kpidIsDir: prop = true; break;
case kpidAttrib: if (ParentDirItem) prop = ParentDirItem->Attrib; break;
case kpidCTime: if (ParentDirItem) prop = ParentDirItem->CTime; break;
case kpidATime: if (ParentDirItem) prop = ParentDirItem->ATime; break;
case kpidMTime: if (ParentDirItem) prop = ParentDirItem->MTime; break;
}
prop.Detach(value);
return S_OK;
}
示例15: GetProperty
STDMETHODIMP CHandler::GetProperty(UInt32 /* index */, PROPID propID, PROPVARIANT *value)
{
NCOM::CPropVariant prop;
switch (propID)
{
case kpidPath: prop = _subName; break;
case kpidSize:
case kpidPackSize:
prop = _totalSize;
break;
}
prop.Detach(value);
return S_OK;
}