sl@0
|
1 |
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// Contains declaration for BSUL class to cache drive information
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
/**
|
sl@0
|
19 |
@file
|
sl@0
|
20 |
*/
|
sl@0
|
21 |
|
sl@0
|
22 |
#ifndef CCACHEDDRIVEINFO_H
|
sl@0
|
23 |
#define CCACHEDDRIVEINFO_H
|
sl@0
|
24 |
|
sl@0
|
25 |
#include <e32def.h>
|
sl@0
|
26 |
#include <f32file.h>
|
sl@0
|
27 |
|
sl@0
|
28 |
namespace BSUL
|
sl@0
|
29 |
{
|
sl@0
|
30 |
/**
|
sl@0
|
31 |
Class used to cache F32 drive information.
|
sl@0
|
32 |
@see TDriveInfo
|
sl@0
|
33 |
@publishedAll
|
sl@0
|
34 |
@released
|
sl@0
|
35 |
*/
|
sl@0
|
36 |
NONSHARABLE_CLASS(CCachedDriveInfo) : public CBase
|
sl@0
|
37 |
{
|
sl@0
|
38 |
private: // private type declarations
|
sl@0
|
39 |
// Struct to hold drive and media attributes retrieved from a TDriveInfo.
|
sl@0
|
40 |
struct TDriveAndMediaAttributes
|
sl@0
|
41 |
{
|
sl@0
|
42 |
// bit-field of drive attributes
|
sl@0
|
43 |
TUint32 iDriveAttributes;
|
sl@0
|
44 |
// bit-field of media attributes
|
sl@0
|
45 |
TUint32 iMediaAttributes;
|
sl@0
|
46 |
// Media type of the drive
|
sl@0
|
47 |
TMediaType iMediaType;
|
sl@0
|
48 |
};
|
sl@0
|
49 |
|
sl@0
|
50 |
public: // public methods
|
sl@0
|
51 |
IMPORT_C static CCachedDriveInfo* NewL(RFs& aFs);
|
sl@0
|
52 |
IMPORT_C static CCachedDriveInfo* NewLC(RFs& aFs);
|
sl@0
|
53 |
IMPORT_C ~CCachedDriveInfo();
|
sl@0
|
54 |
|
sl@0
|
55 |
IMPORT_C TBool IsReadOnlyInternalL(const TDesC& aFullName) const;
|
sl@0
|
56 |
IMPORT_C TBool IsReadOnlyInternalL(TDriveUnit aDrive) const;
|
sl@0
|
57 |
IMPORT_C TBool IsFlagSetOnDriveL(TDriveUnit aDrive, TUint aFlags) const;
|
sl@0
|
58 |
IMPORT_C TBool MediaTypeL(TDriveUnit aDrive, TMediaType aTestValue, TMediaType* aActual = NULL) const;
|
sl@0
|
59 |
IMPORT_C TDriveUnit GetDefaultRemovableMemoryCardDriveL() const;
|
sl@0
|
60 |
|
sl@0
|
61 |
private: // private methods
|
sl@0
|
62 |
CCachedDriveInfo();
|
sl@0
|
63 |
void ConstructL(RFs& aFs);
|
sl@0
|
64 |
|
sl@0
|
65 |
static TDriveUnit PathToDriveUnitL(const TDesC& aFullName);
|
sl@0
|
66 |
|
sl@0
|
67 |
private: // private data
|
sl@0
|
68 |
// Array containing the cached attributes for every drive.
|
sl@0
|
69 |
TDriveAndMediaAttributes iDriveAndMediaAttributes[KMaxDrives];
|
sl@0
|
70 |
};
|
sl@0
|
71 |
}
|
sl@0
|
72 |
|
sl@0
|
73 |
#endif // #ifndef CCACHEDDRIVEINFO_H
|