1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/userlibandfileserver/fileserver/sfat32/sl_leafdir_cache.inl Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,153 @@
1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// f32\sfat32\inc\sl_leafdir_cache.inl
1.18 +//
1.19 +//
1.20 +
1.21 +/**
1.22 + @file
1.23 + @internalTechnology
1.24 +
1.25 + Overloaded == operator
1.26 +
1.27 + @param aDirPos the position to compare
1.28 + @return EFalse if aDirPos matches self, else
1.29 + ETrue
1.30 +*/
1.31 +TBool TLeafDirData::operator==(const TLeafDirData &aDirPos) const
1.32 + {
1.33 + return (aDirPos.iClusterNum == iClusterNum);
1.34 + }
1.35 +
1.36 +/**
1.37 +Overloaded != operator
1.38 +
1.39 +@param aDirPos the position to compare
1.40 +@return EFlase if aDirPos matches self, else
1.41 + ETrue
1.42 +*/
1.43 +TBool TLeafDirData::operator!=(const TLeafDirData &aDirPos) const
1.44 + {
1.45 + return (aDirPos.iClusterNum != iClusterNum);
1.46 + }
1.47 +
1.48 +/**
1.49 +'Get' function to retrieve the 'parent' node
1.50 +
1.51 +@return the parent node
1.52 +*/
1.53 +CLeafDirTreeNode* CLeafDirTreeNode::Parent()
1.54 + {
1.55 + return iParent;
1.56 + }
1.57 +
1.58 +/**
1.59 +Set Parent node
1.60 +
1.61 +@param the parent node to be set
1.62 +*/
1.63 +void CLeafDirTreeNode::SetParent(CLeafDirTreeNode* aNode)
1.64 + {
1.65 + iParent = aNode;
1.66 + }
1.67 +
1.68 +/**
1.69 +'Get' function to retrieve children nodes
1.70 +
1.71 +@return the children nodes
1.72 +*/
1.73 +RPointerArray<CLeafDirTreeNode>& CLeafDirTreeNode::Children()
1.74 + {
1.75 + return iChildren;
1.76 + }
1.77 +
1.78 +/**
1.79 +'Get' function to retrieve dir location store by this node
1.80 +
1.81 +@return the location of the directory
1.82 +*/
1.83 +TUint32 CLeafDirTreeNode::StartClusterNum() const
1.84 + {
1.85 + return iLeafDirData.iClusterNum;
1.86 + }
1.87 +
1.88 +const TLeafDirData& CLeafDirTreeNode::LeafDirData() const
1.89 + {
1.90 + return iLeafDirData;
1.91 + }
1.92 +
1.93 +/**
1.94 +Set position of the direcotry this node represents.
1.95 +
1.96 +@param aDirPos the position to be set
1.97 +*/
1.98 +void CLeafDirTreeNode::SetLeafDirData(const TLeafDirData& aLeafDirData)
1.99 + {
1.100 + iLeafDirData = aLeafDirData;
1.101 + }
1.102 +
1.103 +/**
1.104 +'Get' function to retrieve dir path store by this node
1.105 +
1.106 +@return the path of the directory
1.107 +*/
1.108 +const TDesC& CLeafDirTreeNode::Path() const
1.109 + {
1.110 + return iPath;
1.111 + }
1.112 +
1.113 +/**
1.114 +Test if self is ERoot type
1.115 +
1.116 +@return ETrue if self is ERoot
1.117 + EFalse if self is of other types
1.118 +*/
1.119 +TBool CLeafDirTreeNode::IsRoot() const
1.120 + {
1.121 + return (iNodeType == ERoot);
1.122 + }
1.123 +
1.124 +/**
1.125 +Test if self is ELeaf type
1.126 +
1.127 +@return ETrue if self is ELeaf
1.128 + EFalse if self is of other types
1.129 +*/
1.130 +TBool CLeafDirTreeNode::IsLeaf()
1.131 + {
1.132 + return (iNodeType == ELeaf);
1.133 + }
1.134 +
1.135 +/**
1.136 +Test if self is ELeafIntermediary type
1.137 +
1.138 +@return ETrue if self is ELeafIntermediary
1.139 + EFalse if self is of other types
1.140 +*/
1.141 +TBool CLeafDirTreeNode::IsLeafIntermediary()
1.142 + {
1.143 + return (iNodeType == ELeafIntermediary);
1.144 + }
1.145 +
1.146 +/**
1.147 +Test if self is EPureIntermediary type
1.148 +
1.149 +@return ETrue if self is EPureIntermediary
1.150 + EFalse if self is of other types
1.151 +*/
1.152 +TBool CLeafDirTreeNode::IsPureIntermediary()
1.153 + {
1.154 + return (iNodeType == EPureIntermediary);
1.155 + }
1.156 +