author | sl |
Tue, 10 Jun 2014 14:32:02 +0200 | |
changeset 1 | 260cb5ec6c19 |
permissions | -rw-r--r-- |
sl@0 | 1 |
// Copyright (c) 2008-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 the License "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 |
// f32\sfat32\inc\sl_leafdir_cache.inl |
sl@0 | 15 |
// |
sl@0 | 16 |
// |
sl@0 | 17 |
|
sl@0 | 18 |
/** |
sl@0 | 19 |
@file |
sl@0 | 20 |
@internalTechnology |
sl@0 | 21 |
|
sl@0 | 22 |
Overloaded == operator |
sl@0 | 23 |
|
sl@0 | 24 |
@param aDirPos the position to compare |
sl@0 | 25 |
@return EFalse if aDirPos matches self, else |
sl@0 | 26 |
ETrue |
sl@0 | 27 |
*/ |
sl@0 | 28 |
TBool TLeafDirData::operator==(const TLeafDirData &aDirPos) const |
sl@0 | 29 |
{ |
sl@0 | 30 |
return (aDirPos.iClusterNum == iClusterNum); |
sl@0 | 31 |
} |
sl@0 | 32 |
|
sl@0 | 33 |
/** |
sl@0 | 34 |
Overloaded != operator |
sl@0 | 35 |
|
sl@0 | 36 |
@param aDirPos the position to compare |
sl@0 | 37 |
@return EFlase if aDirPos matches self, else |
sl@0 | 38 |
ETrue |
sl@0 | 39 |
*/ |
sl@0 | 40 |
TBool TLeafDirData::operator!=(const TLeafDirData &aDirPos) const |
sl@0 | 41 |
{ |
sl@0 | 42 |
return (aDirPos.iClusterNum != iClusterNum); |
sl@0 | 43 |
} |
sl@0 | 44 |
|
sl@0 | 45 |
/** |
sl@0 | 46 |
'Get' function to retrieve the 'parent' node |
sl@0 | 47 |
|
sl@0 | 48 |
@return the parent node |
sl@0 | 49 |
*/ |
sl@0 | 50 |
CLeafDirTreeNode* CLeafDirTreeNode::Parent() |
sl@0 | 51 |
{ |
sl@0 | 52 |
return iParent; |
sl@0 | 53 |
} |
sl@0 | 54 |
|
sl@0 | 55 |
/** |
sl@0 | 56 |
Set Parent node |
sl@0 | 57 |
|
sl@0 | 58 |
@param the parent node to be set |
sl@0 | 59 |
*/ |
sl@0 | 60 |
void CLeafDirTreeNode::SetParent(CLeafDirTreeNode* aNode) |
sl@0 | 61 |
{ |
sl@0 | 62 |
iParent = aNode; |
sl@0 | 63 |
} |
sl@0 | 64 |
|
sl@0 | 65 |
/** |
sl@0 | 66 |
'Get' function to retrieve children nodes |
sl@0 | 67 |
|
sl@0 | 68 |
@return the children nodes |
sl@0 | 69 |
*/ |
sl@0 | 70 |
RPointerArray<CLeafDirTreeNode>& CLeafDirTreeNode::Children() |
sl@0 | 71 |
{ |
sl@0 | 72 |
return iChildren; |
sl@0 | 73 |
} |
sl@0 | 74 |
|
sl@0 | 75 |
/** |
sl@0 | 76 |
'Get' function to retrieve dir location store by this node |
sl@0 | 77 |
|
sl@0 | 78 |
@return the location of the directory |
sl@0 | 79 |
*/ |
sl@0 | 80 |
TUint32 CLeafDirTreeNode::StartClusterNum() const |
sl@0 | 81 |
{ |
sl@0 | 82 |
return iLeafDirData.iClusterNum; |
sl@0 | 83 |
} |
sl@0 | 84 |
|
sl@0 | 85 |
const TLeafDirData& CLeafDirTreeNode::LeafDirData() const |
sl@0 | 86 |
{ |
sl@0 | 87 |
return iLeafDirData; |
sl@0 | 88 |
} |
sl@0 | 89 |
|
sl@0 | 90 |
/** |
sl@0 | 91 |
Set position of the direcotry this node represents. |
sl@0 | 92 |
|
sl@0 | 93 |
@param aDirPos the position to be set |
sl@0 | 94 |
*/ |
sl@0 | 95 |
void CLeafDirTreeNode::SetLeafDirData(const TLeafDirData& aLeafDirData) |
sl@0 | 96 |
{ |
sl@0 | 97 |
iLeafDirData = aLeafDirData; |
sl@0 | 98 |
} |
sl@0 | 99 |
|
sl@0 | 100 |
/** |
sl@0 | 101 |
'Get' function to retrieve dir path store by this node |
sl@0 | 102 |
|
sl@0 | 103 |
@return the path of the directory |
sl@0 | 104 |
*/ |
sl@0 | 105 |
const TDesC& CLeafDirTreeNode::Path() const |
sl@0 | 106 |
{ |
sl@0 | 107 |
return iPath; |
sl@0 | 108 |
} |
sl@0 | 109 |
|
sl@0 | 110 |
/** |
sl@0 | 111 |
Test if self is ERoot type |
sl@0 | 112 |
|
sl@0 | 113 |
@return ETrue if self is ERoot |
sl@0 | 114 |
EFalse if self is of other types |
sl@0 | 115 |
*/ |
sl@0 | 116 |
TBool CLeafDirTreeNode::IsRoot() const |
sl@0 | 117 |
{ |
sl@0 | 118 |
return (iNodeType == ERoot); |
sl@0 | 119 |
} |
sl@0 | 120 |
|
sl@0 | 121 |
/** |
sl@0 | 122 |
Test if self is ELeaf type |
sl@0 | 123 |
|
sl@0 | 124 |
@return ETrue if self is ELeaf |
sl@0 | 125 |
EFalse if self is of other types |
sl@0 | 126 |
*/ |
sl@0 | 127 |
TBool CLeafDirTreeNode::IsLeaf() |
sl@0 | 128 |
{ |
sl@0 | 129 |
return (iNodeType == ELeaf); |
sl@0 | 130 |
} |
sl@0 | 131 |
|
sl@0 | 132 |
/** |
sl@0 | 133 |
Test if self is ELeafIntermediary type |
sl@0 | 134 |
|
sl@0 | 135 |
@return ETrue if self is ELeafIntermediary |
sl@0 | 136 |
EFalse if self is of other types |
sl@0 | 137 |
*/ |
sl@0 | 138 |
TBool CLeafDirTreeNode::IsLeafIntermediary() |
sl@0 | 139 |
{ |
sl@0 | 140 |
return (iNodeType == ELeafIntermediary); |
sl@0 | 141 |
} |
sl@0 | 142 |
|
sl@0 | 143 |
/** |
sl@0 | 144 |
Test if self is EPureIntermediary type |
sl@0 | 145 |
|
sl@0 | 146 |
@return ETrue if self is EPureIntermediary |
sl@0 | 147 |
EFalse if self is of other types |
sl@0 | 148 |
*/ |
sl@0 | 149 |
TBool CLeafDirTreeNode::IsPureIntermediary() |
sl@0 | 150 |
{ |
sl@0 | 151 |
return (iNodeType == EPureIntermediary); |
sl@0 | 152 |
} |
sl@0 | 153 |