author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Sat, 20 Feb 2010 00:10:51 +0200 | |
branch | RCL_3 |
changeset 19 | 4a8fed1c0ef6 |
parent 8 | 538db54a451d |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 2006-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\sfsrv\cl_clamp.cpp |
|
15 |
// |
|
16 |
// |
|
17 |
||
18 |
#include <f32file.h> |
|
8
538db54a451d
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
19 |
#include <e32ldr_private.h> |
0 | 20 |
|
21 |
||
22 |
EXPORT_C TInt RFileClamp::Clamp(RFile& aFile) |
|
23 |
/** |
|
24 |
Clamp the supplied file and store the resulting cookie in this object. |
|
25 |
||
26 |
@param aFile File to clamp. |
|
27 |
@return Symbian OS error code. |
|
28 |
*/ |
|
29 |
{ |
|
30 |
return aFile.Clamp(*this); |
|
31 |
} |
|
32 |
||
33 |
EXPORT_C TInt RFileClamp::Close(RFs& aFs) |
|
34 |
/** |
|
35 |
Unclamp the file which was clamped with this object. |
|
36 |
It is safe to call this function a handle that was not |
|
37 |
successfully opened. |
|
38 |
||
39 |
@param aFs File server session which was used to |
|
40 |
generate this clamp cookie value. |
|
41 |
@return Symbian OS error code. |
|
42 |
*/ |
|
43 |
{ |
|
44 |
TInt r = KErrNone; |
|
45 |
||
46 |
TBool opened = !(iCookie[0] == 0 && iCookie[1] == 0); |
|
47 |
if (opened) |
|
48 |
{ |
|
49 |
r = aFs.Unclamp(*this); |
|
50 |
if (r == KErrNone) |
|
51 |
*this = RFileClamp(); |
|
52 |
} |
|
53 |
||
54 |
return r; |
|
55 |
} |
|
56 |
||
57 |