userlibandfileserver/fileserver/sfat32/fat_dir_entry.inl
branchRCL_3
changeset 62 4a8fed1c0ef6
parent 15 4122176ea935
child 87 2f92ad2dc5db
equal deleted inserted replaced
52:2d65c2f76d7b 62:4a8fed1c0ef6
    75 
    75 
    76 /**
    76 /**
    77 @return The size of file or directory for this entry 
    77 @return The size of file or directory for this entry 
    78 */
    78 */
    79 inline TUint32 TFatDirEntry::Size() const
    79 inline TUint32 TFatDirEntry::Size() const
    80     {return pDir->iSize;}
    80     {
       
    81     return pDir->iSize;
       
    82     }
       
    83 
    81 /**
    84 /**
    82 @return True if the entry is erased
    85 @return True if the entry is erased
    83 */
    86 */
    84 inline TBool TFatDirEntry::IsErased() const
    87 inline TBool TFatDirEntry::IsErased() const
    85     {return (TBool)(iData[0]==KEntryErasedMarker);}
    88     {return (TBool)(iData[0]==KEntryErasedMarker);}
   153 Set the size of the file or directory refered to by the entry
   156 Set the size of the file or directory refered to by the entry
   154 
   157 
   155 @param aFileSize Size of the file
   158 @param aFileSize Size of the file
   156 */
   159 */
   157 inline void TFatDirEntry::SetSize(TUint32 aFileSize)
   160 inline void TFatDirEntry::SetSize(TUint32 aFileSize)
   158     {pDir->iSize=aFileSize;}
   161     {
   159 /**
   162     pDir->iSize=aFileSize;
   160 Set the directory entry as erased
   163     }
   161 */
   164 
       
   165 /** Set the directory entry as erased */
   162 inline void TFatDirEntry::SetErased()
   166 inline void TFatDirEntry::SetErased()
   163     {iData[0]=KEntryErasedMarker;}
   167     {
   164 /**
   168     iData[0]=KEntryErasedMarker;
   165 Set the current entry to refer to the current directory
   169     }
   166 */
   170 
       
   171 /** Set the current entry to refer to the current directory */
   167 inline void TFatDirEntry::SetCurrentDirectory()
   172 inline void TFatDirEntry::SetCurrentDirectory()
   168     {
   173     {
   169     iData[0]='.';
   174     iData[0]='.';
   170     Mem::Fill(&iData[1],KFatDirNameSize-1,' ');
   175     Mem::Fill(&iData[1],KFatDirNameSize-1,' ');
   171     }
   176     }
   172 /**
   177  
   173 Set the current entry to refer to the parent directory
   178 /** Set the current entry to refer to the parent directory */
   174 */
       
   175 inline void TFatDirEntry::SetParentDirectory()
   179 inline void TFatDirEntry::SetParentDirectory()
   176     {
   180     {
   177     iData[0]='.';iData[1]='.';
   181     iData[0]='.';iData[1]='.';
   178     Mem::Fill(&iData[2],KFatDirNameSize-2,' ');
   182     Mem::Fill(&iData[2],KFatDirNameSize-2,' ');
   179     }
   183     }
   180 /**
   184 
   181 Set the current entry to be the end of directory marker
   185 /** Set the current entry to be the end of directory marker */
   182 */
       
   183 inline void TFatDirEntry::SetEndOfDirectory()
   186 inline void TFatDirEntry::SetEndOfDirectory()
   184     {Mem::FillZ(&iData[0],KFatDirNameSize);}
   187     {
       
   188     Mem::FillZ(&iData[0],KFatDirNameSize);
       
   189     }
   185 
   190 
   186 /**
   191 /**
   187     Get VFAT entry ID. Uset by Rugged FAT and Scan Drive to fix broken entries
   192     Get VFAT entry ID. Uset by Rugged FAT and Scan Drive to fix broken entries
   188     Uses 1 byte from "Last Access Date" field, offset 19. Hack.
   193     Uses 1 byte from "Last Access Date" field, offset 19. Hack.
   189 */
   194 */
   200     {
   205     {
   201     pDir->iReserved2 = aId;
   206     pDir->iReserved2 = aId;
   202     }
   207     }
   203 
   208 
   204 
   209 
   205 /**
   210 /** @return True if the entry is the start of a long name set of entries */
   206 @return True if the entry is the start of a long name set of entries
       
   207 */
       
   208 inline TBool TFatDirEntry::IsLongNameStart() const
   211 inline TBool TFatDirEntry::IsLongNameStart() const
   209     {return (TBool)((iData[0]&0x40) != 0);}
   212     {
   210 /**
   213     return (iData[0] & 0x40);
   211 @return True is the Entry is a VFat entry
   214     }
   212 */
   215 
       
   216 /** @return True is the Entry is a VFat entry */
   213 inline TBool TFatDirEntry::IsVFatEntry() const
   217 inline TBool TFatDirEntry::IsVFatEntry() const
   214     {return (TBool)(Attributes()==KVFatEntryAttribute && IsEndOfDirectory()==EFalse);}
   218     {
   215 /**
   219     return (Attributes()==KVFatEntryAttribute && IsEndOfDirectory() == EFalse);
   216 @return The number of following VFat entries
   220     }
   217 */
   221 
       
   222 /** @return The number of following VFat entries */
   218 inline TInt TFatDirEntry::NumFollowing() const
   223 inline TInt TFatDirEntry::NumFollowing() const
   219     {return (iData[0]&0x3F);}
   224     {
       
   225     return (iData[0]&0x3F);
       
   226     }
   220 
   227 
   221 
   228 
   222 inline TUint8 TFatDirEntry::CheckSum() const
   229 inline TUint8 TFatDirEntry::CheckSum() const
   223     {
   230     {
   224         ASSERT(IsVFatEntry());
   231         ASSERT(IsVFatEntry());
   225         return iData[13];
   232         return iData[13];
   226     }
   233     }
   227 
   234 
   228 
   235 
   229 
       
   230 /**
   236 /**
   231 @return  ETrue if the Directory entry contains garbage data
   237 @return  ETrue if the Directory entry contains garbage data
   232 */
   238 */
   233 inline TBool TFatDirEntry::IsGarbage() const
   239 inline TBool TFatDirEntry::IsGarbage() const
   234     {
   240     {