os/kernelhwsrv/userlibandfileserver/fileserver/inc/f32file64.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/userlibandfileserver/fileserver/inc/f32file64.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,167 @@
     1.4 +// Copyright (c) 2008-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 +//
    1.18 +
    1.19 +/**
    1.20 + @file
    1.21 + @publishedAll
    1.22 + @prototype
    1.23 +*/
    1.24 +
    1.25 +#if !defined(__F32FILE64_H__)
    1.26 +#define __F32FILE64_H__
    1.27 +
    1.28 +
    1.29 +/**
    1.30 +@publishedAll
    1.31 +@prototype
    1.32 +
    1.33 +Creates and opens a file, and performs all operations on a single open file.
    1.34 +
    1.35 +This is equivalent to RFile class.
    1.36 +This class is meant for accessing files of size greater than or equal to 2GB also.
    1.37 +
    1.38 +These include:
    1.39 +
    1.40 +- reading from and writing to the file
    1.41 +
    1.42 +- seeking to a position within the file
    1.43 +
    1.44 +- locking and unlocking within the file
    1.45 +
    1.46 +- setting file attributes
    1.47 +
    1.48 +Before using any of these services, a connection to a file server session must
    1.49 +have been made, and the file must be open.
    1.50 +
    1.51 +Opening Files:
    1.52 +
    1.53 +-  use Open() to open an existing file for reading or writing; an error is
    1.54 +   returned if it does not already exist.
    1.55 +   To open an existing file for reading only, use Open() with an access mode of
    1.56 +   EFileRead, and a share mode of EFileShareReadersOnly.
    1.57 +
    1.58 +-  use Create() to create and open a new file for writing; an error is returned
    1.59 +   if it already exists.
    1.60 +
    1.61 +-  use Replace() to open a file for writing, replacing any existing file of
    1.62 +   the same name if one exists, or creating a new file if one does not exist.
    1.63 +   Note that if a file exists, its length is reset to zero.
    1.64 +
    1.65 +-  use Temp() to create and open a temporary file with a unique name,
    1.66 +   for writing and reading.
    1.67 +
    1.68 +When opening a file, you must specify the file server session to use for
    1.69 +operations with that file. If you do not close the file explicitly, it is
    1.70 +closed when the server session associated with it is closed.
    1.71 +
    1.72 +Reading and Writing:
    1.73 +
    1.74 +There are several variants of both Read() and Write().
    1.75 +The basic Read(TDes8& aDes) and Write(const TDesC8& aDes) are supplemented
    1.76 +by variants allowing the descriptor length to be overridden, or the seek
    1.77 +position of the first byte to be specified, or asynchronous completion,
    1.78 +or any combination.
    1.79 +
    1.80 +Reading transfers data from a file to a descriptor, and writing transfers
    1.81 +data from a descriptor to a file. In all cases, the file data is treated
    1.82 +as binary and byte descriptors are used (TDes8, TDesC8).
    1.83 +
    1.84 +@see RFile
    1.85 +*/
    1.86 +class RFile64 : public RFile
    1.87 +	{
    1.88 +public:
    1.89 +	EFSRV_IMPORT_C TInt Open(RFs& aFs,const TDesC& aName,TUint aFileMode);
    1.90 +	EFSRV_IMPORT_C TInt Create(RFs& aFs,const TDesC& aName,TUint aFileMode);
    1.91 +	EFSRV_IMPORT_C TInt Replace(RFs& aFs,const TDesC& aName,TUint aFileMode);
    1.92 +	EFSRV_IMPORT_C TInt Temp(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode);
    1.93 +
    1.94 +	EFSRV_IMPORT_C TInt AdoptFromClient(const RMessage2& aMsg, TInt aFsIndex, TInt aFileIndex);
    1.95 +	EFSRV_IMPORT_C TInt AdoptFromServer(TInt aFsHandle, TInt aFileHandle);
    1.96 +	EFSRV_IMPORT_C TInt AdoptFromCreator(TInt aFsIndex, TInt aFileHandleIndex);
    1.97 +	
    1.98 +	inline TInt Read(TDes8& aDes) const;
    1.99 +	inline void Read(TDes8& aDes,TRequestStatus& aStatus) const;
   1.100 +	inline TInt Read(TDes8& aDes,TInt aLength) const;
   1.101 +	inline void Read(TDes8& aDes,TInt aLength,TRequestStatus& aStatus) const;
   1.102 +	
   1.103 +	EFSRV_IMPORT_C TInt Read(TInt64 aPos, TDes8& aDes) const;
   1.104 +	EFSRV_IMPORT_C void Read(TInt64 aPos, TDes8& aDes, TRequestStatus& aStatus) const;
   1.105 +	EFSRV_IMPORT_C TInt Read(TInt64 aPos, TDes8& aDes, TInt aLength) const;
   1.106 +	EFSRV_IMPORT_C void Read(TInt64 aPos, TDes8& aDes, TInt aLength,TRequestStatus& aStatus) const;
   1.107 +	
   1.108 +	inline TInt Write(const TDesC8& aDes);
   1.109 +	inline void Write(const TDesC8& aDes,TRequestStatus& aStatus);
   1.110 +	inline TInt Write(const TDesC8& aDes,TInt aLength);
   1.111 +	inline void Write(const TDesC8& aDes,TInt aLength,TRequestStatus& aStatus);
   1.112 +	
   1.113 +	EFSRV_IMPORT_C TInt Write(TInt64 aPos, const TDesC8& aDes);
   1.114 +	EFSRV_IMPORT_C void Write(TInt64 aPos, const TDesC8& aDes,TRequestStatus& aStatus);
   1.115 +	EFSRV_IMPORT_C TInt Write(TInt64 aPos, const TDesC8& aDes,TInt aLength);
   1.116 +	EFSRV_IMPORT_C void Write(TInt64 aPos, const TDesC8& aDes,TInt aLength,TRequestStatus& aStatus);
   1.117 +	
   1.118 +	EFSRV_IMPORT_C TInt Seek(TSeek aMode, TInt64& aPos) const;
   1.119 +	EFSRV_IMPORT_C TInt Size(TInt64& aSize) const;
   1.120 +	EFSRV_IMPORT_C TInt SetSize(TInt64 aSize);
   1.121 +	EFSRV_IMPORT_C TInt Lock(TInt64 aPos, TInt64 aLength) const;
   1.122 +	EFSRV_IMPORT_C TInt UnLock(TInt64 aPos, TInt64 aLength) const;
   1.123 +	
   1.124 +#if defined(_F32_STRICT_64_BIT_MIGRATION)
   1.125 +//
   1.126 +// If _F32_STRICT_64_BIT_MIGRATION is defined, hide TUint overloads of RFile64::Read 
   1.127 +// and RFile64::Write APIs to force compiler errors when TUint positions are used.
   1.128 +//
   1.129 +private:
   1.130 +#endif
   1.131 +	
   1.132 +	EFSRV_IMPORT_C TInt Read(TUint aPos,TDes8& aDes) const;
   1.133 +	EFSRV_IMPORT_C void Read(TUint aPos,TDes8& aDes,TRequestStatus& aStatus) const;
   1.134 +	EFSRV_IMPORT_C TInt Read(TUint aPos,TDes8& aDes,TInt aLength) const;
   1.135 +	EFSRV_IMPORT_C void Read(TUint aPos,TDes8& aDes,TInt aLength,TRequestStatus& aStatus) const;
   1.136 +	
   1.137 +	EFSRV_IMPORT_C TInt Write(TUint aPos,const TDesC8& aDes);
   1.138 +	EFSRV_IMPORT_C void Write(TUint aPos,const TDesC8& aDes,TRequestStatus& aStatus);
   1.139 +	EFSRV_IMPORT_C TInt Write(TUint aPos,const TDesC8& aDes,TInt aLength);
   1.140 +	EFSRV_IMPORT_C void Write(TUint aPos,const TDesC8& aDes,TInt aLength,TRequestStatus& aStatus);
   1.141 +	
   1.142 +#if defined(_F32_STRICT_64_BIT_MIGRATION)
   1.143 +//
   1.144 +// If _F32_STRICT_64_BIT_MIGRATION is defined, create private overloads of legacy 32-bit 
   1.145 +// RFile Read/Write API's to force compiler errors when TInt positions are used.
   1.146 +//
   1.147 +private:
   1.148 +#endif
   1.149 +	
   1.150 +	inline TInt Read(TInt aPos,TDes8& aDes) const;
   1.151 +	inline void Read(TInt aPos,TDes8& aDes,TRequestStatus& aStatus) const;
   1.152 +	inline TInt Read(TInt aPos,TDes8& aDes,TInt aLength) const;
   1.153 +	inline void Read(TInt aPos,TDes8& aDes,TInt aLength,TRequestStatus& aStatus) const;
   1.154 +	
   1.155 +	inline TInt Write(TInt aPos,const TDesC8& aDes);
   1.156 +	inline void Write(TInt aPos,const TDesC8& aDes,TRequestStatus& aStatus);
   1.157 +	inline TInt Write(TInt aPos,const TDesC8& aDes,TInt aLength);
   1.158 +	inline void Write(TInt aPos,const TDesC8& aDes,TInt aLength,TRequestStatus& aStatus);
   1.159 +	
   1.160 +private:
   1.161 +	TInt Seek(TSeek aMode, TInt& aPos) const;	// This API is not supported for RFile64
   1.162 +	TInt Size(TInt& aSize) const;			 	// This API is not supported for RFile64
   1.163 +	friend class RFilePlugin;
   1.164 +	};
   1.165 +
   1.166 +#ifndef  SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   1.167 +#include <f32file64.inl>
   1.168 +#endif
   1.169 +
   1.170 +#endif