os/kernelhwsrv/userlibandfileserver/fileserver/shostmassstorage/msproxy/tmsmemmap.cpp
Update contrib.
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
20 // Maps a position to mass storage address space
30 #include "tmsmemmap.h"
34 TMsDataMemMap::TMsDataMemMap()
42 Checks that the block is within the limits of the media memory address space
43 and truncates the length if block extends beyond media size.
45 @param aPos [IN] Position of start address [OUT] Adjusted position to real
47 @param aLength [IN] Number of bytes [OUT] Number of bytes truncated in case
50 @return TInt KErrNone if block fits. KErrArgument if start position is
51 greater than the media size. KErrEof if block extends beyond media size.
53 TInt TMsDataMemMap::TranslateDataPos(TInt64& aPos, TInt& aLength) const
56 // Map to the actual position on the media
64 TInt64 endPos = aPos + aLength;
67 aLength = iSize - aPos;
74 Checks that the block is within the limits of the media memory address space
76 @param aPos [IN] Position of start address [OUT] Adjusted position to real
78 @param aLength Number of bytes.
80 @return TInt KErrNone if block fits. KErrArgument if start position is
81 greater than the media size. KErrEof if block extends beyond media size.
83 TInt TMsDataMemMap::CheckBlockInRange(TInt64& aPos, TInt aLength) const
86 // Map to the actual position on the media
94 TInt64 endPos = aPos + aLength;
97 __PXYPRINT2(_L("EOF found 0x%lx x%x"), aPos, aLength);