--- a/epoc32/include/f32file.inl Wed Mar 31 12:27:01 2010 +0100
+++ b/epoc32/include/f32file.inl Wed Mar 31 12:33:34 2010 +0100
@@ -1,9 +1,9 @@
// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
-// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
+// under the terms of the License "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
-// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
+// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
@@ -76,15 +76,24 @@
*/
{return(iType.MostDerived());}
+/**
+Sets 64 bit file size.
-
+The low word is stored in iSize and high word is stored in private data member iSizeHigh.
+This is intended to be used by File Systsem Plugin implementations, and not recommended
+to be called by general clients of the File Server.
-// Returns the entire size of the TEntry...
-inline TInt EntrySize(const TEntry& anEntry)
- {return(sizeof(TUint)+sizeof(TInt)+sizeof(TTime)+sizeof(TInt)+sizeof(TUidType)+anEntry.iName.Size());}
+@publishedAll
+@prototype
-
-
+@see TEntry::iSize
+*/
+inline void TEntry::SetFileSize(TInt64 aFileSize)
+ {
+ iAtt &= ~KEntryAttPacked;
+ iSizeHigh=I64HIGH(aFileSize);
+ iSize=I64LOW(aFileSize);
+ }
// Class TFindFile
inline const TDesC& TFindFile::File() const
@@ -131,32 +140,150 @@
const TUint matchedFlags= aMask & KDriveAttMatchedFlags; //KDriveAttMatchedFlags = 0xFFF
const TUint matchedAtt = aMask & KDriveAttMatchedAtt; //KDriveAttMatchedAtt = 0x0FFF0000
-
switch(matchedAtt)
{
-
case KDriveAttExclude:
return matchedFlags==0?KErrArgument:KErrNone;
-
-
case KDriveAttExclusive :
return matchedFlags==0?KErrArgument:KErrNone;
-
-
case KDriveAttExclude | KDriveAttExclusive:
return matchedFlags==0?KErrArgument:KErrNone;
-
-
case KDriveAttAll:
return matchedFlags==0?KErrNone:KErrArgument;
-
case 0:
return KErrNone;
-
default:
- return KErrArgument;
-
+ return KErrArgument;
}
-
-
}
+
+inline RFs::TNameValidParam::TNameValidParam(TBool aUseSessionPath)
+ {
+ iError = ErrNone;
+ iUseSessionPath = aUseSessionPath;
+ iInvalidCharPos = 0;
+ }
+
+
+
+inline RFs::TNameValidParam::TError RFs::TNameValidParam::ErrorCode()const
+
+/**
+returns the error code.
+@see TError
+*/
+ {
+ return iError;
+ }
+
+/**
+Allows the user to set, whether he wants to use the session path for filling
+up missing parts of the name that he passes to RFs::IsValidName(TDesC& aName, TNameValidParam& aParam).
+If aUseSessionPath is EFalse, then the sessionpath is not used to validate aName.
+*/
+inline void RFs::TNameValidParam::UseSessionPath(TBool aUseSessionPath)
+ {
+ iUseSessionPath = aUseSessionPath;
+ }
+
+/**
+if the error code returned by TNameValidParam::ErrorCode() is TError::ErrBadCharacter,
+then this returns the position of the rightmost invalid character.
+For eg: "a>bcd>" would have the iInvalidCharPos=6 and not 2.
+However preference is given to wild characters whil reporting the invalid character position
+For eg: "a*bcd>" would return the iInvalidCharPos= 2 and not 6.
+if any other error code is returned then this value is 0.
+*/
+inline TUint RFs::TNameValidParam::InvalidCharPos()const
+ {
+ return iInvalidCharPos;
+ }
+
+
+
+
+//-------------------------------------------------------------------------------------------------------------------
+TVolFormatParam::TVolFormatParam()
+ :iUId((TUint32)KUId), iFSysNameHash(0)
+ {
+ Init();
+ }
+
+/** resets all data to the "not set" values */
+void TVolFormatParam::Init()
+ {
+ iFSysNameHash = 0;
+ iParamsSet = EFalse;
+ Mem::FillZ(iData, sizeof(iData));
+ }
+
+/**
+ Calculates the file system name hash. For use in conjunction with this class only
+ The file system name hash is a standard CRC32 on the up-cased name.
+
+ @param aFsName given name.
+ @return CRC32 name hash value
+
+*/
+TUint32 TVolFormatParam::CalcFSNameHash(const TDesC& aFsName)
+ {
+ TUint32 nameHash = 0;
+
+ if(aFsName.Length() > 0)
+ {
+ TFullName fsName;
+ fsName.Copy(aFsName);
+ fsName.UpperCase();
+ Mem::Crc32(nameHash, fsName.Ptr(), fsName.Length());
+ }
+
+ return nameHash;
+ }
+
+
+/** sets the file system name hash corresponding to aFsName */
+void TVolFormatParam::SetFileSystemName(const TDesC& aFsName)
+ {
+ iFSysNameHash = CalcFSNameHash(aFsName);
+ }
+
+/** @return file system name hash that was wet by SetFileSystemName() */
+TUint32 TVolFormatParam::FSNameHash() const
+ {
+ return iFSysNameHash;
+ }
+
+/** @return ETrue if the user has set at least one parameter apart from the file sysetm name, i.e. SetVal() was called */
+TBool TVolFormatParam::SomeParamsSet() const
+ {
+ return iParamsSet;
+ }
+
+/**
+ assign a data slot some integer value.
+ @param index of the slot 0..KMaxDataSlots-1
+ @aVal value to set
+*/
+void TVolFormatParam::SetVal(TUint aIndex, TUint32 aVal)
+ {
+ ASSERT(aIndex < KMaxDataSlots);
+ iData[aIndex] = aVal;
+ iParamsSet= ETrue;
+ }
+
+/**
+ @param index of the slot 0..KMaxDataSlots-1
+ @return data from the specified slot
+*/
+TUint32 TVolFormatParam::GetVal(TUint aIndex) const
+ {
+ ASSERT(aIndex< KMaxDataSlots);
+ return iData[aIndex];
+ }
+
+
+
+
+
+
+