epoc32/include/f32file.inl
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@2
     4
// 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
williamr@2
     5
// which accompanies this distribution, and is available
williamr@2
     6
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
// f32\inc\f32file.inl
williamr@2
    15
// 
williamr@2
    16
//
williamr@2
    17
williamr@2
    18
williamr@2
    19
williamr@2
    20
williamr@2
    21
// Class TEntry
williamr@2
    22
inline const TUid& TEntry::operator[](TInt anIndex) const
williamr@2
    23
/**
williamr@2
    24
Gets any one of the file's three UIDs.
williamr@2
    25
williamr@2
    26
@param anIndex Identifies the UID required. This can be zero, one or 
williamr@2
    27
               two. Specifiying any other value raises a panic.
williamr@2
    28
williamr@2
    29
@return On return, contains the requested UID.
williamr@2
    30
williamr@2
    31
@see TUidType
williamr@2
    32
*/
williamr@2
    33
    {return(iType[anIndex]);}
williamr@2
    34
williamr@2
    35
williamr@2
    36
williamr@2
    37
williamr@2
    38
inline TBool TEntry::IsUidPresent(TUid aUid) const
williamr@2
    39
/**
williamr@2
    40
Tests whether the specified UID matches any of the UIDs in the UID type.
williamr@2
    41
williamr@2
    42
@param aUid The UID to be checked.
williamr@2
    43
williamr@2
    44
@return True if the specified UID is present, false otherwise.
williamr@2
    45
williamr@2
    46
@see TUidType::IsPresent
williamr@2
    47
@see TUidType
williamr@2
    48
*/
williamr@2
    49
    {return(iType.IsPresent(aUid));}
williamr@2
    50
williamr@2
    51
williamr@2
    52
williamr@2
    53
williamr@2
    54
inline TBool TEntry::IsTypeValid() const
williamr@2
    55
/**
williamr@2
    56
Test whether the file has a valid UID.
williamr@2
    57
williamr@2
    58
@return True if the entry has a valid UID, false otherwise. 
williamr@2
    59
williamr@2
    60
@see TUidType::IsValid  
williamr@2
    61
@see TUidType
williamr@2
    62
*/
williamr@2
    63
    {return(iType.IsValid());}
williamr@2
    64
williamr@2
    65
williamr@2
    66
williamr@2
    67
williamr@2
    68
inline TUid TEntry::MostDerivedUid() const
williamr@2
    69
/**
williamr@2
    70
Gets the most derived (i.e. the most specific) UID.
williamr@2
    71
williamr@2
    72
@return The entry's most derived UID.
williamr@2
    73
williamr@2
    74
@see TUidType::MostDerived
williamr@2
    75
@see TUidType
williamr@2
    76
*/
williamr@2
    77
    {return(iType.MostDerived());}
williamr@2
    78
williamr@2
    79
williamr@2
    80
williamr@2
    81
williamr@2
    82
//	Returns the entire size of the TEntry...
williamr@2
    83
inline TInt EntrySize(const TEntry& anEntry)
williamr@2
    84
	{return(sizeof(TUint)+sizeof(TInt)+sizeof(TTime)+sizeof(TInt)+sizeof(TUidType)+anEntry.iName.Size());}
williamr@2
    85
williamr@2
    86
williamr@2
    87
williamr@2
    88
williamr@2
    89
// Class TFindFile
williamr@2
    90
inline const TDesC& TFindFile::File() const
williamr@2
    91
/**
williamr@2
    92
Gets the full file specification of a file which was found by a successful 
williamr@2
    93
call to any of the search variants that do not accept wildcards.
williamr@2
    94
williamr@2
    95
The file specification includes drive, path and filename.
williamr@2
    96
williamr@2
    97
Notes:
williamr@2
    98
williamr@2
    99
1. When called after a successful search using wildcards the only valid 
williamr@2
   100
   components of the retrieved file specification are drive letter and 
williamr@2
   101
   directory.
williamr@2
   102
   
williamr@2
   103
@return The full path and filename.
williamr@2
   104
*/
williamr@2
   105
	{return iFile.FullName();}
williamr@2
   106
williamr@2
   107
williamr@2
   108
williamr@2
   109
// Class CDirScan
williamr@2
   110
inline RFs& CDirScan::Fs()
williamr@2
   111
	{return(*iFs);}
williamr@2
   112
williamr@2
   113
williamr@2
   114
williamr@2
   115
williamr@2
   116
// Class TDriveUnit
williamr@2
   117
inline TDriveUnit::operator TInt() const
williamr@2
   118
/**
williamr@2
   119
Converts the drive unit to an integer value.
williamr@2
   120
*/
williamr@2
   121
	{return(iDrive);}
williamr@2
   122
williamr@2
   123
williamr@2
   124
williamr@2
   125
williamr@2
   126
inline TInt ValidateMatchMask( TUint aMask)
williamr@2
   127
/**
williamr@2
   128
Validates the mask used to match drive attributes.
williamr@2
   129
*/
williamr@2
   130
	{
williamr@2
   131
	const TUint matchedFlags= aMask & KDriveAttMatchedFlags;  //KDriveAttMatchedFlags = 0xFFF
williamr@2
   132
	const TUint matchedAtt = aMask & KDriveAttMatchedAtt;	 //KDriveAttMatchedAtt = 0x0FFF0000
williamr@2
   133
	
williamr@2
   134
williamr@2
   135
	switch(matchedAtt)
williamr@2
   136
		{
williamr@2
   137
williamr@2
   138
		case KDriveAttExclude:
williamr@2
   139
			return matchedFlags==0?KErrArgument:KErrNone;
williamr@2
   140
			
williamr@2
   141
williamr@2
   142
		case KDriveAttExclusive :
williamr@2
   143
			return matchedFlags==0?KErrArgument:KErrNone;
williamr@2
   144
			
williamr@2
   145
williamr@2
   146
		case KDriveAttExclude | KDriveAttExclusive:
williamr@2
   147
			return matchedFlags==0?KErrArgument:KErrNone;
williamr@2
   148
			
williamr@2
   149
williamr@2
   150
		case KDriveAttAll:
williamr@2
   151
			return matchedFlags==0?KErrNone:KErrArgument;
williamr@2
   152
							
williamr@2
   153
		case 0:
williamr@2
   154
			return KErrNone;
williamr@2
   155
			
williamr@2
   156
		default:
williamr@2
   157
			return KErrArgument;			
williamr@2
   158
							
williamr@2
   159
		}
williamr@2
   160
			
williamr@2
   161
				
williamr@2
   162
	}