sl@0
|
1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
/**
|
sl@0
|
17 |
@file
|
sl@0
|
18 |
@publishedAll
|
sl@0
|
19 |
@prototype
|
sl@0
|
20 |
*/
|
sl@0
|
21 |
|
sl@0
|
22 |
#if !defined(__F32FILE64_H__)
|
sl@0
|
23 |
#define __F32FILE64_H__
|
sl@0
|
24 |
|
sl@0
|
25 |
|
sl@0
|
26 |
/**
|
sl@0
|
27 |
@publishedAll
|
sl@0
|
28 |
@prototype
|
sl@0
|
29 |
|
sl@0
|
30 |
Creates and opens a file, and performs all operations on a single open file.
|
sl@0
|
31 |
|
sl@0
|
32 |
This is equivalent to RFile class.
|
sl@0
|
33 |
This class is meant for accessing files of size greater than or equal to 2GB also.
|
sl@0
|
34 |
|
sl@0
|
35 |
These include:
|
sl@0
|
36 |
|
sl@0
|
37 |
- reading from and writing to the file
|
sl@0
|
38 |
|
sl@0
|
39 |
- seeking to a position within the file
|
sl@0
|
40 |
|
sl@0
|
41 |
- locking and unlocking within the file
|
sl@0
|
42 |
|
sl@0
|
43 |
- setting file attributes
|
sl@0
|
44 |
|
sl@0
|
45 |
Before using any of these services, a connection to a file server session must
|
sl@0
|
46 |
have been made, and the file must be open.
|
sl@0
|
47 |
|
sl@0
|
48 |
Opening Files:
|
sl@0
|
49 |
|
sl@0
|
50 |
- use Open() to open an existing file for reading or writing; an error is
|
sl@0
|
51 |
returned if it does not already exist.
|
sl@0
|
52 |
To open an existing file for reading only, use Open() with an access mode of
|
sl@0
|
53 |
EFileRead, and a share mode of EFileShareReadersOnly.
|
sl@0
|
54 |
|
sl@0
|
55 |
- use Create() to create and open a new file for writing; an error is returned
|
sl@0
|
56 |
if it already exists.
|
sl@0
|
57 |
|
sl@0
|
58 |
- use Replace() to open a file for writing, replacing any existing file of
|
sl@0
|
59 |
the same name if one exists, or creating a new file if one does not exist.
|
sl@0
|
60 |
Note that if a file exists, its length is reset to zero.
|
sl@0
|
61 |
|
sl@0
|
62 |
- use Temp() to create and open a temporary file with a unique name,
|
sl@0
|
63 |
for writing and reading.
|
sl@0
|
64 |
|
sl@0
|
65 |
When opening a file, you must specify the file server session to use for
|
sl@0
|
66 |
operations with that file. If you do not close the file explicitly, it is
|
sl@0
|
67 |
closed when the server session associated with it is closed.
|
sl@0
|
68 |
|
sl@0
|
69 |
Reading and Writing:
|
sl@0
|
70 |
|
sl@0
|
71 |
There are several variants of both Read() and Write().
|
sl@0
|
72 |
The basic Read(TDes8& aDes) and Write(const TDesC8& aDes) are supplemented
|
sl@0
|
73 |
by variants allowing the descriptor length to be overridden, or the seek
|
sl@0
|
74 |
position of the first byte to be specified, or asynchronous completion,
|
sl@0
|
75 |
or any combination.
|
sl@0
|
76 |
|
sl@0
|
77 |
Reading transfers data from a file to a descriptor, and writing transfers
|
sl@0
|
78 |
data from a descriptor to a file. In all cases, the file data is treated
|
sl@0
|
79 |
as binary and byte descriptors are used (TDes8, TDesC8).
|
sl@0
|
80 |
|
sl@0
|
81 |
@see RFile
|
sl@0
|
82 |
*/
|
sl@0
|
83 |
class RFile64 : public RFile
|
sl@0
|
84 |
{
|
sl@0
|
85 |
public:
|
sl@0
|
86 |
EFSRV_IMPORT_C TInt Open(RFs& aFs,const TDesC& aName,TUint aFileMode);
|
sl@0
|
87 |
EFSRV_IMPORT_C TInt Create(RFs& aFs,const TDesC& aName,TUint aFileMode);
|
sl@0
|
88 |
EFSRV_IMPORT_C TInt Replace(RFs& aFs,const TDesC& aName,TUint aFileMode);
|
sl@0
|
89 |
EFSRV_IMPORT_C TInt Temp(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode);
|
sl@0
|
90 |
|
sl@0
|
91 |
EFSRV_IMPORT_C TInt AdoptFromClient(const RMessage2& aMsg, TInt aFsIndex, TInt aFileIndex);
|
sl@0
|
92 |
EFSRV_IMPORT_C TInt AdoptFromServer(TInt aFsHandle, TInt aFileHandle);
|
sl@0
|
93 |
EFSRV_IMPORT_C TInt AdoptFromCreator(TInt aFsIndex, TInt aFileHandleIndex);
|
sl@0
|
94 |
|
sl@0
|
95 |
inline TInt Read(TDes8& aDes) const;
|
sl@0
|
96 |
inline void Read(TDes8& aDes,TRequestStatus& aStatus) const;
|
sl@0
|
97 |
inline TInt Read(TDes8& aDes,TInt aLength) const;
|
sl@0
|
98 |
inline void Read(TDes8& aDes,TInt aLength,TRequestStatus& aStatus) const;
|
sl@0
|
99 |
|
sl@0
|
100 |
EFSRV_IMPORT_C TInt Read(TInt64 aPos, TDes8& aDes) const;
|
sl@0
|
101 |
EFSRV_IMPORT_C void Read(TInt64 aPos, TDes8& aDes, TRequestStatus& aStatus) const;
|
sl@0
|
102 |
EFSRV_IMPORT_C TInt Read(TInt64 aPos, TDes8& aDes, TInt aLength) const;
|
sl@0
|
103 |
EFSRV_IMPORT_C void Read(TInt64 aPos, TDes8& aDes, TInt aLength,TRequestStatus& aStatus) const;
|
sl@0
|
104 |
|
sl@0
|
105 |
inline TInt Write(const TDesC8& aDes);
|
sl@0
|
106 |
inline void Write(const TDesC8& aDes,TRequestStatus& aStatus);
|
sl@0
|
107 |
inline TInt Write(const TDesC8& aDes,TInt aLength);
|
sl@0
|
108 |
inline void Write(const TDesC8& aDes,TInt aLength,TRequestStatus& aStatus);
|
sl@0
|
109 |
|
sl@0
|
110 |
EFSRV_IMPORT_C TInt Write(TInt64 aPos, const TDesC8& aDes);
|
sl@0
|
111 |
EFSRV_IMPORT_C void Write(TInt64 aPos, const TDesC8& aDes,TRequestStatus& aStatus);
|
sl@0
|
112 |
EFSRV_IMPORT_C TInt Write(TInt64 aPos, const TDesC8& aDes,TInt aLength);
|
sl@0
|
113 |
EFSRV_IMPORT_C void Write(TInt64 aPos, const TDesC8& aDes,TInt aLength,TRequestStatus& aStatus);
|
sl@0
|
114 |
|
sl@0
|
115 |
EFSRV_IMPORT_C TInt Seek(TSeek aMode, TInt64& aPos) const;
|
sl@0
|
116 |
EFSRV_IMPORT_C TInt Size(TInt64& aSize) const;
|
sl@0
|
117 |
EFSRV_IMPORT_C TInt SetSize(TInt64 aSize);
|
sl@0
|
118 |
EFSRV_IMPORT_C TInt Lock(TInt64 aPos, TInt64 aLength) const;
|
sl@0
|
119 |
EFSRV_IMPORT_C TInt UnLock(TInt64 aPos, TInt64 aLength) const;
|
sl@0
|
120 |
|
sl@0
|
121 |
#if defined(_F32_STRICT_64_BIT_MIGRATION)
|
sl@0
|
122 |
//
|
sl@0
|
123 |
// If _F32_STRICT_64_BIT_MIGRATION is defined, hide TUint overloads of RFile64::Read
|
sl@0
|
124 |
// and RFile64::Write APIs to force compiler errors when TUint positions are used.
|
sl@0
|
125 |
//
|
sl@0
|
126 |
private:
|
sl@0
|
127 |
#endif
|
sl@0
|
128 |
|
sl@0
|
129 |
EFSRV_IMPORT_C TInt Read(TUint aPos,TDes8& aDes) const;
|
sl@0
|
130 |
EFSRV_IMPORT_C void Read(TUint aPos,TDes8& aDes,TRequestStatus& aStatus) const;
|
sl@0
|
131 |
EFSRV_IMPORT_C TInt Read(TUint aPos,TDes8& aDes,TInt aLength) const;
|
sl@0
|
132 |
EFSRV_IMPORT_C void Read(TUint aPos,TDes8& aDes,TInt aLength,TRequestStatus& aStatus) const;
|
sl@0
|
133 |
|
sl@0
|
134 |
EFSRV_IMPORT_C TInt Write(TUint aPos,const TDesC8& aDes);
|
sl@0
|
135 |
EFSRV_IMPORT_C void Write(TUint aPos,const TDesC8& aDes,TRequestStatus& aStatus);
|
sl@0
|
136 |
EFSRV_IMPORT_C TInt Write(TUint aPos,const TDesC8& aDes,TInt aLength);
|
sl@0
|
137 |
EFSRV_IMPORT_C void Write(TUint aPos,const TDesC8& aDes,TInt aLength,TRequestStatus& aStatus);
|
sl@0
|
138 |
|
sl@0
|
139 |
#if defined(_F32_STRICT_64_BIT_MIGRATION)
|
sl@0
|
140 |
//
|
sl@0
|
141 |
// If _F32_STRICT_64_BIT_MIGRATION is defined, create private overloads of legacy 32-bit
|
sl@0
|
142 |
// RFile Read/Write API's to force compiler errors when TInt positions are used.
|
sl@0
|
143 |
//
|
sl@0
|
144 |
private:
|
sl@0
|
145 |
#endif
|
sl@0
|
146 |
|
sl@0
|
147 |
inline TInt Read(TInt aPos,TDes8& aDes) const;
|
sl@0
|
148 |
inline void Read(TInt aPos,TDes8& aDes,TRequestStatus& aStatus) const;
|
sl@0
|
149 |
inline TInt Read(TInt aPos,TDes8& aDes,TInt aLength) const;
|
sl@0
|
150 |
inline void Read(TInt aPos,TDes8& aDes,TInt aLength,TRequestStatus& aStatus) const;
|
sl@0
|
151 |
|
sl@0
|
152 |
inline TInt Write(TInt aPos,const TDesC8& aDes);
|
sl@0
|
153 |
inline void Write(TInt aPos,const TDesC8& aDes,TRequestStatus& aStatus);
|
sl@0
|
154 |
inline TInt Write(TInt aPos,const TDesC8& aDes,TInt aLength);
|
sl@0
|
155 |
inline void Write(TInt aPos,const TDesC8& aDes,TInt aLength,TRequestStatus& aStatus);
|
sl@0
|
156 |
|
sl@0
|
157 |
private:
|
sl@0
|
158 |
TInt Seek(TSeek aMode, TInt& aPos) const; // This API is not supported for RFile64
|
sl@0
|
159 |
TInt Size(TInt& aSize) const; // This API is not supported for RFile64
|
sl@0
|
160 |
friend class RFilePlugin;
|
sl@0
|
161 |
};
|
sl@0
|
162 |
|
sl@0
|
163 |
#ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
|
sl@0
|
164 |
#include <f32file64.inl>
|
sl@0
|
165 |
#endif
|
sl@0
|
166 |
|
sl@0
|
167 |
#endif
|