本文整理汇总了C++中TEntry::IsReadOnly方法的典型用法代码示例。如果您正苦于以下问题:C++ TEntry::IsReadOnly方法的具体用法?C++ TEntry::IsReadOnly怎么用?C++ TEntry::IsReadOnly使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TEntry
的用法示例。
在下文中一共展示了TEntry::IsReadOnly方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fillFromTEntry
void QFileSystemMetaData::fillFromTEntry(const TEntry& entry)
{
entryFlags &= ~(QFileSystemMetaData::SymbianTEntryFlags);
knownFlagsMask |= QFileSystemMetaData::SymbianTEntryFlags;
//Symbian doesn't have unix type file permissions
entryFlags |= QFileSystemMetaData::ReadPermissions;
if(!entry.IsReadOnly()) {
entryFlags |= QFileSystemMetaData::WritePermissions;
}
//set the type
if(entry.IsDir())
entryFlags |= (QFileSystemMetaData::DirectoryType | QFileSystemMetaData::ExecutePermissions);
else
entryFlags |= QFileSystemMetaData::FileType;
//set the attributes
entryFlags |= QFileSystemMetaData::ExistsAttribute;
if(entry.IsHidden())
entryFlags |= QFileSystemMetaData::HiddenAttribute;
#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
size_ = entry.FileSize();
#else
size_ = (TUint)(entry.iSize);
#endif
modificationTime_ = entry.iModified;
}
示例2: ResetAttributes
// ---------------------------------------------------------------------------
// CRfsFileMan::ResetAttributes
// ---------------------------------------------------------------------------
//
void CRfsFileMan::ResetAttributes( const TDesC& aFullPath, const TEntry& aEntry )
{
FUNC_LOG;
if ( aEntry.IsReadOnly() )
{
TInt err = iFs.SetEntry(
aFullPath, aEntry.iModified, 0, KEntryAttReadOnly | KEntryAttHidden );
ERROR( err, "Failed to reset attributes" );
}
}
示例3: FormatEntry
void FormatEntry(TDes& aBuffer, const TEntry& aEntry)
{
_LIT(KEntryDetails,"Entry details: ");
_LIT(KReadOnly," Read-only");
_LIT(KHidden," Hidden");
_LIT(KSystem," System");
_LIT(KDirectory," Directory");
_LIT(KArchive," Archive");
_LIT(KNewLIne,"\n");
aBuffer.Append(KEntryDetails);
if(aEntry.IsReadOnly())
aBuffer.Append(KReadOnly);
if(aEntry.IsHidden())
aBuffer.Append(KHidden);
if(aEntry.IsSystem())
aBuffer.Append(KSystem);
if(aEntry.IsDir())
aBuffer.Append(KDirectory);
if(aEntry.IsArchive())
aBuffer.Append(KArchive);
aBuffer.Append(KNewLIne);
}
示例4: CheckRequestL
/**
Verify request
*/
TMTPResponseCode CMTPSetObjectPropValue::CheckRequestL()
{
TMTPResponseCode responseCode = CMTPRequestProcessor::CheckRequestL();
TUint32 handle = Request().Uint32(TMTPTypeRequest::ERequestParameter1);
CMTPObjectMetaData* meta = iRequestChecker->GetObjectInfo(handle);
__ASSERT_DEBUG(meta, Panic(EMTPDpObjectNull));
if(!iSingleton.StorageMgr().IsReadWriteStorage(meta->Uint(CMTPObjectMetaData::EStorageId)))
{
responseCode = EMTPRespCodeAccessDenied;
}
if(responseCode == EMTPRespCodeOK)
{
TUint32 propCode = Request().Uint32(TMTPTypeRequest::ERequestParameter2);
if(propCode != EMTPObjectPropCodeAssociationType && propCode != EMTPObjectPropCodeAssociationDesc)
{
const TInt count = sizeof(KMTPDpSupportedProperties) / sizeof(TUint16);
TInt i = 0;
for(i = 0; i < count; i++)
{
if(KMTPDpSupportedProperties[i] == propCode
&& IsPropCodeReadonly(propCode))
// Object property code supported, but cann't be set.
{
responseCode = EMTPRespCodeAccessDenied;
break;
}
else if(KMTPDpSupportedProperties[i] == propCode)
// Object property code supported and can be set.
{
break;
}
}
if(i == count)
{
responseCode = EMTPRespCodeInvalidObjectPropCode;
}
}
else if(meta->Uint(CMTPObjectMetaData::EFormatCode) != EMTPFormatCodeAssociation)
{
responseCode = EMTPRespCodeInvalidObjectFormatCode;
}
}
else
{
const TDesC& suid(meta->DesC(CMTPObjectMetaData::ESuid));
TEntry entry;
LEAVEIFERROR( iFramework.Fs().Entry(suid, entry),
OstTraceExt1( TRACE_ERROR, CMTPSETOBJECTPROPVALUE_CHECKREQUESTL, "Gets entry details for %S failed!", suid));
//According to spec, there are 4 statuses: No Protection; Read-only; Read-only data; Non-transferrable data
//Currently, we only use FS's Read-only attribute to support No Protection and Read-only statuses.
//so if the attribute is read-only, we will return EMTPRespCodeAccessDenied.
if (entry.IsReadOnly())
{
responseCode = EMTPRespCodeAccessDenied;
}
}
return responseCode;
}