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