18 #include <mtp/mmtpdataproviderframework.h> |
18 #include <mtp/mmtpdataproviderframework.h> |
19 #include <mtp/mmtpstoragemgr.h> |
19 #include <mtp/mmtpstoragemgr.h> |
20 #include <mtp/cmtpstoragemetadata.h> |
20 #include <mtp/cmtpstoragemetadata.h> |
21 #include <mtp/cmtpmetadata.h> |
21 #include <mtp/cmtpmetadata.h> |
22 #include <e32hashtab.h> |
22 #include <e32hashtab.h> |
|
23 #include "OstTraceDefinitions.h" |
|
24 #ifdef OST_TRACE_COMPILER_IN_USE |
|
25 #include "cmtpfsexclusionmgrTraces.h" |
|
26 #endif |
|
27 |
23 |
28 |
24 //[SP-Format-0x3002] |
29 //[SP-Format-0x3002] |
25 //The full path of DDISCVRY.DPS of PictBridge DP. |
30 //The full path of DDISCVRY.DPS of PictBridge DP. |
26 _LIT(KFullNameOfPictBridgeDiscovery, "C:\\DATA\\DDISCVRY.DPS"); |
31 _LIT(KFullNameOfPictBridgeDiscovery, "C:\\DATA\\DDISCVRY.DPS"); |
27 |
32 |
28 __FLOG_STMT(_LIT8(KComponent,"CMTPFSExclusionMgr");) |
|
29 |
|
30 EXPORT_C CMTPFSExclusionMgr::CMTPFSExclusionMgr(MMTPDataProviderFramework& aFramework) : |
33 EXPORT_C CMTPFSExclusionMgr::CMTPFSExclusionMgr(MMTPDataProviderFramework& aFramework) : |
31 iFramework(aFramework), iOrder(CMTPMetaData::CompareTPathHash) |
34 iFramework(aFramework), iOrder(CMTPMetaData::CompareTPathHash) |
32 { |
35 { |
33 __FLOG_OPEN(KMTPSubsystem, KComponent); |
|
34 } |
36 } |
35 |
37 |
36 EXPORT_C CMTPFSExclusionMgr::~CMTPFSExclusionMgr() |
38 EXPORT_C CMTPFSExclusionMgr::~CMTPFSExclusionMgr() |
37 { |
39 { |
38 __FLOG_CLOSE; |
|
39 } |
40 } |
40 |
41 |
41 EXPORT_C TBool CMTPFSExclusionMgr::IsFolderAcceptedL(const TDesC& aPath, TUint32 aStorageId) const |
42 EXPORT_C TBool CMTPFSExclusionMgr::IsFolderAcceptedL(const TDesC& aPath, TUint32 aStorageId) const |
42 { |
43 { |
43 return IsPathAcceptedL(aPath, aStorageId); |
44 return IsPathAcceptedL(aPath, aStorageId); |
44 } |
45 } |
45 |
46 |
46 EXPORT_C TBool CMTPFSExclusionMgr::IsFileAcceptedL(const TDesC& aPath, TUint32 /*aStorageId*/) const |
47 EXPORT_C TBool CMTPFSExclusionMgr::IsFileAcceptedL(const TDesC& aPath, TUint32 /*aStorageId*/) const |
47 { |
48 { |
48 __FLOG(_L8("IsFileAcceptedL - Entry")); |
49 OstTraceFunctionEntry0( CMTPFSEXCLUSIONMGR_ISFILEACCEPTEDL_ENTRY ); |
49 |
50 |
50 TBool accepted = ETrue; |
51 TBool accepted = ETrue; |
51 TParsePtrC parse(aPath); |
52 TParsePtrC parse(aPath); |
52 |
53 |
53 if (parse.ExtPresent()) |
54 if (parse.ExtPresent()) |
54 { |
55 { |
55 accepted = IsExtensionValid(parse.Ext().Mid(1)); |
56 accepted = IsExtensionValid(parse.Ext().Mid(1)); |
56 __FLOG_VA((_L8("IsExtensionValid = %d"), accepted)); |
57 OstTrace1( TRACE_NORMAL, DUP1_CMTPFSEXCLUSIONMGR_ISFILEACCEPTEDL, "IsExtensionValid = %d", accepted ); |
57 } |
58 } |
58 |
59 |
59 //[SP-Format-0x3002] |
60 //[SP-Format-0x3002] |
60 //They are used to exclude DDISCVRY.DPS from the process of file dp's enumeration. |
61 //They are used to exclude DDISCVRY.DPS from the process of file dp's enumeration. |
61 if(accepted) |
62 if(accepted) |
65 if( tmp == KFullNameOfPictBridgeDiscovery ) |
66 if( tmp == KFullNameOfPictBridgeDiscovery ) |
66 { |
67 { |
67 accepted = EFalse; |
68 accepted = EFalse; |
68 } |
69 } |
69 } |
70 } |
70 __FLOG_VA((_L8("Exit IsFileAcceptedL = %d"), accepted)); |
71 OstTrace1( TRACE_NORMAL, CMTPFSEXCLUSIONMGR_ISFILEACCEPTEDL, "IsFileAcceptedL = %d", accepted); |
|
72 OstTraceFunctionExit0( CMTPFSEXCLUSIONMGR_ISFILEACCEPTEDL_EXIT ); |
71 return accepted; |
73 return accepted; |
72 } |
74 } |
73 |
75 |
74 EXPORT_C TBool CMTPFSExclusionMgr::IsPathAcceptedL(const TDesC& aPath, TUint32 aStorageId) const |
76 EXPORT_C TBool CMTPFSExclusionMgr::IsPathAcceptedL(const TDesC& aPath, TUint32 aStorageId) const |
75 { |
77 { |
|
78 OstTraceFunctionEntry0( CMTPFSEXCLUSIONMGR_ISPATHACCEPTEDL_ENTRY ); |
76 |
79 |
77 CMTPStorageMetaData* storageMetaData = (CMTPStorageMetaData *)& iFramework.StorageMgr().StorageL(aStorageId); |
80 CMTPStorageMetaData* storageMetaData = (CMTPStorageMetaData *)& iFramework.StorageMgr().StorageL(aStorageId); |
78 TBool accepted = EFalse; |
81 TBool accepted = EFalse; |
79 |
82 |
80 if (storageMetaData->Uint(CMTPStorageMetaData::EStorageSystemType) == CMTPStorageMetaData::ESystemTypeDefaultFileSystem) |
83 if (storageMetaData->Uint(CMTPStorageMetaData::EStorageSystemType) == CMTPStorageMetaData::ESystemTypeDefaultFileSystem) |