userlibandfileserver/fileserver/sfat32/sl_leafdir_cache.inl
changeset 15 4122176ea935
equal deleted inserted replaced
0:a41df078684a 15:4122176ea935
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of the License "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // f32\sfat32\inc\sl_leafdir_cache.inl
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalTechnology
       
    21  
       
    22  Overloaded == operator 
       
    23  
       
    24  @param	aDirPos	the position to compare
       
    25  @return	EFalse	if aDirPos matches self, else
       
    26  ETrue
       
    27 */
       
    28 TBool TLeafDirData::operator==(const TLeafDirData &aDirPos) const
       
    29 	{
       
    30 	return (aDirPos.iClusterNum == iClusterNum);
       
    31 	}
       
    32 
       
    33 /**
       
    34 Overloaded != operator 
       
    35 
       
    36 @param	aDirPos	the position to compare
       
    37 @return	EFlase	if aDirPos matches self, else
       
    38 		ETrue
       
    39 */
       
    40 TBool TLeafDirData::operator!=(const TLeafDirData &aDirPos) const 
       
    41 	{
       
    42 	return (aDirPos.iClusterNum != iClusterNum);
       
    43 	}
       
    44 
       
    45 /**
       
    46 'Get' function to retrieve the 'parent' node
       
    47 
       
    48 @return	the parent node   
       
    49 */
       
    50 CLeafDirTreeNode* CLeafDirTreeNode::Parent()
       
    51 	{
       
    52 	return iParent;
       
    53 	}
       
    54 
       
    55 /**
       
    56 Set Parent node
       
    57 
       
    58 @param	the parent node to be set   
       
    59 */
       
    60 void CLeafDirTreeNode::SetParent(CLeafDirTreeNode* aNode)
       
    61 	{
       
    62 	iParent = aNode;
       
    63 	}
       
    64 
       
    65 /**
       
    66 'Get' function to retrieve children nodes
       
    67 
       
    68 @return	the children nodes   
       
    69 */
       
    70 RPointerArray<CLeafDirTreeNode>& CLeafDirTreeNode::Children()
       
    71 	{
       
    72 	return iChildren;
       
    73 	}
       
    74 
       
    75 /**
       
    76 'Get' function to retrieve dir location store by this node 
       
    77 
       
    78 @return	the location of the directory
       
    79 */
       
    80 TUint32 CLeafDirTreeNode::StartClusterNum() const
       
    81 	{
       
    82 	return iLeafDirData.iClusterNum;
       
    83 	}
       
    84 
       
    85 const TLeafDirData& CLeafDirTreeNode::LeafDirData() const
       
    86 	{
       
    87 	return iLeafDirData;
       
    88 	}
       
    89 
       
    90 /**
       
    91 Set position of the direcotry this node represents.
       
    92 
       
    93 @param	aDirPos	the position to be set
       
    94 */
       
    95 void CLeafDirTreeNode::SetLeafDirData(const TLeafDirData& aLeafDirData)
       
    96 	{
       
    97 	iLeafDirData = aLeafDirData;
       
    98 	}
       
    99 
       
   100 /**
       
   101 'Get' function to retrieve dir path store by this node 
       
   102 
       
   103 @return	the path of the directory
       
   104 */
       
   105 const TDesC& CLeafDirTreeNode::Path() const
       
   106 	{
       
   107 	return iPath;
       
   108 	}
       
   109 
       
   110 /**
       
   111 Test if self is ERoot type
       
   112 
       
   113 @return	ETrue if self is ERoot
       
   114 		EFalse	if self is of other types
       
   115 */
       
   116 TBool CLeafDirTreeNode::IsRoot() const 
       
   117 	{
       
   118 	return (iNodeType == ERoot);
       
   119 	}
       
   120 
       
   121 /**
       
   122 Test if self is ELeaf type
       
   123 
       
   124 @return	ETrue if self is ELeaf
       
   125 		EFalse	if self is of other types
       
   126 */
       
   127 TBool CLeafDirTreeNode::IsLeaf() 
       
   128 	{
       
   129 	return (iNodeType == ELeaf);
       
   130 	}
       
   131 
       
   132 /**
       
   133 Test if self is ELeafIntermediary type
       
   134 
       
   135 @return	ETrue if self is ELeafIntermediary
       
   136 		EFalse	if self is of other types
       
   137 */
       
   138 TBool CLeafDirTreeNode::IsLeafIntermediary() 
       
   139 	{
       
   140 	return (iNodeType == ELeafIntermediary);
       
   141 	}
       
   142 
       
   143 /**
       
   144 Test if self is EPureIntermediary type
       
   145 
       
   146 @return	ETrue if self is EPureIntermediary
       
   147 		EFalse	if self is of other types
       
   148 */
       
   149 TBool CLeafDirTreeNode::IsPureIntermediary() 
       
   150 	{
       
   151 	return (iNodeType == EPureIntermediary);
       
   152 	}
       
   153