os/kernelhwsrv/userlibandfileserver/fileserver/srofs/sr_rofs.inl
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/userlibandfileserver/fileserver/srofs/sr_rofs.inl	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,95 @@
     1.4 +// Copyright (c) 1995-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 +// ROFS.INL
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +
    1.22 +inline const TText* CDirectoryCache::NameAddress( const TRofsEntry* aEntry )
    1.23 +	{
    1.24 +	return (const TText*)(((const TUint8*)aEntry) + aEntry->iNameOffset);
    1.25 +	};
    1.26 +
    1.27 +
    1.28 +inline TUint32 CDirectoryCache::AlignUp( TUint32 aValue )
    1.29 +	{
    1.30 +	return aValue + ((4-aValue) & 3); // round up to next word boundary
    1.31 +	};
    1.32 +
    1.33 +inline const TRofsDir* CDirectoryCache::RootDirectory() const
    1.34 +	{
    1.35 +	return reinterpret_cast<const TRofsDir*>( iTreeBuffer->Ptr() );
    1.36 +	}
    1.37 +
    1.38 +inline const TRofsDir* CDirectoryCache::RofsDirFromMediaOffset( TUint aMediaOffset ) const
    1.39 +	{
    1.40 +	return reinterpret_cast<const TRofsDir*>(aMediaOffset - iTreeMediaOffset + iTreeBuffer->Ptr() );
    1.41 +	};
    1.42 +
    1.43 +inline const TRofsDir* CDirectoryCache::RofsDirFromSubDirEntry( const TRofsEntry* aEntry ) const
    1.44 +	{
    1.45 +	return reinterpret_cast<const TRofsDir*>(aEntry->iFileAddress - iTreeMediaOffset + iTreeBuffer->Ptr() );
    1.46 +	};
    1.47 +
    1.48 +inline const TRofsEntry* CDirectoryCache::FirstSubDirEntryFromDir( const TRofsDir* aDir )
    1.49 +	{
    1.50 +	return reinterpret_cast<const TRofsEntry*>(((const TUint8*)aDir) + aDir->iFirstEntryOffset );
    1.51 +	}
    1.52 +
    1.53 +inline const TRofsEntry* CDirectoryCache::FirstFileEntryFromDir( const TRofsDir* aDir ) const
    1.54 +	{
    1.55 +	__ASSERT_DEBUG( aDir->iFileBlockAddress != NULL, CRofs::Panic( CRofs::EPanicNullFileBlock ));
    1.56 +	return reinterpret_cast<const TRofsEntry*>(aDir->iFileBlockAddress - iFilesMediaOffset + iFilesBuffer->Ptr() );
    1.57 +	}
    1.58 +
    1.59 +inline const TAny* CDirectoryCache::EndOfFileBlockPlusOne( const TRofsDir* aDir ) const
    1.60 +	{
    1.61 +	__ASSERT_DEBUG( aDir->iFileBlockAddress != NULL, CRofs::Panic( CRofs::EPanicNullFileBlock2 ));
    1.62 +	return reinterpret_cast<const TAny*>( ((TUint8*)FirstFileEntryFromDir(aDir)) + aDir->iFileBlockSize );
    1.63 +	}
    1.64 +
    1.65 +
    1.66 +inline const TAny* CDirectoryCache::EndOfDirPlusOne( const TRofsDir* aDir ) const
    1.67 +	{
    1.68 +	return reinterpret_cast<const TAny*>( ((TUint8*)aDir) + aDir->iStructSize );
    1.69 +	}
    1.70 +
    1.71 +inline const TRofsEntry* CDirectoryCache::NextEntry( const TRofsEntry* aEntry )
    1.72 +	{
    1.73 +	return (const TRofsEntry*)((const TUint8*)aEntry + AlignUp( aEntry->iStructSize ));
    1.74 +	}
    1.75 +
    1.76 +
    1.77 +inline CRofsMountCB& CRofsFileCB::RofsMount()
    1.78 +	{ return reinterpret_cast<CRofsMountCB&>(Mount()); };
    1.79 +
    1.80 +inline void CRofsFileCB::SetMediaBase(const TUint aBase)
    1.81 +	{iMediaBase=aBase;}
    1.82 +
    1.83 +inline void CRofsFileCB::SetAttExtra( TUint8 aAttExtra )
    1.84 +	{iAttExtra = aAttExtra;}
    1.85 +
    1.86 +
    1.87 +inline void CRofsDirCB::SetCache( CDirectoryCache* aCache )
    1.88 +	{iCache = aCache;}
    1.89 +
    1.90 +
    1.91 +inline CRofs& CRofsMountCB::FileSystem() const
    1.92 +	{return((CRofs&)Drive().FSys());}
    1.93 +
    1.94 +
    1.95 +inline TInt CRofs::TotalSupportedDrives() const
    1.96 +	{return iTotalSupportedDrives;}
    1.97 +
    1.98 +