1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/userlibandfileserver/fileserver/inc/f32file.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,3201 @@
1.4 +// Copyright (c) 1995-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 + @released
1.23 +*/
1.24 +
1.25 +#if !defined(__F32FILE_H__)
1.26 +#define __F32FILE_H__
1.27 +
1.28 +#if !defined(__E32BASE_H__)
1.29 +#include <e32base.h>
1.30 +#endif
1.31 +
1.32 +#ifndef SYMBIAN_ENABLE_PUBLIC_PLATFORM_HEADER_SPLIT
1.33 +// Old implementation including platform e32svr.h (which includes the several other platform headers)...
1.34 +#if !defined(__E32SVR_H__)
1.35 +#include <e32svr.h>
1.36 +#endif
1.37 +#include <e32ldr.h>
1.38 +#else
1.39 +// New implementation including only the public headers needed for f32file.h...
1.40 +#include <e32ldr.h>
1.41 +// And the public headers previously included via e32svr.h but otherwise not needed for f32file.h...
1.42 +#include <e32def.h>
1.43 +#include <e32event.h>
1.44 +#include <e32debug.h>
1.45 +#include <e32keys.h>
1.46 +#endif
1.47 +
1.48 +
1.49 +/**
1.50 +@publishedAll
1.51 +@released
1.52 +
1.53 +The session default drive.
1.54 +*/
1.55 +const TInt KDefaultDrive=KMaxTInt;
1.56 +
1.57 +
1.58 +
1.59 +
1.60 +/**
1.61 +@publishedAll
1.62 +@released
1.63 +
1.64 +Indicates a drive letter which is not in use.
1.65 +
1.66 +This is useful when scanning a drive list to find which drives are available.
1.67 +*/
1.68 +const TInt KDriveAbsent=0x00;
1.69 +
1.70 +
1.71 +
1.72 +
1.73 +/**
1.74 +@publishedAll
1.75 +@released
1.76 +
1.77 +The default value for the number of message slots passed to RFs::Connect().
1.78 +
1.79 +@see RFs::Connect
1.80 +*/
1.81 +const TInt KFileServerDefaultMessageSlots=-1;
1.82 +
1.83 +
1.84 +
1.85 +
1.86 +/**
1.87 +@publishedAll
1.88 +@released
1.89 +
1.90 +The size of the array of TEntry items contained in a TEntryArray object.
1.91 +
1.92 +@see TEntryArray
1.93 +@see TEntry
1.94 +*/
1.95 +const TInt KEntryArraySize=(0x200*sizeof(TText));
1.96 +
1.97 +
1.98 +
1.99 +
1.100 +/**
1.101 +@publishedAll
1.102 +@released
1.103 +
1.104 +The character used to separate directories in the path name.
1.105 +*/
1.106 +const TInt KPathDelimiter='\\';
1.107 +
1.108 +
1.109 +
1.110 +
1.111 +/**
1.112 +@publishedAll
1.113 +@released
1.114 +
1.115 +The character used to separate the drive letter from the path.
1.116 +*/
1.117 +const TInt KDriveDelimiter=':';
1.118 +
1.119 +
1.120 +
1.121 +
1.122 +/**
1.123 +@publishedAll
1.124 +@released
1.125 +
1.126 +The character used to separate the filename from the extension.
1.127 +*/
1.128 +const TInt KExtDelimiter='.';
1.129 +
1.130 +
1.131 +
1.132 +
1.133 +/**
1.134 +@publishedAll
1.135 +@released
1.136 +
1.137 +The maximum number of available drives.
1.138 +*/
1.139 +const TInt KMaxDrives=26;
1.140 +
1.141 +
1.142 +/**
1.143 +@publishedAll
1.144 +@released
1.145 +
1.146 +The maximum number of available proxy drives.
1.147 +*/
1.148 +const TInt KMaxProxyDrives=KMaxDrives-KMaxLocalDrives;
1.149 +
1.150 +
1.151 +/**
1.152 +@publishedAll
1.153 +@released
1.154 +
1.155 +Defines a modifiable buffer descriptor to contain a drive list.
1.156 +
1.157 +The descriptor has maximum length KMaxDrives, sufficient to contain
1.158 +all possible drive letters.
1.159 +
1.160 +@see RFs::DriveList
1.161 +@see KMaxDrives
1.162 +*/
1.163 +typedef TBuf8<KMaxDrives> TDriveList;
1.164 +
1.165 +
1.166 +
1.167 +/**
1.168 +@publishedAll
1.169 +@released
1.170 +
1.171 +The maximum length of a drivename.
1.172 +
1.173 +Sufficient for a drive letter and colon.
1.174 +*/
1.175 +const TInt KMaxDriveName=0x02;
1.176 +
1.177 +
1.178 +
1.179 +
1.180 +/**
1.181 +@publishedAll
1.182 +@released
1.183 +
1.184 +Defines a modifiable buffer descriptor to contain a drive name.
1.185 +
1.186 +A drive name comprises a drive letter (A through Z) and a colon.
1.187 +KMaxDriveName (2 bytes) is sufficient for a drive letter and colon.
1.188 +
1.189 +@see TDriveUnit::Name
1.190 +@see KMaxDriveName
1.191 +*/
1.192 +typedef TBuf<KMaxDriveName> TDriveName;
1.193 +
1.194 +
1.195 +
1.196 +
1.197 +/**
1.198 +@publishedAll
1.199 +@released
1.200 +
1.201 +The maximum length of a file system name or file system sub type name.
1.202 +32 characters is sufficient for a file system or sub type name.
1.203 +*/
1.204 +const TInt KMaxFSNameLength=0x0020;
1.205 +
1.206 +
1.207 +
1.208 +
1.209 +/**
1.210 +@publishedAll
1.211 +@released
1.212 +
1.213 +Defines a modifiable buffer descriptor to contain a file system or file system sub type name.
1.214 +
1.215 +@see KMaxFSNameLength
1.216 +*/
1.217 +typedef TBuf<KMaxFSNameLength> TFSName;
1.218 +
1.219 +
1.220 +
1.221 +
1.222 +/**
1.223 +@publishedAll
1.224 +@released
1.225 +
1.226 +File/directory attribute: any file without the hidden or system attribute.
1.227 +*/
1.228 +const TUint KEntryAttNormal=0x0000;
1.229 +
1.230 +
1.231 +
1.232 +
1.233 +/**
1.234 +@publishedAll
1.235 +@released
1.236 +
1.237 +File/directory attribute: read-only file or directory.
1.238 +*/
1.239 +const TUint KEntryAttReadOnly=0x0001;
1.240 +
1.241 +
1.242 +
1.243 +
1.244 +/**
1.245 +@publishedAll
1.246 +@released
1.247 +
1.248 +File/directory attribute: hidden file or directory.
1.249 +*/
1.250 +const TUint KEntryAttHidden=0x0002;
1.251 +
1.252 +
1.253 +
1.254 +
1.255 +/**
1.256 +@publishedAll
1.257 +@released
1.258 +
1.259 +File/directory attribute: system file.
1.260 +*/
1.261 +const TUint KEntryAttSystem=0x0004;
1.262 +
1.263 +
1.264 +
1.265 +
1.266 +/**
1.267 +@publishedAll
1.268 +@released
1.269 +
1.270 +File/directory attribute: volume name directory.
1.271 +*/
1.272 +const TUint KEntryAttVolume=0x0008;
1.273 +
1.274 +
1.275 +
1.276 +
1.277 +/**
1.278 +@publishedAll
1.279 +@released
1.280 +
1.281 +File/directory attribute: a directory without the hidden or system attribute.
1.282 +*/
1.283 +const TUint KEntryAttDir=0x0010;
1.284 +
1.285 +
1.286 +
1.287 +
1.288 +/**
1.289 +@publishedAll
1.290 +@released
1.291 +
1.292 +File/directory attribute: an archive file.
1.293 +*/
1.294 +const TUint KEntryAttArchive=0x0020;
1.295 +
1.296 +
1.297 +
1.298 +
1.299 +/**
1.300 +@publishedAll
1.301 +@released
1.302 +
1.303 +File/directory attribute: ROM eXecute In Place file
1.304 +*/
1.305 +const TUint KEntryAttXIP=0x0080;
1.306 +
1.307 +
1.308 +
1.309 +
1.310 +/**
1.311 +@publishedAll
1.312 +@released
1.313 +
1.314 +This file attribute bit is set if the file exists only on a remote file
1.315 +system and is not locally cached.
1.316 +
1.317 +Due to the potential high-latency of remote file systems, applications
1.318 +(or users of applications) may make use of this bit to modify their
1.319 +behaviour when working with remote files.
1.320 +
1.321 +This is a read-only attribute, so any attempt to set this attribute will
1.322 +will be ignored.
1.323 +*/
1.324 +const TUint KEntryAttRemote=0x0100;
1.325 +
1.326 +
1.327 +
1.328 +
1.329 +/**
1.330 +@publishedAll
1.331 +@released
1.332 +
1.333 +The range of entry attributes reserved for file-system specific meanings.
1.334 +File systems may assign meaning to these bits, but their definition will
1.335 +not be supported nor maintained by Symbian.
1.336 +
1.337 +All other file attribute bits are reserved for use by Symbian.
1.338 +
1.339 +The following table summarises the assignment of attribute bits:
1.340 +
1.341 + 0 - KEntryAttReadOnly
1.342 + 1 - KEntryAttHidden
1.343 + 2 - KEntryAttSystem
1.344 + 3 - KEntryAttVolume
1.345 +
1.346 + 4 - KEntryAttDir
1.347 + 6 - KEntryAttArchive
1.348 + 7 - KEntryAttXIP
1.349 +
1.350 + 8 - KEntryAttRemote
1.351 + 9 - Reserved
1.352 + 10 - Reserved
1.353 + 11 - Reserved
1.354 +
1.355 + 12 - Reserved
1.356 + 13 - Reserved
1.357 + 14 - Reserved
1.358 + 15 - Reserved
1.359 +
1.360 + 16 - File System Specific
1.361 + 17 - File System Specific
1.362 + 18 - File System Specific
1.363 + 19 - File System Specific
1.364 +
1.365 + 20 - File System Specific
1.366 + 22 - File System Specific
1.367 + 22 - File System Specific
1.368 + 23 - File System Specific
1.369 +
1.370 + 24 - KEntryAttPacked
1.371 + 25 - Reserved
1.372 + 26 - Reserved
1.373 + 27 - KEntryAttMatchExclude
1.374 +
1.375 + 28 - KEntryAttAllowUid
1.376 + 29 - Reserved
1.377 + 30 - KEntryAttMatchExclusive
1.378 + 31 - Reserved
1.379 +*/
1.380 +const TUint KEntryAttMaskFileSystemSpecific=0x00FF0000;
1.381 +
1.382 +
1.383 +
1.384 +
1.385 +/**
1.386 +@publishedAll
1.387 +@released
1.388 +
1.389 +Bit mask for matching file and directory entries.
1.390 +
1.391 +This mask ensures that directories and hidden and
1.392 +system files are matched.
1.393 +
1.394 +(Note that KEntryAttNormal matches all entry types except directories, hidden
1.395 +and system entries).
1.396 +
1.397 +@see RFs::GetDir
1.398 +*/
1.399 +const TUint KEntryAttMatchMask=(KEntryAttHidden|KEntryAttSystem|KEntryAttDir);
1.400 +
1.401 +
1.402 +
1.403 +
1.404 +
1.405 +/**
1.406 +@publishedAll
1.407 +@released
1.408 +
1.409 +Bit mask for matching file and directory entries.
1.410 +
1.411 +This is used when all entry types, including hidden and system files,
1.412 +but excluding the volume entry are to be matched.
1.413 +
1.414 +@see RFs::GetDir
1.415 +*/
1.416 +const TUint KEntryAttMaskSupported=0x3f;
1.417 +
1.418 +
1.419 +
1.420 +
1.421 +/**
1.422 +@publishedAll
1.423 +@released
1.424 +
1.425 +Bit mask for matching file and directory entries.
1.426 +
1.427 +This is used for exclusive matching. When OR'ed with one or more file attribute
1.428 +constants, for example, KEntryAttNormal, it ensures that only the files with
1.429 +those attributes are matched.
1.430 +When OR’ed with KEntryAttDir, directories only (not hidden or system) are matched.
1.431 +
1.432 +@see KEntryAttDir
1.433 +@see KEntryAttNormal
1.434 +@see RFs::GetDir
1.435 +*/
1.436 +const TUint KEntryAttMatchExclusive=0x40000000;
1.437 +
1.438 +
1.439 +
1.440 +
1.441 +/**
1.442 +@publishedAll
1.443 +@released
1.444 +
1.445 +Bit mask for feature manager file entries.
1.446 +
1.447 +It is used in order to identify each ROM feature set data file
1.448 +uniquely in the mount order of ROM sections.
1.449 +
1.450 +*/
1.451 +const TUint KEntryAttUnique=0x01000000;
1.452 +
1.453 +
1.454 +
1.455 +
1.456 +/**
1.457 +@publishedAll
1.458 +@released
1.459 +
1.460 +Bit mask for matching file and directory entries.
1.461 +
1.462 +It is used to exclude files or directories with certain attributes from
1.463 +directory listings. This bitmask has the opposite effect
1.464 +to KEntryAttMatchExclusive. For example:
1.465 +
1.466 +@code
1.467 +KEntryAttMatchExclude|KEntryAttReadOnly
1.468 +@endcode
1.469 +
1.470 +excludes all read only entries from the directory listing.
1.471 +
1.472 +@code
1.473 +KEntryAttMatchExclusive|KEntryAttReadOnly
1.474 +@endcode
1.475 +lists only read only entries.
1.476 +
1.477 +@see KEntryAttMatchExclusive
1.478 +@see RFs::GetDir
1.479 +*/
1.480 +const TUint KEntryAttMatchExclude=0x08000000;
1.481 +
1.482 +
1.483 +
1.484 +
1.485 +/**
1.486 +@publishedAll
1.487 +@released
1.488 +
1.489 +Bit mask for matching file and directory entries.
1.490 +
1.491 +Bit mask flag used when UID information should be included in the directory
1.492 +entry listing.
1.493 +
1.494 +@see RFs::GetDir
1.495 +*/
1.496 +const TUint KEntryAttAllowUid=0x10000000;
1.497 +
1.498 +
1.499 +
1.500 +
1.501 +/**
1.502 +@publishedAll
1.503 +@released
1.504 +
1.505 +Indicates that a TEntry (that is generally returned from a TEntryArray) is
1.506 +stored in packed format where the iSizeHigh and iReserved fields follow the
1.507 +valid characters of the name string. Before accessing the aforementioned
1.508 +members, the entry must be unpacked.
1.509 +
1.510 +*/
1.511 +const TUint KEntryAttPacked = 0x01000000;
1.512 +
1.513 +
1.514 +/**
1.515 +@publishedAll
1.516 +@released
1.517 +*/
1.518 +const TUint KMaxMapsPerCall = 0x8;
1.519 +
1.520 +
1.521 +
1.522 +
1.523 +enum TNotifyType
1.524 +/**
1.525 +@publishedAll
1.526 +@released
1.527 +
1.528 +A set of change notification flags.
1.529 +
1.530 +These flags indicate the kind of change that should result in notification.
1.531 +
1.532 +This is useful for programs that maintain displays of file lists that
1.533 +must be dynamically updated.
1.534 +
1.535 +@see RFs::NotifyChange
1.536 +@see RFs
1.537 +@see RFile
1.538 +@see RRawDisk
1.539 +*/
1.540 + {
1.541 + /**
1.542 + Any change, including mounting and unmounting drives.
1.543 + */
1.544 + ENotifyAll=0x01,
1.545 +
1.546 +
1.547 + /**
1.548 + Addition or deletion of a directory entry, or changing or formatting a disk.
1.549 + */
1.550 + ENotifyEntry=0x02,
1.551 +
1.552 +
1.553 + /**
1.554 + Change resulting from file requests:
1.555 + RFile::Create(), RFile::Replace(), RFile::Rename(), RFs::Delete(),
1.556 + RFs::Replace(), and RFs::Rename().
1.557 + */
1.558 + ENotifyFile=0x04,
1.559 +
1.560 +
1.561 + /**
1.562 + Change resulting from directory requests:
1.563 + RFs::MkDir(), RFs::RmDir(), and RFs::Rename().
1.564 + */
1.565 + ENotifyDir=0x08,
1.566 +
1.567 +
1.568 + /**
1.569 + Change resulting from: RFs::SetEntry(), RFile::Set(), RFile::SetAtt(),
1.570 + RFile::SetModified() and RFile::SetSize() requests.
1.571 + */
1.572 + ENotifyAttributes=0x10,
1.573 +
1.574 +
1.575 + /**
1.576 + Change resulting from the RFile::Write() request.
1.577 + */
1.578 + ENotifyWrite=0x20,
1.579 +
1.580 +
1.581 + /**
1.582 + Change resulting from the RRawDisk::Write() request.
1.583 + */
1.584 + ENotifyDisk=0x40
1.585 + };
1.586 +
1.587 +/**
1.588 + @publishedAll
1.589 + @released
1.590 +
1.591 + Notification modes for safe media removal notification API
1.592 +
1.593 + @see RFs::NotifyDismount
1.594 +*/
1.595 +enum TNotifyDismountMode
1.596 + {
1.597 + /** Used by a client to register for notification of pending dismount. This is the default behaviour for RFs::NotifyDismount*/
1.598 + EFsDismountRegisterClient=0x01,
1.599 +
1.600 + /**
1.601 + Used for graceful file system dismounting with notifying clients of a pending dismount.
1.602 + If all clients have responded by RFs::AllowDismount(), the file system will be dismounted.
1.603 + */
1.604 + EFsDismountNotifyClients=0x02,
1.605 +
1.606 + /** Used to forcibly dismount the file system without notifying clients. */
1.607 + EFsDismountForceDismount=0x03,
1.608 + };
1.609 +
1.610 +
1.611 +enum TFileCacheFlags
1.612 +/**
1.613 +@publishedAll
1.614 +@released
1.615 +
1.616 +Flags used to enable file server drive-specific caching
1.617 +*/
1.618 + {
1.619 + /**
1.620 + Enable read caching - if file explicitly opened in EFileReadBuffered mode
1.621 + */
1.622 + EFileCacheReadEnabled = 0x01,
1.623 +
1.624 + /**
1.625 + Enable read caching for all files, regardless of file open mode
1.626 + */
1.627 + EFileCacheReadOn = 0x02,
1.628 +
1.629 + /**
1.630 + Enable read-ahead caching - if file explicitly opened in EFileReadAheadOn mode
1.631 + */
1.632 + EFileCacheReadAheadEnabled = 0x04,
1.633 +
1.634 + /**
1.635 + Enable read-ahead caching, regardless of file open mode
1.636 + */
1.637 + EFileCacheReadAheadOn = 0x08,
1.638 +
1.639 + /**
1.640 + Enable write caching, if file explicitly opened in EFileWriteBuffered mode
1.641 + */
1.642 + EFileCacheWriteEnabled = 0x10,
1.643 +
1.644 + /**
1.645 + Enable write caching for all files, regardless of file open mode
1.646 + */
1.647 + EFileCacheWriteOn = 0x20,
1.648 + };
1.649 +
1.650 +/**
1.651 +@publishedAll
1.652 +@released
1.653 +
1.654 +Commands to query specific volume information.
1.655 +
1.656 +@see TVolumeIOParamInfo
1.657 +*/
1.658 +enum TQueryVolumeInfoExtCmd
1.659 + {
1.660 + /**
1.661 + Queries the sub type of the file system mounted on a specified volume.
1.662 + For example, FAT12, FAT16 or FAT32.
1.663 + */
1.664 + EFileSystemSubType,
1.665 +
1.666 + /**
1.667 + Queries the I/O parameters of a specificed volume.
1.668 + This includes the block size, the cluster size and the recommended read and write sizes for the media.
1.669 + */
1.670 + EIOParamInfo,
1.671 +
1.672 + /**
1.673 + This command determines whether the volume is synchronous or asynchronous.
1.674 + A boolean value is returned within the buffer defined as TPckgBuf<TBool>.
1.675 + ETrue for Synchronous and EFalse for Asynchronous.
1.676 + */
1.677 + EIsDriveSync,
1.678 +
1.679 + /**
1.680 + Query if the given drive is finalised. See RFs::FinaliseDrive()
1.681 + Not all file systems may support this query.
1.682 + A boolean value is returned within the buffer defined as TPckgBuf<TBool>.
1.683 + ETrue value means that the drive is finalised
1.684 + */
1.685 + EIsDriveFinalised,
1.686 + };
1.687 +
1.688 +/**
1.689 +@publishedAll
1.690 +@released
1.691 +
1.692 +Volume IO parameter information.
1.693 +
1.694 +This class is used to return IO parameter information for a specified volume.
1.695 +
1.696 +The volume parameter information holds recommended buffer sizes for the creation of efficient buffers for
1.697 +reading and writing.
1.698 +
1.699 +@see RFs::VolumeIOParam()
1.700 +*/
1.701 +class TVolumeIOParamInfo
1.702 + {
1.703 +public:
1.704 + /**
1.705 + The size of a block in bytes.
1.706 +
1.707 + Reads and writes that are aligned on block boundaries are up to twice as fast as when
1.708 + mis-aligned.
1.709 +
1.710 + Read and write operations on certain underlying media is done in blocks.
1.711 + A write operation that modifies only part of a block is less efficient, in general, than
1.712 + one that modifies an entire block. Data throughput degrades linearly for reads and writes in smaller
1.713 + sized units.
1.714 + */
1.715 + TInt iBlockSize;
1.716 + /**
1.717 + The size in bytes of a single disk cluster.
1.718 +
1.719 + Read and write operations that are aligned on cluster boundaries are more efficient.
1.720 +
1.721 + The file system organises and allocates the file data on the disk in clusters where each cluster is
1.722 + one or more blocks. Files that are not zero length occupy at least one cluster of the disk,
1.723 + so large numbers of very small files use up more disk space than expected.
1.724 + */
1.725 + TInt iClusterSize;
1.726 + /**
1.727 + The recommended buffer size for optimised reading performance.
1.728 +
1.729 + The given buffer size is based on sensible benchmark testing results produced by the mobile device vendor.
1.730 + The buffer size is then added to the estart.txt file
1.731 +
1.732 + The figure is included in the estart.txt file along with the drive number and the variable name.
1.733 + The example below shows the required format:
1.734 +
1.735 + [DriveC]
1.736 + RecReadBufSize 8192
1.737 +
1.738 + When no value is provided, value KErrNotSupported is returned.
1.739 + */
1.740 + TInt iRecReadBufSize;
1.741 + /**
1.742 + The recommended buffer size for optimised writing performance.
1.743 +
1.744 + The given buffer size is based on sensible benchmark testing results produced by the mobile device vendor.
1.745 + The buffer size is then added to the estart.txt file
1.746 +
1.747 + The figure is included in the estart.txt file along with the drive number and the variable name.
1.748 + The example below shows the required format:
1.749 +
1.750 + [DriveC]
1.751 + RecWriteBufSize 16384
1.752 +
1.753 + When no value is provided, value KErrNotSupported is returned.
1.754 + */
1.755 + TInt iRecWriteBufSize;
1.756 +
1.757 +
1.758 + /**
1.759 + The maximum file size that is supported by the file system mounted on this volume.
1.760 + Not all file system may provide this parameter; The value KMaxTUint64 (0xffffffffffffffff) means that this particular file system hasn't
1.761 + provided this information.
1.762 + */
1.763 + TUint64 iMaxSupportedFileSize;
1.764 +
1.765 +private:
1.766 + /*
1.767 + Reserved space for future use
1.768 + */
1.769 + TInt iReserved[2];
1.770 + };
1.771 +
1.772 +enum TDriveNumber
1.773 +/**
1.774 +@publishedAll
1.775 +@released
1.776 +
1.777 +The drive number enumeration.
1.778 +*/
1.779 + {
1.780 + EDriveA, EDriveB, EDriveC, EDriveD, EDriveE,
1.781 + EDriveF, EDriveG, EDriveH, EDriveI, EDriveJ,
1.782 + EDriveK, EDriveL, EDriveM, EDriveN, EDriveO,
1.783 + EDriveP, EDriveQ, EDriveR, EDriveS, EDriveT,
1.784 + EDriveU, EDriveV, EDriveW, EDriveX, EDriveY,
1.785 + EDriveZ
1.786 + };
1.787 +
1.788 +
1.789 +
1.790 +
1.791 +enum TEntryKey
1.792 +/**
1.793 +@publishedAll
1.794 +@released
1.795 +
1.796 +Flags indicating the order in which directory entries are to be sorted.
1.797 +
1.798 +@see RFs::GetDir
1.799 +@see CDirScan::SetScanDataL
1.800 +@see CDir::Sort
1.801 +*/
1.802 + {
1.803 + /**
1.804 + The default; no sorting takes place
1.805 + */
1.806 + ESortNone=0,
1.807 +
1.808 +
1.809 + /**
1.810 + Sort according to alphabetic order of file and directory name.
1.811 +
1.812 + This setting is mutually exclusive with ESortByExt, ESortBySize,
1.813 + ESortByDate and ESortByUid.
1.814 + */
1.815 + ESortByName,
1.816 +
1.817 +
1.818 + /**
1.819 + Sort according to alphabetic order of file extension.
1.820 +
1.821 + Files without an extension take precedence over files with an extension.
1.822 + For files with the same extension or without an extension, the default is
1.823 + to sort by name.
1.824 +
1.825 + This setting is mutually exclusive with ESortByName, ESortBySize,
1.826 + ESortByDate and ESortByUid.
1.827 + */
1.828 + ESortByExt,
1.829 +
1.830 +
1.831 + /**
1.832 + Sort according to file size.
1.833 +
1.834 + This setting is mutually exclusive with ESortByName, ESortByExt,
1.835 + ESortByDate and ESortByUid.
1.836 + */
1.837 + ESortBySize,
1.838 +
1.839 +
1.840 + /**
1.841 + Sort according to files' last modified time and date.
1.842 +
1.843 + By default, most recent last.
1.844 +
1.845 + This setting is mutually exclusive with ESortByName, ESortByExt,
1.846 + ESortBySize and ESortByUid.
1.847 + */
1.848 + ESortByDate,
1.849 +
1.850 +
1.851 + /**
1.852 + Sort according to file UID.
1.853 +
1.854 + This setting is mutually exclusive with ESortByName, ESortByExt,
1.855 + ESortBySize and ESortByDate.
1.856 + */
1.857 + ESortByUid,
1.858 +
1.859 +
1.860 + /**
1.861 + Qualifies the sort order; if set, directories are listed in the order in
1.862 + which they occur.
1.863 +
1.864 + This is the default.
1.865 +
1.866 + This flag is mutually exclusive with EDirsFirst and EDirslast.
1.867 + */
1.868 + EDirsAnyOrder=0,
1.869 +
1.870 +
1.871 + /**
1.872 + Qualifies the sort order; if set, directories come before files in sort order.
1.873 +
1.874 + This flag is mutually exclusive with EDirsAnyOrder and EDirsLast.
1.875 + */
1.876 + EDirsFirst=0x100,
1.877 +
1.878 +
1.879 + /**
1.880 + Qualifies the sort order; if set, files come before directories in sort order.
1.881 +
1.882 + This flag is mutually exclusive with EDirsAnyOrder and EDirsFirst.
1.883 + */
1.884 + EDirsLast=0x200,
1.885 +
1.886 +
1.887 + /**
1.888 + Qualifies the sort order; files are sorted in ascending order, i.e. from A to Z.
1.889 + This is the default behaviour.
1.890 +
1.891 + This flag is mutually exclusive with EDescending and EDirDescending.
1.892 + */
1.893 + EAscending=0,
1.894 +
1.895 +
1.896 + /**
1.897 + Qualifies the sort order; files are sorted in descending order, i.e. from Z to A.
1.898 +
1.899 + This flag is mutually exclusive with EAscending and EDirDescending.
1.900 + */
1.901 + EDescending=0x400,
1.902 +
1.903 +
1.904 + /**
1.905 + Qualifies the sort order; directories are sorted in descending order, i.e. from Z to A.
1.906 +
1.907 + This flag shall be used in combination with either EDirsFirst or EDirsLast.
1.908 + This flag is mutually exclusive with EAscending and EDescending.
1.909 + */
1.910 + EDirDescending=0x800
1.911 + };
1.912 +
1.913 +
1.914 +
1.915 +
1.916 +enum TFileMode
1.917 +/**
1.918 +@publishedAll
1.919 +@released
1.920 +
1.921 +Access and share modes available when opening a file.
1.922 +
1.923 +The access mode indicates whether the file is opened just for reading or
1.924 +for writing.
1.925 +
1.926 +The share mode indicates whether other RFile objects can access the
1.927 +open file, and whether this access is read only.
1.928 +
1.929 +Use EFileShareReadersOrWriters if a client does not care whether the file has
1.930 +been previously opened for ReadOnly or Read/Write access.
1.931 +
1.932 +If EFileShareReadersOrWriters is not used, then a client needs to cooperate with
1.933 +other clients in order to open the file with the correct share mode, either
1.934 +EFileShareReadersOnly or EFileShareAny, depending on the share mode used when
1.935 +the file was originally opened.
1.936 +
1.937 +To open a file for reading and writing with read and write shared access,
1.938 +use:
1.939 +
1.940 +@code
1.941 +_LIT(KFilename, "filename.ext");
1.942 +RFile file;
1.943 +file.Open(theFs, KFilename, EFileShareAny|EFileWrite);
1.944 +@endcode
1.945 +
1.946 +If another instance of RFile tries to open this file in EFileShareExclusive
1.947 +or EFileShareReadersOnly mode, access is denied. However, it can be opened
1.948 +in EFileShareAny mode or EFileShareReadersOrWriters mode.
1.949 +
1.950 +If a file is opened with EFileShareReadersOrWriters, and the file is opened for
1.951 +sharing by another client, then the file share mode is promoted to the new share
1.952 +mode. When the file handle is closed then the share mode is demoted back to
1.953 +EFileShareReadersOrWriters.
1.954 +
1.955 +@code
1.956 +
1.957 +Table of FileShare promotion rules
1.958 +----------------------------------
1.959 +
1.960 +Client A Client B Resultant Share Mode
1.961 +-------- -------- --------------------
1.962 +ReadersOnly ReadersOnly ReadersOnly
1.963 +ReadersOnly ReadersOrWriters|EFileRead ReadersOnly
1.964 +ReadersOnly ReadersOrWriters|EFileWrite INCOMPATIBLE
1.965 +ReadersOnly Any INCOMPATIBLE
1.966 +
1.967 +ReadersOrWriters|EFileRead ReadersOnly ReadersOnly
1.968 +ReadersOrWriters|EFileRead ReadersOrWriters|EFileRead ReadersOrWriters
1.969 +ReadersOrWriters|EFileRead ReadersOrWriters|EFileWrite ReadersOrWriters
1.970 +ReadersOrWriters|EFileRead Any Any
1.971 +
1.972 +ReadersOrWriters|EFileWrite ReadersOnly INCOMPATIBLE
1.973 +ReadersOrWriters|EFileWrite ReadersOrWriters|EFileRead ReadersOrWriters
1.974 +ReadersOrWriters|EFileWrite ReadersOrWriters|EFileWrite ReadersOrWriters
1.975 +ReadersOrWriters|EFileWrite Any Any
1.976 +
1.977 +Any ReadersOnly INCOMPATIBLE
1.978 +Any ReadersOrWriters|EFileRead Any
1.979 +Any ReadersOrWriters|EFileWrite Any
1.980 +Any Any Any
1.981 +@endcode
1.982 +
1.983 +Use the following guidance notes for selecting FileShare mode with shared RFile objects:
1.984 +
1.985 +EFileShareAny
1.986 +- Use this mode to request both read and write access when another client needs
1.987 +to write to the file and respective client access to the file is coordinated.
1.988 +- To open a file for non-exclusive write, use EFileShareAny | EFileWrite.
1.989 +- It is recommended that either EFileShareAny or EFileShareAny | EFileRead are
1.990 +not used. These combinations will block users attempting to use the
1.991 +EFileShareReadersOnly mode even if all the EFileShareAny handles do not have
1.992 +the EFileWrite bit set as the EFileRead and EFileWrite bits have no affect on
1.993 +sharing. Use either EFileShareReadersOnly or EFileShareReadersOrWriters.
1.994 +
1.995 +EFileShareReadersOrWriters
1.996 +- Use this mode when it does not matter if another file writes to the file and
1.997 +file access can not be coordinated as other clients are unknown.
1.998 +- To open a file for shared read access whilst permitting writers, use
1.999 +EFileShareReadersOrWriters | EFileRead.
1.1000 +
1.1001 +- For write access with unrestricted share mode,
1.1002 +EFileShareReadersOrWriters | EFileWrite may be used however
1.1003 +EFilesShareAny | EFileWrite is preferred.
1.1004 +
1.1005 +EFileShareReadersOnly
1.1006 +- Use this mode to get read access to the file and deny write access for any
1.1007 +other handles on this file.
1.1008 +- To open a file for shared read access whilst disallowing writers use
1.1009 +EFileShareReadersOnly.
1.1010 +
1.1011 +
1.1012 +Files may be opened in text or binary mode. Native Symbian OS application
1.1013 +files are nearly all binary, (so they will usually be opened in binary mode).
1.1014 +However, they can be opened in text mode (to support testing, and to make them
1.1015 +compatible with text formats on remote systems).
1.1016 +Symbian OS native text format uses CR-LF (ASCII 0x0d, 0x0a) to denote the end of
1.1017 +a line. When reading, however, any combination of CR, LF, LF-CR or CR-LF is
1.1018 +recognised as the end of a line. Where a remote file system uses a different
1.1019 +format, it is the responsibility of the installable file system to present
1.1020 +an interface for text files which conforms with this format.
1.1021 +
1.1022 +The share mode may be OR’ed with either EFileStream or EFileStreamText.
1.1023 +
1.1024 +Additionally, it may be OR’ed with either EFileRead or EFileWrite.
1.1025 +*/
1.1026 + {
1.1027 + /**
1.1028 + Exclusive access for the program opening the file.
1.1029 +
1.1030 + No other program can access the file until it is closed.
1.1031 + If another program is already accessing the file in any share mode, then
1.1032 + an attempt to open it with an EFileShareExclusive will fail.
1.1033 + */
1.1034 + EFileShareExclusive,
1.1035 +
1.1036 +
1.1037 + /**
1.1038 + Read-only sharing.
1.1039 +
1.1040 + This means that the file may only be accessed for reading.
1.1041 + A file cannot be opened using a share mode of EFileShareReadersOnly with
1.1042 + an EFileWrite flag.
1.1043 + */
1.1044 + EFileShareReadersOnly,
1.1045 +
1.1046 +
1.1047 + /**
1.1048 + Shared access for reading and writing.
1.1049 +
1.1050 + This means that other programs may share access to the file for reading
1.1051 + and writing with the program which opened the file.
1.1052 +
1.1053 + When using this mode, the program is expecting another program to be able
1.1054 + to write to the file, so is not compatible with EFileShareReadersOnly.
1.1055 + */
1.1056 + EFileShareAny,
1.1057 +
1.1058 +
1.1059 + /**
1.1060 + Shared access for reading and writing.
1.1061 +
1.1062 + This means that other programs may share access to the file for reading
1.1063 + and writing with the program which opened the file.
1.1064 +
1.1065 + When using this mode, the program does not care if another program has
1.1066 + the file open for read or write access.
1.1067 + */
1.1068 + EFileShareReadersOrWriters,
1.1069 +
1.1070 +
1.1071 + /**
1.1072 + For files to be opened in binary mode.
1.1073 + */
1.1074 + EFileStream=0,
1.1075 +
1.1076 +
1.1077 + /**
1.1078 + For files to be opened in text mode.
1.1079 + */
1.1080 + EFileStreamText=0x100,
1.1081 +
1.1082 +
1.1083 + /**
1.1084 + The file may be read from but not written to.
1.1085 + */
1.1086 + EFileRead=0,
1.1087 +
1.1088 +
1.1089 + /**
1.1090 + The file may be read from and written to
1.1091 +
1.1092 + Cannot be combined with a share mode of EFileShareReadersOnly.
1.1093 + */
1.1094 + EFileWrite=0x200,
1.1095 +
1.1096 + /**
1.1097 + Specifies that an asynchronous read request should not be completed
1.1098 + until all requested data becomes available.
1.1099 +
1.1100 + Cannot be combined with the EFileShareExclusive or EFileShareReadersOnly
1.1101 + share modes as this will prohibit a writer from updating the file.
1.1102 + */
1.1103 + EFileReadAsyncAll=0x400,
1.1104 +
1.1105 + /**
1.1106 + Enables write buffering
1.1107 + */
1.1108 + EFileWriteBuffered =0x00000800,
1.1109 +
1.1110 + /**
1.1111 + Disables write buffering
1.1112 + */
1.1113 + EFileWriteDirectIO =0x00001000,
1.1114 +
1.1115 + /**
1.1116 + Enables read buffering
1.1117 + */
1.1118 + EFileReadBuffered =0x00002000,
1.1119 +
1.1120 + /**
1.1121 + Disables read buffering
1.1122 + */
1.1123 + EFileReadDirectIO =0x00004000,
1.1124 +
1.1125 + /**
1.1126 + Enables read ahead.
1.1127 + */
1.1128 + EFileReadAheadOn =0x00008000,
1.1129 +
1.1130 + /**
1.1131 + Disables read ahead.
1.1132 + */
1.1133 + EFileReadAheadOff =0x00010000,
1.1134 +
1.1135 + /**
1.1136 + Enable delete on close
1.1137 + */
1.1138 + EDeleteOnClose =0x00020000,
1.1139 +
1.1140 + /**
1.1141 + Enables operations on large files.
1.1142 +
1.1143 + @internalTechnology
1.1144 +
1.1145 + */
1.1146 + EFileBigFile =0x00040000
1.1147 +
1.1148 + };
1.1149 +
1.1150 +
1.1151 +
1.1152 +
1.1153 +/**
1.1154 +@publishedAll
1.1155 +@released
1.1156 +
1.1157 +Bit mask provided for retrieving a file's share mode.
1.1158 +
1.1159 +@see TFileMode
1.1160 +*/
1.1161 +const TUint KFileShareMask=0xff;
1.1162 +
1.1163 +
1.1164 +
1.1165 +
1.1166 +enum TFormatMode
1.1167 +/**
1.1168 +@publishedAll
1.1169 +@released
1.1170 +
1.1171 +The format method.
1.1172 +*/
1.1173 + {
1.1174 + /**
1.1175 + Indicates a high density floppy disk to be formatted.
1.1176 +
1.1177 + Obsolete.
1.1178 +
1.1179 + Can be ORed with EFullFormat or EQuickFormat, but does not
1.1180 + have any effect.
1.1181 + */
1.1182 + EHighDensity,
1.1183 +
1.1184 +
1.1185 + /**
1.1186 + Indicates a low density floppy disk to be formatted.
1.1187 +
1.1188 + Obsolete.
1.1189 +
1.1190 + Can be ORed with EFullFormat or EQuickFormat, but does not
1.1191 + have any effect.
1.1192 + */
1.1193 + ELowDensity,
1.1194 +
1.1195 +
1.1196 + /**
1.1197 + Performs a full format, erasing whole media content and creating
1.1198 + new file system layout.
1.1199 +
1.1200 + This is the default mode.
1.1201 + */
1.1202 + EFullFormat=0,
1.1203 +
1.1204 +
1.1205 + /**
1.1206 + Performs a quick media format, erasing only required minimum media content.
1.1207 + For example, for FAT file system it resets FAT and root directory content.
1.1208 + Also preserves bad sectors if there are some on the volume.
1.1209 + */
1.1210 + EQuickFormat=0x100,
1.1211 +
1.1212 +
1.1213 + /**
1.1214 + Indicates a custom formatting mode. In this mode some optional file system
1.1215 + specific parameters may be passed to RFormat::Open().
1.1216 +
1.1217 + @see TLDFormatInfo
1.1218 + @see TInt RFormat::Open(RFs &aFs, const TDesC &aName, TUint aFormatMode, TInt &aCount, const TDesC8 &anInfo);
1.1219 + */
1.1220 + ESpecialFormat=0x200,
1.1221 +
1.1222 + /**
1.1223 + Forced erase of locked media
1.1224 + */
1.1225 + EForceErase=0x400,
1.1226 +
1.1227 + /**
1.1228 + This flag enables formatting the volume even if it has files or directories opened on it.
1.1229 + If this flag is specified, the volume will be forcedly dismounted before performing media formatting.
1.1230 +
1.1231 + Even with this flag the RFormat::Open() can fail with KErrInUse in following cases:
1.1232 + 1. if there are clamped files on the volume.
1.1233 + 2. there are opened "disk access" objects, like RFormat or RRawDisk on the volume.
1.1234 + */
1.1235 + EForceFormat = 0x800,
1.1236 +
1.1237 + };
1.1238 +
1.1239 +
1.1240 +
1.1241 +
1.1242 +enum TSeek
1.1243 +/**
1.1244 +@publishedAll
1.1245 +@released
1.1246 +
1.1247 +Flags indicating the destination of a seek operation.
1.1248 +
1.1249 +File locations are specified as a 32-bit signed integer,
1.1250 +allowing offsets of ?GB from the origin of the seek.
1.1251 +
1.1252 +@see RFile::Seek
1.1253 +*/
1.1254 + {
1.1255 + /**
1.1256 + This can only be used for file systems with execute-in-place facilities,
1.1257 + such as the ROM file system: the offset specifies the absolute address of
1.1258 + the data.
1.1259 + */
1.1260 + ESeekAddress,
1.1261 +
1.1262 +
1.1263 + /**
1.1264 + Destination is the start of file.
1.1265 + */
1.1266 + ESeekStart,
1.1267 +
1.1268 +
1.1269 + /**
1.1270 + Destination is the current position in file.
1.1271 + */
1.1272 + ESeekCurrent,
1.1273 +
1.1274 +
1.1275 + /**
1.1276 + Destination is the end of file.
1.1277 + */
1.1278 + ESeekEnd
1.1279 + };
1.1280 +
1.1281 +/**
1.1282 +@publishedAll
1.1283 +@released
1.1284 +
1.1285 +*/
1.1286 +class TBlockMapEntry : public TBlockMapEntryBase
1.1287 + {
1.1288 +public:
1.1289 + IMPORT_C TBlockMapEntry();
1.1290 + IMPORT_C void SetNumberOfBlocks( TUint aNumberOfBlocks );
1.1291 + IMPORT_C void SetStartBlock( TUint aStartBlock );
1.1292 + };
1.1293 +
1.1294 +/**
1.1295 +@publishedAll
1.1296 +@released
1.1297 +
1.1298 +*/
1.1299 +typedef TBuf8<KMaxMapsPerCall*sizeof(TBlockMapEntry)> TBlockArrayDes;
1.1300 +
1.1301 +struct SBlockMapInfo : public SBlockMapInfoBase
1.1302 + {
1.1303 + TBlockArrayDes iMap;
1.1304 + };
1.1305 +
1.1306 +/**
1.1307 +@publishedAll
1.1308 +@released
1.1309 +*/
1.1310 +enum TBlockMapUsage
1.1311 + {
1.1312 + /* */
1.1313 + EBlockMapUsagePaging,
1.1314 + /* */
1.1315 + ETestDebug
1.1316 + };
1.1317 +
1.1318 +class TEntry
1.1319 +/**
1.1320 +@publishedAll
1.1321 +@released
1.1322 +
1.1323 +Encapsulates an entry in a directory, which can be another (nested) directory,
1.1324 +a file or a volume label.
1.1325 +
1.1326 +Each directory entry has a name which is relative to its owning directory
1.1327 +and a type, which is indicated by its unique identifier (UID).
1.1328 +
1.1329 +An entry can be interrogated for the following properties:
1.1330 +
1.1331 +1. the kind of entry: stored in the entry UIDs, stored in iType
1.1332 +
1.1333 +2. the entry attributes, stored in iAtt
1.1334 +
1.1335 +3. the size of entry
1.1336 +
1.1337 +4. the time the entry was last modified.
1.1338 +
1.1339 +@see RDir
1.1340 +@see RFs::Entry
1.1341 +@see RFs::SetEntry
1.1342 +@see CfileBase::CurrentEntry
1.1343 +*/
1.1344 + {
1.1345 +public:
1.1346 + IMPORT_C TEntry();
1.1347 + IMPORT_C TEntry(const TEntry& aEntry);
1.1348 + IMPORT_C TEntry& operator=(const TEntry& aEntry);
1.1349 + IMPORT_C TBool IsReadOnly() const;
1.1350 + IMPORT_C TBool IsHidden() const;
1.1351 + IMPORT_C TBool IsSystem() const;
1.1352 + IMPORT_C TBool IsDir() const;
1.1353 + IMPORT_C TBool IsArchive() const;
1.1354 + inline const TUid& operator[](TInt anIndex) const;
1.1355 + inline TBool IsUidPresent(TUid aUid) const;
1.1356 + inline TBool IsTypeValid() const;
1.1357 + inline TUid MostDerivedUid() const;
1.1358 + IMPORT_C TInt64 FileSize() const;
1.1359 + inline void SetFileSize(TInt64 aFileSize);
1.1360 +
1.1361 +private:
1.1362 + inline void Copy(const TEntry& aEntry);
1.1363 + inline void Unpack();
1.1364 +
1.1365 +public:
1.1366 + /**
1.1367 + The individual bits within this byte indicate which attributes
1.1368 + have been set.
1.1369 +
1.1370 + @see KEntryAttNormal
1.1371 + @see KEntryAttReadOnly
1.1372 + @see KEntryAttHidden
1.1373 + @see KEntryAttSystem
1.1374 + */
1.1375 + TUint iAtt;
1.1376 +
1.1377 +
1.1378 + /**
1.1379 + The size of the file in bytes.
1.1380 + For files larger that 2G it must be cast to TUint in order to avoid looking like negative signed.
1.1381 + */
1.1382 + TInt iSize;
1.1383 +
1.1384 +
1.1385 + /**
1.1386 + The local time of last modification.
1.1387 + */
1.1388 + TTime iModified;
1.1389 +
1.1390 +
1.1391 + /**
1.1392 + The file's UIDtype
1.1393 + */
1.1394 + TUidType iType;
1.1395 +
1.1396 +
1.1397 + /**
1.1398 + The name of the file relative to the owning directory,
1.1399 + with a maximum of KMaxFileName characters.
1.1400 +
1.1401 + @see KMaxFileName
1.1402 + */
1.1403 + TBufC<KMaxFileName> iName;
1.1404 +
1.1405 +private:
1.1406 + TUint32 iSizeHigh;
1.1407 + /**
1.1408 + Reserved for future expansion
1.1409 + */
1.1410 + TUint32 iReserved;
1.1411 + };
1.1412 +
1.1413 +
1.1414 +
1.1415 +
1.1416 +class RDir;
1.1417 +class TEntryArray
1.1418 +/**
1.1419 +@publishedAll
1.1420 +@released
1.1421 +
1.1422 +Array of directory entries.
1.1423 +
1.1424 +It contains the results of a call to RDir::Read(): it will contain all
1.1425 +the TEntry items in the directory. Thus, a directory can be read in
1.1426 +a single call, minimising client/server communication overheads.
1.1427 +
1.1428 +@see TEntry
1.1429 +@see RDir::Read
1.1430 +*/
1.1431 + {
1.1432 +public:
1.1433 + IMPORT_C TEntryArray();
1.1434 + IMPORT_C TInt Count() const;
1.1435 + IMPORT_C const TEntry& operator[](TInt anIndex) const;
1.1436 +private:
1.1437 + TInt iCount;
1.1438 + TInt iIndex;
1.1439 + const TEntry* iPos;
1.1440 + TBuf8<KEntryArraySize> iBuf;
1.1441 + friend class RDir;
1.1442 + friend class RFs;
1.1443 + friend class TRawEntryArray;
1.1444 + };
1.1445 +
1.1446 +
1.1447 +
1.1448 +
1.1449 +class TDriveInfo
1.1450 +/**
1.1451 +@publishedAll
1.1452 +@released
1.1453 +
1.1454 +Contains drive information.
1.1455 +
1.1456 +@see RFs::Drive
1.1457 +*/
1.1458 + {
1.1459 +public:
1.1460 + /**
1.1461 + The type of media mounted on the drive.
1.1462 + */
1.1463 + TMediaType iType;
1.1464 +
1.1465 +
1.1466 + /**
1.1467 + Indicates whether the drive supports a battery, and if so, its state.
1.1468 + */
1.1469 + TBatteryState iBattery;
1.1470 +
1.1471 +
1.1472 + /**
1.1473 + The drive attributes.
1.1474 +
1.1475 + @see KDriveAttLocal
1.1476 + @see KDriveAttRom
1.1477 + @see KDriveAttRedirected
1.1478 + @see KDriveAttSubsted
1.1479 + @see KDriveAttInternal
1.1480 + @see KDriveAttRemovable
1.1481 + @see KDriveAttExternal
1.1482 + */
1.1483 + TUint iDriveAtt;
1.1484 +
1.1485 +
1.1486 + /**
1.1487 + The attributes of the media mounted on the drive.
1.1488 +
1.1489 + @see KMediaAttVariableSize
1.1490 + @see KMediaAttDualDensity
1.1491 + @see KMediaAttFormattable
1.1492 + @see KMediaAttWriteProtected
1.1493 + @see KMediaAttLockable
1.1494 + @see KMediaAttLocked
1.1495 + */
1.1496 + TUint iMediaAtt;
1.1497 +
1.1498 +
1.1499 + /**
1.1500 + The type of interface used to connect to the media.
1.1501 + */
1.1502 + TConnectionBusType iConnectionBusType;
1.1503 + };
1.1504 +
1.1505 +
1.1506 +
1.1507 +
1.1508 +class TVolumeInfo
1.1509 +/**
1.1510 +@publishedAll
1.1511 +@released
1.1512 +
1.1513 +Contains information about a volume mounted on a drive. Use RFs::Drive() if only
1.1514 +the drive information is required.
1.1515 +
1.1516 +If a drive supports removable media it may contain different volumes over time.
1.1517 +
1.1518 +Volume information is made up of information concerning the drive on which it is mounted,
1.1519 +which can also be accessed through RFs::Drive(), and the volume information, this is made
1.1520 +up of the size of the volume, the free space, its unique identifying number and a name.
1.1521 +
1.1522 +TVolumeInfo is initialised by RFs::Volume().
1.1523 +
1.1524 +@see RFs::Volume()
1.1525 +@see RFs::Drive()
1.1526 +*/
1.1527 + {
1.1528 +public:
1.1529 + IMPORT_C TVolumeInfo();
1.1530 +
1.1531 + /**
1.1532 + Information about the drive on which the volume is mounted.
1.1533 +
1.1534 + @see TDriveInfo
1.1535 + */
1.1536 + TDriveInfo iDrive;
1.1537 +
1.1538 +
1.1539 + /**
1.1540 + The volume’s unique identifying number.
1.1541 + */
1.1542 + TUint iUniqueID;
1.1543 +
1.1544 +
1.1545 + /**
1.1546 + The maximum size of the volume in bytes. The current amount of memory
1.1547 + in use plus the amount of free memory.
1.1548 + */
1.1549 + TInt64 iSize;
1.1550 +
1.1551 +
1.1552 + /**
1.1553 + The amount of free space on the volume in bytes.
1.1554 + */
1.1555 + TInt64 iFree;
1.1556 +
1.1557 +
1.1558 + /**
1.1559 + Name of the volume, with a maximum of KMaxFileName characters.
1.1560 +
1.1561 + This field is optional.
1.1562 +
1.1563 + @see KMaxFileName
1.1564 + */
1.1565 + TBufC<KMaxFileName> iName;
1.1566 +
1.1567 + /**
1.1568 + Flags which define the default file-caching behaviour for this volume
1.1569 +
1.1570 + @see TFileCacheFlags
1.1571 + */
1.1572 + TFileCacheFlags iFileCacheFlags;
1.1573 +
1.1574 + /**
1.1575 + @prototype
1.1576 + @internalTechnology
1.1577 + Internal flag, used in the case of non-blocking getting volume information.
1.1578 + @see RFs::Volume(TVolumeInfo& aVol,TInt aDrive, TRequestStatus& aStat)
1.1579 +
1.1580 + If this flag is set, it means that the volume information will be obtained
1.1581 + asynchronously. More specific, on return iFree will reflect the _current_ amount of free space on volume at the moment of
1.1582 + RFs::Volume() call, not the exact final value. This is because in this case getting volume information will be asynchronous,
1.1583 + and the client will not be suspended until the mount finish calculating free space. At present appicable to FAT32 file system only.
1.1584 + */
1.1585 + TUint8 iVolSizeAsync : 1;
1.1586 +
1.1587 +private:
1.1588 + /**
1.1589 + Reserved for future expansion
1.1590 + */
1.1591 + TUint8 i8Reserved1;
1.1592 + TUint16 i16Reserved1;
1.1593 + TUint32 i32Reserved1;
1.1594 + TUint32 i32Reserved2;
1.1595 + };
1.1596 +
1.1597 +
1.1598 +
1.1599 +
1.1600 +class TDriveUnit
1.1601 +/**
1.1602 +@publishedAll
1.1603 +@released
1.1604 +
1.1605 +Drive numbers and letters.
1.1606 +
1.1607 +A drive may be represented by either an integer between zero and twenty five
1.1608 +inclusive, or by a buffer descriptor containing a character between "A" and "Z"
1.1609 +inclusive, followed by a colon.
1.1610 +This class encapsulates both representations.
1.1611 +An instance of this class is constructed specifying either the drive number
1.1612 +or the drive letter and may be converted between the two representations.
1.1613 +*/
1.1614 + {
1.1615 +public:
1.1616 + inline TDriveUnit() {};
1.1617 + IMPORT_C TDriveUnit(TInt aDrive);
1.1618 + IMPORT_C TDriveUnit(const TDesC& aDrive);
1.1619 + IMPORT_C TDriveUnit& operator=(TInt aDrive);
1.1620 + IMPORT_C TDriveUnit& operator=(const TDesC& aDrive);
1.1621 + inline operator TInt() const;
1.1622 + IMPORT_C TDriveName Name() const;
1.1623 +private:
1.1624 + TInt iDrive;
1.1625 + };
1.1626 +
1.1627 +
1.1628 +
1.1629 +
1.1630 +class RFs;
1.1631 +//
1.1632 +class TParseBase
1.1633 +/**
1.1634 +@publishedAll
1.1635 +@released
1.1636 +
1.1637 +Base class for file name parsing.
1.1638 +
1.1639 +You first need to set up the path to be parsed using either a TParse, TParsePtr
1.1640 +or TParsePtrC object.
1.1641 +
1.1642 +The interrogation and extraction functions in this class allow you to test
1.1643 +whether a component has been specified in the pathname, and if so,
1.1644 +to extract it. If a component is not present in the pathname,
1.1645 +the extraction function returns an empty string.
1.1646 +
1.1647 +This class also allows directories to be added to, and popped from the path.
1.1648 +
1.1649 +Notes:
1.1650 +
1.1651 +1. the filename modification functions cannot be used by the TParsePtrC class.
1.1652 +
1.1653 +2. navigation using .. and . is not supported.
1.1654 +
1.1655 +@see TParse
1.1656 +@see TParsePtr
1.1657 +@see TParsePtrC
1.1658 +*/
1.1659 + {
1.1660 +private:
1.1661 + struct SField {TUint8 pos;TUint8 len;TUint8 present;TUint8 filler;};
1.1662 + enum TField {EDrive,EPath,EName,EExt,EMaxFields};
1.1663 + enum TWild {EWildName=0x01,EWildExt=0x02,EWildEither=0x04,EIsRoot=0x08,EWildIsKMatchOne=0x10,EWildIsKMatchAny=0x20};
1.1664 +public:
1.1665 + IMPORT_C TParseBase();
1.1666 + IMPORT_C TInt PopDir();
1.1667 + IMPORT_C TInt AddDir(const TDesC& aName);
1.1668 + IMPORT_C const TDesC& FullName() const;
1.1669 + IMPORT_C TPtrC Drive() const;
1.1670 + IMPORT_C TPtrC Path() const;
1.1671 + IMPORT_C TPtrC DriveAndPath() const;
1.1672 + IMPORT_C TPtrC Name() const;
1.1673 + IMPORT_C TPtrC Ext() const;
1.1674 + IMPORT_C TPtrC NameAndExt() const;
1.1675 + IMPORT_C TBool DrivePresent() const;
1.1676 + IMPORT_C TBool PathPresent() const;
1.1677 + IMPORT_C TBool NamePresent() const;
1.1678 + IMPORT_C TBool ExtPresent() const;
1.1679 + IMPORT_C TBool NameOrExtPresent() const;
1.1680 + IMPORT_C TBool IsRoot() const;
1.1681 + IMPORT_C TBool IsWild() const;
1.1682 + IMPORT_C TBool IsKMatchOne() const;
1.1683 + IMPORT_C TBool IsKMatchAny() const;
1.1684 + IMPORT_C TBool IsNameWild() const;
1.1685 + IMPORT_C TBool IsExtWild() const;
1.1686 +protected:
1.1687 + virtual TDes& NameBuf() = 0; // Reference to derived class descriptor containing the filename.
1.1688 + virtual const TDesC& NameBufC() const = 0; // const reference to derived class descriptor containing the filename.
1.1689 + TInt Set(const TDesC* aName,const TDesC* aRelated,const TDesC* aDefault,TBool allowWild);
1.1690 +private:
1.1691 + TInt ParseDrive(TLex& aName,TBool& aDone);
1.1692 + TInt ParsePath(TLex& aName,TBool& aDone);
1.1693 + TInt ParseName(TLex& aName,TBool& aDone);
1.1694 + TInt ParseExt(TLex& aName,TBool& aDone);
1.1695 +protected:
1.1696 + TInt16 iMod; // Non-zero indicates File name modification functionality is enabled.
1.1697 +private:
1.1698 + TInt16 iWild;
1.1699 + SField iField[EMaxFields];
1.1700 + };
1.1701 +
1.1702 +
1.1703 +
1.1704 +
1.1705 +class TParsePtr : public TParseBase
1.1706 +/**
1.1707 +@publishedAll
1.1708 +@released
1.1709 +
1.1710 +Parses filenames using less space on the stack than TParse.
1.1711 +
1.1712 +Stores a reference to a filename, unlike TParse, which uses
1.1713 +a 512 byte TFileName object as an internal buffer to store
1.1714 +a copy of the filename.
1.1715 +The filename's components (drive, path, etc.) can be retrieved using
1.1716 +the functions provided by the base class, TParseBase.
1.1717 +This class should be used in preference to TParse when minimising stack
1.1718 +usage is a priority.
1.1719 +
1.1720 +@see TParse
1.1721 +@see TFileName
1.1722 +*/
1.1723 + {
1.1724 +public:
1.1725 + IMPORT_C TParsePtr(TDes& aName);
1.1726 +protected:
1.1727 + IMPORT_C TDes& NameBuf();
1.1728 + IMPORT_C const TDesC& NameBufC() const;
1.1729 +private:
1.1730 + TPtr iNameBuf;
1.1731 + };
1.1732 +
1.1733 +
1.1734 +
1.1735 +
1.1736 +class TParsePtrC : public TParseBase
1.1737 +/**
1.1738 +@publishedAll
1.1739 +@released
1.1740 +
1.1741 +Parses, but cannot modify, filenames using less space on the stack than TParse.
1.1742 +
1.1743 +Stores a reference to a filename, unlike TParse, which uses
1.1744 +a 512 byte TFileName object as an internal buffer to store
1.1745 +a copy of the filename.
1.1746 +The filename's components (drive, path, etc.) can be retrieved using
1.1747 +the functions provided by the base class, TParseBase.
1.1748 +Note that because the filename cannot be modified through this class,
1.1749 +the base class functions PopDir() and AddDir() cannot be called, because
1.1750 +a panic will be raised.
1.1751 +
1.1752 +@see TParse
1.1753 +@see TFileName
1.1754 +*/
1.1755 + {
1.1756 +public:
1.1757 + IMPORT_C TParsePtrC(const TDesC& aName);
1.1758 +protected:
1.1759 + IMPORT_C TDes& NameBuf();
1.1760 + IMPORT_C const TDesC& NameBufC() const;
1.1761 +private:
1.1762 + TPtrC iNameBuf;
1.1763 + };
1.1764 +
1.1765 +
1.1766 +
1.1767 +
1.1768 +class TParse : public TParseBase
1.1769 +/**
1.1770 +@publishedAll
1.1771 +@released
1.1772 +
1.1773 +Parses filenames.
1.1774 +
1.1775 +The class uses the full filename structure supported by Symbian OS.
1.1776 +
1.1777 +TParse works by using the Set() function to set up the filename to be parsed.
1.1778 +Then, various getter functions defined in the base class, TParseBase, such as:
1.1779 +FullName(), Drive(), Path(), DriveAndPath(), Name(), Ext() and NameAndExt()
1.1780 +may be used to retrieve path components.
1.1781 +
1.1782 +There are a number of restrictions to valid path components, which are
1.1783 +described in guide documentation.
1.1784 +*/
1.1785 + {
1.1786 +public:
1.1787 + IMPORT_C TParse();
1.1788 + IMPORT_C TInt Set(const TDesC& aName,const TDesC* aRelated,const TDesC* aDefault);
1.1789 + IMPORT_C TInt SetNoWild(const TDesC& aName,const TDesC* aRelated,const TDesC* aDefault);
1.1790 +protected:
1.1791 + IMPORT_C TDes& NameBuf();
1.1792 + IMPORT_C const TDesC& NameBufC() const;
1.1793 +private:
1.1794 + TFileName iNameBuf;
1.1795 + };
1.1796 +
1.1797 +
1.1798 +
1.1799 +
1.1800 +class CDir : public CBase
1.1801 +/**
1.1802 +@publishedAll
1.1803 +@released
1.1804 +
1.1805 +Array of directory entries that has been read into memory from the file system.
1.1806 +
1.1807 +It can be read and sorted by user programs, but cannot be created by them.
1.1808 +*/
1.1809 + {
1.1810 +public:
1.1811 + IMPORT_C virtual ~CDir();
1.1812 + IMPORT_C TInt Count() const;
1.1813 + IMPORT_C const TEntry& operator[](TInt anIndex) const;
1.1814 + IMPORT_C TInt Sort(TUint aEntrySortKey);
1.1815 +protected:
1.1816 + IMPORT_C CDir();
1.1817 + IMPORT_C static CDir* NewL();
1.1818 + IMPORT_C void AddL(const TEntry& anEntry);
1.1819 + IMPORT_C void ExtractL(TBool aRemove,CDir*& aDir);
1.1820 + IMPORT_C void Compress();
1.1821 +protected:
1.1822 + CArrayPakFlat<TEntry>* iArray;
1.1823 + friend class RFs;
1.1824 + friend class TOpenFileScan;
1.1825 + };
1.1826 +
1.1827 +
1.1828 +#if defined SYMBIAN_PRIVATE_EFSRV
1.1829 + #define EFSRV_EXPORT_C
1.1830 + #define EFSRV_IMPORT_C
1.1831 +#else
1.1832 + #define EFSRV_EXPORT_C EXPORT_C
1.1833 + #define EFSRV_IMPORT_C IMPORT_C
1.1834 +#endif
1.1835 +
1.1836 +
1.1837 +class RFs : public RSessionBase
1.1838 +/**
1.1839 +@publishedAll
1.1840 +@released
1.1841 +
1.1842 +A handle to a file server session.
1.1843 +
1.1844 +A program or thread may have arbitrarily many sessions open simultaneously.
1.1845 +
1.1846 +Use this class for all file system manipulation, including:
1.1847 +
1.1848 +1. adding, removing, moving and renaming files and directories
1.1849 +
1.1850 +2. inspecting and changing file attributes and directory entry details.
1.1851 + These include the time and date when the file or directory was last
1.1852 + written to, its size and various attribute flags such as read-only,
1.1853 + hidden, archive or system.
1.1854 +
1.1855 +3. finding a file’s real name; if the file system on which it is stored
1.1856 + has to "mangle" the name into a shorter format
1.1857 +
1.1858 +4. getting directory listings
1.1859 +
1.1860 +5. maintaining a default path; unlike some other systems, there is a single
1.1861 + system default path, rather than one for each drive: the default path
1.1862 + consists of a drive and a path specification.
1.1863 +
1.1864 +6. performing context-sensitive parses using TParse objects, and
1.1865 + the session path
1.1866 +
1.1867 +7. obtaining information on drives and volumes
1.1868 +
1.1869 +8. formatting and labelling volumes
1.1870 +
1.1871 +9. obtaining a list of valid drives
1.1872 +
1.1873 +10. emulating the DOS subst command, which allows any directory to appear
1.1874 + as if it were a separate drive
1.1875 +
1.1876 +11. requesting notification of when significant change occurs.
1.1877 + This can be used for programs which maintain file lists, but must
1.1878 + update those lists when change occurs.
1.1879 +
1.1880 +12. finding the version number of the file server
1.1881 +
1.1882 +13. resource counting to ensure that all resources are closed when
1.1883 + the session terminates.
1.1884 +
1.1885 +This class is not intended for user derivation.
1.1886 +
1.1887 +The following restrictions apply when a path is specified:
1.1888 +
1.1889 +1. its total length must not exceed 256 characters
1.1890 +
1.1891 +2. wildcards cannot be used in the drive or in any directory name,
1.1892 + although they may be allowed in the filename and extension.
1.1893 +
1.1894 +3. double backslashes are not allowed in the path.
1.1895 +
1.1896 +4. the following characters must not be included anywhere in the path: < > " / |
1.1897 +
1.1898 +5. a colon may only be included between the drive and path
1.1899 +
1.1900 +6. no directory name or filename plus extension may consist solely
1.1901 + of space characters, or of a single or double dot.
1.1902 +
1.1903 +7. spaces between the drive, if specified, and the first directory in
1.1904 + the path are illegal, although there may be spaces between other
1.1905 + path components, for instance between directories.
1.1906 +*/
1.1907 + {
1.1908 +public:
1.1909 + EFSRV_IMPORT_C TInt Connect(TInt aMessageSlots=KFileServerDefaultMessageSlots);
1.1910 + EFSRV_IMPORT_C void Close();
1.1911 + EFSRV_IMPORT_C TVersion Version() const;
1.1912 + EFSRV_IMPORT_C TInt AddFileSystem(const TDesC& aFileName) const;
1.1913 + EFSRV_IMPORT_C TInt MountFileSystem(const TDesC& aFileSystemName,TInt aDrive) const;
1.1914 + EFSRV_IMPORT_C TInt MountFileSystem(const TDesC& aFileSystemName,TInt aDrive, TBool aIsSync) const;
1.1915 + EFSRV_IMPORT_C TInt MountFileSystemAndScan(const TDesC& aFileSystemName,TInt aDrive,TBool& aIsMountSuccess) const;
1.1916 + EFSRV_IMPORT_C TInt MountFileSystem(const TDesC& aFileSystemName,const TDesC& aExtensionName,TInt aDrive);
1.1917 + EFSRV_IMPORT_C TInt MountFileSystem(const TDesC& aFileSystemName,const TDesC& aExtensionName,TInt aDrive, TBool aIsSync);
1.1918 + EFSRV_IMPORT_C TInt MountFileSystemAndScan(const TDesC& aFileSystemName,const TDesC& aExtensionName,TInt aDrive,TBool& aIsMountSuccess) const;
1.1919 + EFSRV_IMPORT_C TInt DismountFileSystem(const TDesC& aFileSystemName,TInt aDrive) const;
1.1920 + EFSRV_IMPORT_C TInt RemoveFileSystem(const TDesC& aFileSystemName) const;
1.1921 + EFSRV_IMPORT_C TInt FileSystemName(TDes& aName,TInt aDrive) const;
1.1922 + EFSRV_IMPORT_C TInt AddExtension(const TDesC& aFileName);
1.1923 + EFSRV_IMPORT_C TInt MountExtension(const TDesC& aExtensionName,TInt aDrive);
1.1924 + EFSRV_IMPORT_C TInt DismountExtension(const TDesC& aExtensionName,TInt aDrive);
1.1925 + EFSRV_IMPORT_C TInt RemoveExtension(const TDesC& aExtensionName);
1.1926 + EFSRV_IMPORT_C TInt ExtensionName(TDes& aExtensionName,TInt aDrive,TInt aPos);
1.1927 + EFSRV_IMPORT_C TInt RemountDrive(TInt aDrive,const TDesC8* aMountInfo=NULL,TUint aFlags=0);
1.1928 + EFSRV_IMPORT_C void NotifyChange(TNotifyType aType,TRequestStatus& aStat);
1.1929 + EFSRV_IMPORT_C void NotifyChange(TNotifyType aType,TRequestStatus& aStat,const TDesC& aPathName);
1.1930 + EFSRV_IMPORT_C void NotifyChangeCancel();
1.1931 + EFSRV_IMPORT_C void NotifyChangeCancel(TRequestStatus& aStat);
1.1932 + EFSRV_IMPORT_C void NotifyDiskSpace(TInt64 aThreshold,TInt aDrive,TRequestStatus& aStat);
1.1933 + EFSRV_IMPORT_C void NotifyDiskSpaceCancel(TRequestStatus& aStat);
1.1934 + EFSRV_IMPORT_C void NotifyDiskSpaceCancel();
1.1935 + EFSRV_IMPORT_C TInt DriveList(TDriveList& aList) const;
1.1936 + EFSRV_IMPORT_C TInt DriveList(TDriveList& aList, TUint aFlags) const;
1.1937 + EFSRV_IMPORT_C TInt Drive(TDriveInfo& anInfo,TInt aDrive=KDefaultDrive) const;
1.1938 + EFSRV_IMPORT_C TInt Volume(TVolumeInfo& aVol,TInt aDrive=KDefaultDrive) const;
1.1939 + EFSRV_IMPORT_C void Volume(TVolumeInfo& aVol,TInt aDrive, TRequestStatus& aStat) const;
1.1940 + EFSRV_IMPORT_C TInt SetVolumeLabel(const TDesC& aName,TInt aDrive=KDefaultDrive);
1.1941 + EFSRV_IMPORT_C TInt Subst(TDes& aPath,TInt aDrive=KDefaultDrive) const;
1.1942 + EFSRV_IMPORT_C TInt SetSubst(const TDesC& aPath,TInt aDrive=KDefaultDrive);
1.1943 + EFSRV_IMPORT_C TInt RealName(const TDesC& aName,TDes& aResult) const;
1.1944 + EFSRV_IMPORT_C TInt GetMediaSerialNumber(TMediaSerialNumber& aSerialNum, TInt aDrive);
1.1945 + EFSRV_IMPORT_C TInt SessionPath(TDes& aPath) const;
1.1946 + EFSRV_IMPORT_C TInt SetSessionPath(const TDesC& aPath);
1.1947 + EFSRV_IMPORT_C TInt Parse(const TDesC& aName,TParse& aParse) const;
1.1948 + EFSRV_IMPORT_C TInt Parse(const TDesC& aName,const TDesC& aRelated,TParse& aParse) const;
1.1949 + EFSRV_IMPORT_C TInt MkDir(const TDesC& aPath);
1.1950 + EFSRV_IMPORT_C TInt MkDirAll(const TDesC& aPath);
1.1951 + EFSRV_IMPORT_C TInt RmDir(const TDesC& aPath);
1.1952 + EFSRV_IMPORT_C TInt GetDir(const TDesC& aName,TUint anEntryAttMask,TUint anEntrySortKey,CDir*& anEntryList) const;
1.1953 + EFSRV_IMPORT_C TInt GetDir(const TDesC& aName,TUint anEntryAttMask,TUint anEntrySortKey,CDir*& anEntryList,CDir*& aDirList) const;
1.1954 + EFSRV_IMPORT_C TInt GetDir(const TDesC& aName,const TUidType& anEntryUid,TUint anEntrySortKey,CDir*& aFileList) const;
1.1955 + EFSRV_IMPORT_C TInt Delete(const TDesC& aName);
1.1956 + EFSRV_IMPORT_C TInt Rename(const TDesC& anOldName,const TDesC& aNewName);
1.1957 + EFSRV_IMPORT_C TInt Replace(const TDesC& anOldName,const TDesC& aNewName);
1.1958 + EFSRV_IMPORT_C TInt Att(const TDesC& aName,TUint& aAttValue) const;
1.1959 + EFSRV_IMPORT_C TInt SetAtt(const TDesC& aName,TUint aSetAttMask,TUint aClearAttMask);
1.1960 + EFSRV_IMPORT_C TInt Modified(const TDesC& aName,TTime& aTime) const;
1.1961 + EFSRV_IMPORT_C TInt SetModified(const TDesC& aName,const TTime& aTime);
1.1962 + EFSRV_IMPORT_C TInt Entry(const TDesC& aName,TEntry& anEntry) const;
1.1963 + EFSRV_IMPORT_C TInt SetEntry(const TDesC& aName,const TTime& aTime,TUint aSetAttMask,TUint aClearAttMask);
1.1964 +private:
1.1965 + EFSRV_IMPORT_C TInt ReadFileSection_RESERVED(const TDesC& aName,TInt aPos,TDes8& aDes,TInt aLength) const;
1.1966 +public:
1.1967 + EFSRV_IMPORT_C static TBool IsValidDrive(TInt aDrive);
1.1968 + EFSRV_IMPORT_C static TInt CharToDrive(TChar aChar,TInt& aDrive);
1.1969 + EFSRV_IMPORT_C static TInt DriveToChar(TInt aDrive,TChar& aChar);
1.1970 + EFSRV_IMPORT_C static TBool IsRomAddress(TAny* aAny);
1.1971 + EFSRV_IMPORT_C static TDriveNumber GetSystemDrive();
1.1972 + EFSRV_IMPORT_C static TChar GetSystemDriveChar();
1.1973 + EFSRV_IMPORT_C TInt SetSystemDrive(TDriveNumber aSystemDrive);
1.1974 + EFSRV_IMPORT_C void ResourceCountMarkStart() const;
1.1975 + EFSRV_IMPORT_C void ResourceCountMarkEnd() const;
1.1976 + EFSRV_IMPORT_C TInt ResourceCount() const;
1.1977 + EFSRV_IMPORT_C TInt IsFileOpen(const TDesC& aFile,TBool& anAnswer) const;
1.1978 + EFSRV_IMPORT_C TInt CheckDisk(const TDesC& aDrive) const;
1.1979 + EFSRV_IMPORT_C TInt ScanDrive(const TDesC& aDrive) const;
1.1980 + EFSRV_IMPORT_C TInt GetShortName(const TDesC& aLongName,TDes& aShortName) const;
1.1981 + EFSRV_IMPORT_C TInt GetLongName(const TDesC& aShortName,TDes& aLongName) const;
1.1982 + EFSRV_IMPORT_C TBool GetNotifyUser();
1.1983 + EFSRV_IMPORT_C void SetNotifyUser(TBool aValue);
1.1984 + EFSRV_IMPORT_C TUint8* IsFileInRom(const TDesC& aFileName) const;
1.1985 + EFSRV_IMPORT_C TBool IsValidName(const TDesC& anEntryName) const;
1.1986 + EFSRV_IMPORT_C TBool IsValidName(const TDesC& aFileName,TText& aBadChar) const;
1.1987 + EFSRV_IMPORT_C TInt GetDriveName(TInt aDrive,TDes& aDriveName) const;
1.1988 + EFSRV_IMPORT_C TInt SetDriveName(TInt aDrive,const TDesC& aDriveName);
1.1989 + EFSRV_IMPORT_C TInt LoaderHeapFunction(TInt aFunction, TAny *aArg1=NULL, TAny *aArg2=NULL);
1.1990 + IMPORT_C TInt SetErrorCondition(TInt anError,TInt aCount=0);
1.1991 + EFSRV_IMPORT_C TInt SetDebugRegister(TInt aVal);
1.1992 + EFSRV_IMPORT_C TInt SetAllocFailure(TInt aAllocNum);
1.1993 + EFSRV_IMPORT_C void DebugNotify(TInt aDrive,TUint aNotifyType,TRequestStatus& aStat);
1.1994 + EFSRV_IMPORT_C TInt ControlIo(TInt aDrive,TInt aCommand);
1.1995 + EFSRV_IMPORT_C TInt ControlIo(TInt aDrive,TInt aCommand,TDes8& aParam1);
1.1996 + EFSRV_IMPORT_C TInt ControlIo(TInt aDrive,TInt aCommand,TDes8& aParam1,TDes8& aParam2);
1.1997 + EFSRV_IMPORT_C TInt ControlIo(TInt aDrive,TInt aCommand,TAny* aParam1,TAny* aParam2);
1.1998 + EFSRV_IMPORT_C TInt LockDrive(TInt aDrv, const TMediaPassword &aOld, const TMediaPassword &aNew, TBool aStr);
1.1999 + EFSRV_IMPORT_C TInt UnlockDrive(TInt aDrv, const TMediaPassword &Pswd, TBool aStr);
1.2000 + EFSRV_IMPORT_C TInt ClearPassword(TInt aDrv, const TMediaPassword &aPswd);
1.2001 + EFSRV_IMPORT_C TInt ErasePassword(TInt aDrv);
1.2002 + EFSRV_IMPORT_C TInt SetSessionToPrivate(TInt aDrive);
1.2003 + EFSRV_IMPORT_C TInt PrivatePath(TDes& aPath);
1.2004 + EFSRV_IMPORT_C TInt CreatePrivatePath(TInt aDrive);
1.2005 + EFSRV_IMPORT_C void StartupInitComplete(TRequestStatus& aStat);
1.2006 + EFSRV_IMPORT_C TInt SetLocalDriveMapping(const TDesC8& aMapping);
1.2007 +
1.2008 + EFSRV_IMPORT_C TInt FinaliseDrives();
1.2009 +
1.2010 + /** specifies drive finalisation modes */
1.2011 + enum TFinaliseDrvMode
1.2012 + {
1.2013 + EFinal_RW, ///< after successful finalisation the drive remains writable and will become "not finalised" after the first write operation.
1.2014 + EFinal_RO, ///< after successful finalisation the drive becomes read-only
1.2015 + EForceUnfinalise///< @internalComponent mark the drive as "not finalised" can result in KErrAbort if the dive is in inconsistent state.
1.2016 + };
1.2017 +
1.2018 + EFSRV_IMPORT_C TInt FinaliseDrive(TInt aDriveNo, TFinaliseDrvMode aMode) const;
1.2019 +
1.2020 + EFSRV_IMPORT_C TInt SwapFileSystem(const TDesC& aOldFileSystemName,const TDesC& aNewFileSystemName,TInt aDrive) const;
1.2021 + EFSRV_IMPORT_C TInt ReserveDriveSpace(TInt aDriveNo, TInt aSpace);
1.2022 + EFSRV_IMPORT_C TInt GetReserveAccess(TInt aDriveNo);
1.2023 + EFSRV_IMPORT_C TInt ReleaseReserveAccess(TInt aDriveNo);
1.2024 +
1.2025 + EFSRV_IMPORT_C TInt AddPlugin(const TDesC& aFileName) const;
1.2026 + EFSRV_IMPORT_C TInt RemovePlugin(const TDesC& aPluginName) const;
1.2027 + EFSRV_IMPORT_C TInt PluginName(TDes& aPluginName,TInt aDrive,TInt aPos);
1.2028 +
1.2029 + EFSRV_IMPORT_C TInt MountPlugin(const TDesC& aPluginName) const;
1.2030 + EFSRV_IMPORT_C TInt MountPlugin(const TDesC& aPluginName,TInt aDrive) const;
1.2031 + EFSRV_IMPORT_C TInt MountPlugin(const TDesC& aPluginName,TInt aDrive, TInt aPos) const;
1.2032 +
1.2033 + EFSRV_IMPORT_C TInt DismountPlugin(const TDesC& aPluginName) const;
1.2034 + EFSRV_IMPORT_C TInt DismountPlugin(const TDesC& aPluginName,TInt aDrive) const;
1.2035 + EFSRV_IMPORT_C TInt DismountPlugin(const TDesC& aPluginName,TInt aDrive,TInt aPos) const;
1.2036 +
1.2037 + EFSRV_IMPORT_C void NotifyDismount(TInt aDrive, TRequestStatus& aStat, TNotifyDismountMode aMode=EFsDismountRegisterClient) const;
1.2038 + EFSRV_IMPORT_C void NotifyDismountCancel(TRequestStatus& aStat) const;
1.2039 + EFSRV_IMPORT_C void NotifyDismountCancel() const;
1.2040 + EFSRV_IMPORT_C TInt AllowDismount(TInt aDrive) const;
1.2041 + EFSRV_IMPORT_C TInt SetStartupConfiguration(TInt aCommand,TAny* aParam1,TAny* aParam2) const;
1.2042 + EFSRV_IMPORT_C TInt AddCompositeMount(const TDesC& aFileSystemName,TInt aLocalDriveToMount,TInt aCompositeDrive, TBool aSync) const;
1.2043 + EFSRV_IMPORT_C TInt SetNotifyChange(TBool aNotifyChange);
1.2044 + EFSRV_IMPORT_C TInt QueryVolumeInfoExt(TInt aDrive, TQueryVolumeInfoExtCmd aCommand, TDes8& aInfo) const;
1.2045 + EFSRV_IMPORT_C TInt VolumeIOParam(TInt aDriveNo, TVolumeIOParamInfo& aParamInfo) const;
1.2046 + EFSRV_IMPORT_C TInt FileSystemSubType(TInt aDriveNo, TDes& aName) const;
1.2047 + EFSRV_IMPORT_C TInt InitialisePropertiesFile(const TPtrC8& aPtr) const;
1.2048 +
1.2049 + IMPORT_C TInt AddProxyDrive(const TDesC& aFileName);
1.2050 + IMPORT_C TInt RemoveProxyDrive(const TDesC& aDriveName);
1.2051 +
1.2052 + template <class T0,class T1> inline TInt MountProxyDrive(const TUint aDrive, const TDesC& aName, T0 a0, T1 a1)
1.2053 + { return(DoMountProxyDrive(TIpcArgs(aDrive, &aName, a0, a1))); };
1.2054 + IMPORT_C TInt DismountProxyDrive(const TUint aDrive);
1.2055 +
1.2056 + TInt Unclamp(const RFileClamp& aHandle);
1.2057 +
1.2058 + EFSRV_IMPORT_C TInt ReadFileSection(const TDesC& aName,TInt64 aPos,TDes8& aDes,TInt aLength) const;
1.2059 +
1.2060 + /**
1.2061 + This class is used to for returning meaningful error code values to users of RFs::IsValidName(const TDesC& ,TNameValidParam& )
1.2062 + @see TError
1.2063 + */
1.2064 + class TNameValidParam
1.2065 + {
1.2066 + public:
1.2067 + /** Initialises the members of the class. By default iUseSessionPath is set to EFalse, however one could set it to ETrue.*/
1.2068 + inline TNameValidParam(TBool aUseSessionPath = EFalse);
1.2069 +
1.2070 + /** possible error codes */
1.2071 + enum TError
1.2072 + {
1.2073 + ErrNone, ///< no error.
1.2074 + ErrBadCharacter, ///< aName contains a bad character; and its position is in iInvalidCharPos.
1.2075 + ErrBadName, ///< aName isn't a valid file or directory name.
1.2076 + ErrNameTooLong ///< aName length or aName + session path length (see iUseSessionPath) is longer than 256 characters.
1.2077 + };
1.2078 +
1.2079 + inline TError ErrorCode() const;
1.2080 + inline void UseSessionPath(TBool aUseSessionPath);
1.2081 + inline TUint InvalidCharPos() const;
1.2082 + friend class TFsIsValidName;
1.2083 + private:
1.2084 + TError iError; ///< the reason why aName is invalid, see TError
1.2085 + TBool iUseSessionPath; ///< if ETrue, and if aName isn't fully specified, missing parts will be taken from the session path
1.2086 + TUint iInvalidCharPos; ///< may contain invalid character position if error is ErrBadCharacter,else 0.
1.2087 + };
1.2088 + EFSRV_IMPORT_C TBool IsValidName(const TDesC& aName, TNameValidParam& aParam );
1.2089 +
1.2090 + /** Special enumerator values for the SupportedFileSystemName() API */
1.2091 + enum
1.2092 + {
1.2093 + KRootFileSystem = 0x00800000, ///< specifies "root" file system. The result will be the same as for FileSystemName() API call
1.2094 + KFirstChildFileSystem = 0 ///< specifies the first child file system number, the second will be KFirstChildFileSystem+1 etc.
1.2095 + };
1.2096 +
1.2097 + EFSRV_IMPORT_C TInt SupportedFileSystemName(TDes& aName, TInt aDrive, TInt aFsEnumerator) const;
1.2098 +
1.2099 +protected:
1.2100 + TInt SendReceive(TInt aFunction,const TIpcArgs& aArgs) const;
1.2101 +
1.2102 +private:
1.2103 + void GetDirL(const TDesC& aMatchName,TUint anEntryAttMask,TUint anEntrySortKey,CDir*& anEntryList,CDir*& aDirList,RDir& aDir) const;
1.2104 + void GetDirL(const TDesC& aMatchName,TUint anEntryAttMask,TUint anEntrySortKey,CDir*& anEntryList,RDir& aDir) const;
1.2105 + void GetDirL(const TDesC& aMatchName,const TUidType& aUidType,TUint anEntrySortKey,CDir*& anEntryList,RDir& aDir) const;
1.2106 + void DoGetDirL(TUint anEntrySortKey,CDir*& anEntryList,RDir& aDir) const;
1.2107 + TInt GetOpenFileList(TInt& aSessionNum,TInt& aLocalPos,TThreadId& aThreadId,TEntryArray& anArray) const;
1.2108 +
1.2109 + IMPORT_C TInt DoMountProxyDrive(const TIpcArgs& ipcArgs);
1.2110 +
1.2111 + friend class TOpenFileScan;
1.2112 + friend class RFsPlugin;
1.2113 + };
1.2114 +
1.2115 +
1.2116 +//-------------------------------------------------------------------------------------------------------------------
1.2117 +
1.2118 +/**
1.2119 +
1.2120 + Base class for volume formatting parameters. This class package buffer, TVolFormatParamBuf or
1.2121 + packaged buffer of the derived class can be passed to the RFormat::Open() in order to provide
1.2122 + file system-specific formatting parameters.
1.2123 + Each file system that supports such formatting parameters shall have this class specialisation (e.g. TVolFormatParam_FAT)
1.2124 + All classes, derived from this one must have the same size as the base class.
1.2125 + In order to use formatting parameters the format mode shall have ESpecialFormat bit flag set.
1.2126 +
1.2127 +
1.2128 + @see RFormat::Open(RFs&,const TDesC&,TUint,TInt& ,const TDesC8& anInfo);
1.2129 + @see TVolFormatParamBuf
1.2130 +
1.2131 + @publishedAll
1.2132 + @released
1.2133 +*/
1.2134 +class TVolFormatParam
1.2135 + {
1.2136 +public:
1.2137 + inline TVolFormatParam();
1.2138 + inline void Init();
1.2139 +
1.2140 + inline void SetFileSystemName(const TDesC& aFsName);
1.2141 +
1.2142 + static inline TUint32 CalcFSNameHash(const TDesC& aFsName);
1.2143 + inline TUint32 FSNameHash() const;
1.2144 +
1.2145 + inline TBool SomeParamsSet() const;
1.2146 +
1.2147 +
1.2148 +protected:
1.2149 +
1.2150 +
1.2151 + enum {KMaxDataSlots = 64}; ///< the size of data array iData
1.2152 +
1.2153 + inline void SetVal(TUint aIndex, TUint32 aVal);
1.2154 + inline TUint32 GetVal(TUint aIndex) const;
1.2155 +
1.2156 +
1.2157 +public:
1.2158 + enum {KUId = 0x820116A2}; ///< this value shell be in iUid field to identify this class object
1.2159 +
1.2160 + /**
1.2161 + This class tree UID. Used to distinguish the object of this class from TLDFormatInfo and other possible data structures.
1.2162 + For this and derived classes this field must be KUId. This field offset in the class must be 0
1.2163 + */
1.2164 + const TUint32 iUId;
1.2165 +
1.2166 +private:
1.2167 + TUint32 iFSysNameHash; ///< Up-cased file system name hash (crc32) used to designate the file system. 0 means "not set"
1.2168 + TBool iParamsSet : 1; ///< ETrue if any parameter was set (SetVal() called). Gets reset to EFalse by Init()
1.2169 + TUint32 iData[KMaxDataSlots]; ///< used as a pool for various data. The derived classes are free to use it by SetVal()/GetVal()
1.2170 + };
1.2171 +
1.2172 +__ASSERT_COMPILE(_FOFF(TVolFormatParam, iUId) == 0);
1.2173 +__ASSERT_COMPILE(sizeof(TVolFormatParam) != sizeof(TLDFormatInfo));
1.2174 +
1.2175 +
1.2176 +/** package buffer for the objects of class TVolFormatParamBuf */
1.2177 +typedef TPckgBuf<TVolFormatParam> TVolFormatParamBuf;
1.2178 +
1.2179 +
1.2180 +
1.2181 +
1.2182 +#ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.2183 +/**
1.2184 +@publishedAll
1.2185 +@released
1.2186 +
1.2187 +Creates and opens a file, and performs all operations on a single open file.
1.2188 +
1.2189 +These include:
1.2190 +
1.2191 +- reading from and writing to the file
1.2192 +
1.2193 +- seeking to a position within the file
1.2194 +
1.2195 +- locking and unlocking within the file
1.2196 +
1.2197 +- setting file attributes
1.2198 +
1.2199 +Before using any of these services, a connection to a file server session must
1.2200 +have been made, and the file must be open.
1.2201 +
1.2202 +Opening Files:
1.2203 +
1.2204 +- use Open() to open an existing file for reading or writing; an error is
1.2205 + returned if it does not already exist.
1.2206 + To open an existing file for reading only, use Open() with an access mode of
1.2207 + EFileRead, and a share mode of EFileShareReadersOnly.
1.2208 +
1.2209 +- use Create() to create and open a new file for writing; an error is returned
1.2210 + if it already exists.
1.2211 +
1.2212 +- use Replace() to open a file for writing, replacing any existing file of
1.2213 + the same name if one exists, or creating a new file if one does not exist.
1.2214 + Note that if a file exists, its length is reset to zero.
1.2215 +
1.2216 +- use Temp() to create and open a temporary file with a unique name,
1.2217 + for writing and reading.
1.2218 +
1.2219 +When opening a file, you must specify the file server session to use for
1.2220 +operations with that file. If you do not close the file explicitly, it is
1.2221 +closed when the server session associated with it is closed.
1.2222 +
1.2223 +Reading and Writing:
1.2224 +
1.2225 +There are several variants of both Read() and Write().
1.2226 +The basic Read(TDes8& aDes) and Write(const TDesC8& aDes) are supplemented
1.2227 +by variants allowing the descriptor length to be overridden, or the seek
1.2228 +position of the first byte to be specified, or asynchronous completion,
1.2229 +or any combination.
1.2230 +
1.2231 +Reading transfers data from a file to a descriptor, and writing transfers
1.2232 +data from a descriptor to a file. In all cases, the file data is treated
1.2233 +as binary and byte descriptors are used (TDes8, TDesC8).
1.2234 +
1.2235 +@see TDes8
1.2236 +@see TDesC8
1.2237 +*/
1.2238 +#else
1.2239 +/**
1.2240 +@publishedAll
1.2241 +@released
1.2242 +
1.2243 +Creates and opens a file, and performs all operations on a single open file.
1.2244 +
1.2245 +These include:
1.2246 +
1.2247 +- reading from and writing to the file
1.2248 +
1.2249 +- seeking to a position within the file
1.2250 +
1.2251 +- locking and unlocking within the file
1.2252 +
1.2253 +- setting file attributes
1.2254 +
1.2255 +Before using any of these services, a connection to a file server session must
1.2256 +have been made, and the file must be open.
1.2257 +
1.2258 +Opening Files:
1.2259 +
1.2260 +- use Open() to open an existing file for reading or writing; an error is
1.2261 + returned if it does not already exist.
1.2262 + To open an existing file for reading only, use Open() with an access mode of
1.2263 + EFileRead, and a share mode of EFileShareReadersOnly.
1.2264 +
1.2265 +- use Create() to create and open a new file for writing; an error is returned
1.2266 + if it already exists.
1.2267 +
1.2268 +- use Replace() to open a file for writing, replacing any existing file of
1.2269 + the same name if one exists, or creating a new file if one does not exist.
1.2270 + Note that if a file exists, its length is reset to zero.
1.2271 +
1.2272 +- use Temp() to create and open a temporary file with a unique name,
1.2273 + for writing and reading.
1.2274 +
1.2275 +When opening a file, you must specify the file server session to use for
1.2276 +operations with that file. If you do not close the file explicitly, it is
1.2277 +closed when the server session associated with it is closed.
1.2278 +
1.2279 +Reading and Writing:
1.2280 +
1.2281 +There are several variants of both Read() and Write().
1.2282 +The basic Read(TDes8& aDes) and Write(const TDesC8& aDes) are supplemented
1.2283 +by variants allowing the descriptor length to be overridden, or the seek
1.2284 +position of the first byte to be specified, or asynchronous completion,
1.2285 +or any combination.
1.2286 +
1.2287 +Reading transfers data from a file to a descriptor, and writing transfers
1.2288 +data from a descriptor to a file. In all cases, the file data is treated
1.2289 +as binary and byte descriptors are used (TDes8, TDesC8).
1.2290 +
1.2291 +RFile class supports operations on files of size less than or equal to 2GB - 1.
1.2292 +If the file size is greater than 2GB - 1 (large file), use of class RFile64 is
1.2293 +recommended for following operations:
1.2294 + 1. Opening a large file
1.2295 + 2. Creating a file which can grow beyond 2GB - 1 by size
1.2296 + 3. Creating a temporary file which can grow beyond 2GB - 1 by size
1.2297 + 4. Replacing an existing file after which it can grow beyond 2GB - 1 by size
1.2298 + 5. Adopting a large file handle from client
1.2299 + 6. Adopting a large file handle from server
1.2300 + 7. Adopting a large file handle from another process
1.2301 + 8. Read from a position greater than 2GB - 1
1.2302 + 9. Writing to a file by which the size can grow beyond 2GB - 1
1.2303 + 10. Seek to a position greater than 2GB - 1
1.2304 + 11. Setting a size greater than 2GB - 1
1.2305 + 12. Querying the file size (greater than 2GB - 1)
1.2306 + 13. Locking and unlocking a position and length that is beyond 2GB - 1
1.2307 +
1.2308 +@see TDes8
1.2309 +@see TDesC8
1.2310 +
1.2311 +@see RFile64
1.2312 +
1.2313 +*/
1.2314 +
1.2315 +#endif
1.2316 +
1.2317 +
1.2318 +class RFile : public RSubSessionBase
1.2319 + {
1.2320 +public:
1.2321 + EFSRV_IMPORT_C TInt Open(RFs& aFs,const TDesC& aName,TUint aFileMode);
1.2322 + EFSRV_IMPORT_C void Close();
1.2323 + EFSRV_IMPORT_C TInt Create(RFs& aFs,const TDesC& aName,TUint aFileMode);
1.2324 + EFSRV_IMPORT_C TInt Replace(RFs& aFs,const TDesC& aName,TUint aFileMode);
1.2325 + EFSRV_IMPORT_C TInt Temp(RFs& aFs,const TDesC& aPath,TFileName& aName,TUint aFileMode);
1.2326 + EFSRV_IMPORT_C TInt Read(TDes8& aDes) const;
1.2327 + EFSRV_IMPORT_C void Read(TDes8& aDes,TRequestStatus& aStatus) const;
1.2328 + EFSRV_IMPORT_C TInt Read(TDes8& aDes,TInt aLength) const;
1.2329 + EFSRV_IMPORT_C void Read(TDes8& aDes,TInt aLength,TRequestStatus& aStatus) const;
1.2330 + EFSRV_IMPORT_C TInt Read(TInt aPos,TDes8& aDes) const;
1.2331 + EFSRV_IMPORT_C void Read(TInt aPos,TDes8& aDes,TRequestStatus& aStatus) const;
1.2332 + EFSRV_IMPORT_C TInt Read(TInt aPos,TDes8& aDes,TInt aLength) const;
1.2333 + EFSRV_IMPORT_C void Read(TInt aPos,TDes8& aDes,TInt aLength,TRequestStatus& aStatus) const;
1.2334 + EFSRV_IMPORT_C void ReadCancel(TRequestStatus& aStatus) const;
1.2335 + EFSRV_IMPORT_C void ReadCancel() const;
1.2336 + EFSRV_IMPORT_C TInt Write(const TDesC8& aDes);
1.2337 + EFSRV_IMPORT_C void Write(const TDesC8& aDes,TRequestStatus& aStatus);
1.2338 + EFSRV_IMPORT_C TInt Write(const TDesC8& aDes,TInt aLength);
1.2339 + EFSRV_IMPORT_C void Write(const TDesC8& aDes,TInt aLength,TRequestStatus& aStatus);
1.2340 + EFSRV_IMPORT_C TInt Write(TInt aPos,const TDesC8& aDes);
1.2341 + EFSRV_IMPORT_C void Write(TInt aPos,const TDesC8& aDes,TRequestStatus& aStatus);
1.2342 + EFSRV_IMPORT_C TInt Write(TInt aPos,const TDesC8& aDes,TInt aLength);
1.2343 + EFSRV_IMPORT_C void Write(TInt aPos,const TDesC8& aDes,TInt aLength,TRequestStatus& aStatus);
1.2344 + EFSRV_IMPORT_C TInt Lock(TInt aPos,TInt aLength) const;
1.2345 + EFSRV_IMPORT_C TInt UnLock(TInt aPos,TInt aLength) const;
1.2346 + EFSRV_IMPORT_C TInt Seek(TSeek aMode,TInt& aPos) const;
1.2347 + EFSRV_IMPORT_C TInt Flush();
1.2348 + EFSRV_IMPORT_C void Flush(TRequestStatus& aStatus);
1.2349 + EFSRV_IMPORT_C TInt Size(TInt& aSize) const;
1.2350 + EFSRV_IMPORT_C TInt SetSize(TInt aSize);
1.2351 + EFSRV_IMPORT_C TInt Att(TUint& aAttValue) const;
1.2352 + EFSRV_IMPORT_C TInt SetAtt(TUint aSetAttMask,TUint aClearAttMask);
1.2353 + EFSRV_IMPORT_C TInt Modified(TTime& aTime) const;
1.2354 + EFSRV_IMPORT_C TInt SetModified(const TTime& aTime);
1.2355 + EFSRV_IMPORT_C TInt Set(const TTime& aTime,TUint aSetAttMask,TUint aClearAttMask);
1.2356 + EFSRV_IMPORT_C TInt ChangeMode(TFileMode aNewMode);
1.2357 + EFSRV_IMPORT_C TInt Rename(const TDesC& aNewName);
1.2358 + EFSRV_IMPORT_C TInt Drive(TInt &aDriveNumber, TDriveInfo &aDriveInfo) const;
1.2359 + EFSRV_IMPORT_C TInt Adopt(RFs& aFs, TInt aHandle);
1.2360 + EFSRV_IMPORT_C TInt AdoptFromClient(const RMessage2& aMsg, TInt aFsHandleIndex, TInt aFileHandleIndex);
1.2361 + EFSRV_IMPORT_C TInt AdoptFromServer(TInt aFsHandle, TInt aFileHandle);
1.2362 + EFSRV_IMPORT_C TInt AdoptFromCreator(TInt aFsIndex, TInt aFileHandleIndex);
1.2363 + EFSRV_IMPORT_C TInt Name(TDes& aName) const;
1.2364 + EFSRV_IMPORT_C TInt TransferToServer(TIpcArgs& aIpcArgs, TInt aFsHandleIndex, TInt aFileHandleIndex) const;
1.2365 + EFSRV_IMPORT_C TInt TransferToClient(const RMessage2& aMsg, TInt aFileHandleIndex) const;
1.2366 + EFSRV_IMPORT_C TInt TransferToProcess(RProcess& aProcess, TInt aFsHandleIndex, TInt aFileHandleIndex) const;
1.2367 + EFSRV_IMPORT_C TInt Duplicate(const RFile& aFile, TOwnerType aType=EOwnerProcess);
1.2368 + EFSRV_IMPORT_C TInt FullName(TDes& aName) const;
1.2369 + EFSRV_IMPORT_C TInt BlockMap(SBlockMapInfo& aInfo, TInt64& aStartPos, TInt64 aEndPos=-1, TInt aBlockMapusage=EBlockMapUsagePaging) const;
1.2370 + TInt Clamp(RFileClamp& aHandle);
1.2371 +
1.2372 +protected:
1.2373 + // RSubSessionBase overrides
1.2374 + TInt CreateSubSession(const RSessionBase& aSession,TInt aFunction,const TIpcArgs& aArgs);
1.2375 + void CloseSubSession(TInt aFunction);
1.2376 + TInt SendReceive(TInt aFunction,const TIpcArgs& aArgs) const;
1.2377 +
1.2378 + TInt DuplicateHandle(TInt& aSubSessionHandle) const;
1.2379 +
1.2380 + friend class RFilePlugin;
1.2381 + };
1.2382 +
1.2383 +#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.2384 +#include <f32file64.h>
1.2385 +#endif
1.2386 +
1.2387 +class RDir : public RSubSessionBase
1.2388 +/**
1.2389 +@publishedAll
1.2390 +@released
1.2391 +
1.2392 +Reads the entries contained in a directory.
1.2393 +
1.2394 +You must first open the directory, specifying an attribute mask which is used
1.2395 +by Read() calls to filter the entry types required. Then, use one of
1.2396 +the Read() functions to read the filtered entries. When the operation
1.2397 +is complete, the directory should be closed using Close()
1.2398 +
1.2399 +There are two types of Read(): one works with a single entry at a time,
1.2400 +requiring programs to iterate through the entries explicitly.
1.2401 +The other works with an entire TEntryArray, allowing multiple entries to be
1.2402 +read in one call.
1.2403 +As well as making application program logic somewhat simpler, this type
1.2404 +uses fewer calls to the server, and is more efficient.
1.2405 +
1.2406 +Each type of Read() can be performed either synchronously or asynchronously.
1.2407 +
1.2408 +It may be more convenient to use RFs::GetDir() than the Read() calls supported
1.2409 +by this class.
1.2410 +RFs::GetDir() has the advantage that it allows a directory’s entries to be
1.2411 +sorted in various ways.
1.2412 +However, it does not provide asynchronous as well as synchronous variants
1.2413 +and does not allow entries to be read individually.
1.2414 +
1.2415 +@see RFs
1.2416 +*/
1.2417 + {
1.2418 +public:
1.2419 + EFSRV_IMPORT_C TInt Open(RFs& aFs,const TDesC& aMatchName,const TUidType& aUidType);
1.2420 + EFSRV_IMPORT_C TInt Open(RFs& aFs,const TDesC& aMatchName,TUint anAttMask);
1.2421 + EFSRV_IMPORT_C void Close();
1.2422 + EFSRV_IMPORT_C TInt Read(TEntryArray& anArray) const;
1.2423 + EFSRV_IMPORT_C void Read(TEntryArray& anArray,TRequestStatus& aStatus) const;
1.2424 + EFSRV_IMPORT_C TInt Read(TEntry& anEntry) const;
1.2425 + EFSRV_IMPORT_C void Read(TPckg<TEntry>& anEntry,TRequestStatus& aStatus) const;
1.2426 +
1.2427 +private:
1.2428 + // RSubSessionBase overrides
1.2429 + TInt SendReceive(TInt aFunction,const TIpcArgs& aArgs) const;
1.2430 +
1.2431 + friend class RDirPlugin;
1.2432 + };
1.2433 +
1.2434 +
1.2435 +class RFormat : public RSubSessionBase
1.2436 +/**
1.2437 +@publishedAll
1.2438 +@released
1.2439 +
1.2440 +Formats a device, one step at a time.
1.2441 +
1.2442 +RFormat must first be opened on a device before formatting each
1.2443 +track using Next().
1.2444 +
1.2445 +There is also an asynchronous version of Next() which, if encapsulated into
1.2446 +a suitable active object, can be used to implement a
1.2447 +user-interruptible formatting process.
1.2448 +*/
1.2449 + {
1.2450 +public:
1.2451 + IMPORT_C TInt Open(RFs& aFs,const TDesC& aName,TUint aFormatMode,TInt& aCount);
1.2452 + IMPORT_C TInt Open(RFs& aFs,const TDesC& aName,TUint aFormatMode,TInt& aCount,const TDesC8& anInfo);
1.2453 + IMPORT_C void Close();
1.2454 + IMPORT_C TInt Next(TInt& aStep);
1.2455 + IMPORT_C void Next(TPckgBuf<TInt>& aStep,TRequestStatus& aStatus);
1.2456 + };
1.2457 +
1.2458 +
1.2459 +
1.2460 +
1.2461 +class RRawDisk : public RSubSessionBase
1.2462 +/**
1.2463 +@publishedAll
1.2464 +@released
1.2465 +
1.2466 +Enables direct disk access.
1.2467 +
1.2468 +No other resources can access the disk while direct access to it is in effect.
1.2469 +
1.2470 +This class is not intended for user derivation.
1.2471 +*/
1.2472 + {
1.2473 +public:
1.2474 + IMPORT_C TInt Open(RFs& aFs,TInt aDrive);
1.2475 + IMPORT_C void Close();
1.2476 + IMPORT_C TInt Read(TInt64 aPos,TDes8& aDes);
1.2477 + IMPORT_C TInt Write(TInt64 aPos,TDesC8& aDes);
1.2478 +private:
1.2479 + TInt iDrive;
1.2480 + };
1.2481 +
1.2482 +
1.2483 +
1.2484 +
1.2485 +class CDirStack;
1.2486 +NONSHARABLE_CLASS(CDirScan) : public CBase
1.2487 +/**
1.2488 +@publishedAll
1.2489 +@released
1.2490 +
1.2491 +Scans a directory structure.
1.2492 +
1.2493 +The scan moves from directory to directory through the hierarchy, returning
1.2494 +a list of the entries contained in each. The order in which the directories
1.2495 +are scanned is determined by a sort key which is specified when setting up
1.2496 +the scan. The base directory to be scanned and the entry types of interest
1.2497 +must also be specified before performing the scan.
1.2498 +
1.2499 +This class is not intended for user derivation
1.2500 +*/
1.2501 + {
1.2502 +public:
1.2503 + /**
1.2504 + Defines the scan direction.
1.2505 + */
1.2506 + enum TScanDirection
1.2507 + {
1.2508 + /**
1.2509 + Scan upwards from the lowest level directory in the hierarchy to
1.2510 + the top level directory.
1.2511 + */
1.2512 + EScanUpTree,
1.2513 +
1.2514 + /**
1.2515 + Scan downwards from the top level directory in the hierarchy to
1.2516 + the bottom level directory.
1.2517 + */
1.2518 + EScanDownTree
1.2519 + };
1.2520 +public:
1.2521 + IMPORT_C static CDirScan* NewL(RFs& aFs);
1.2522 + IMPORT_C static CDirScan* NewLC(RFs& aFs);
1.2523 + IMPORT_C ~CDirScan();
1.2524 + IMPORT_C void SetScanDataL(const TDesC& aMatchName,TUint anEntryAttMask,TUint anEntrySortMask,TScanDirection aScanDir=EScanDownTree);
1.2525 + IMPORT_C void NextL(CDir*& aDirEntries);
1.2526 + IMPORT_C TPtrC AbbreviatedPath();
1.2527 + IMPORT_C TPtrC FullPath();
1.2528 +protected:
1.2529 + CDirScan(RFs& aFs);
1.2530 +private:
1.2531 + inline RFs& Fs();
1.2532 + void UpdateAbbreviatedPath();
1.2533 + void ScanUpTreeL(CDir*& aDirEntries);
1.2534 + void ScanDownTreeL(CDir*& aDirEntries);
1.2535 + void GetDirEntriesL(CDir*& aDirEntries);
1.2536 +private:
1.2537 + RFs* const iFs;
1.2538 + TParse iFullPath;
1.2539 + TPtrC iAbbreviatedPath;
1.2540 + TInt iAbbreviatedPathPos;
1.2541 + TUint iEntryAttMask;
1.2542 + TUint iEntrySortMask;
1.2543 + TBool iScanning;
1.2544 + TScanDirection iScanDir;
1.2545 + CDirStack* iStack;
1.2546 + };
1.2547 +
1.2548 +
1.2549 +
1.2550 +
1.2551 +enum TFileManError
1.2552 +/**
1.2553 +@publishedAll
1.2554 +@released
1.2555 +
1.2556 +A list of CFileMan error codes.
1.2557 +
1.2558 +@see CFileMan
1.2559 +*/
1.2560 + {
1.2561 + /**
1.2562 + No additional error information is available, either because
1.2563 + the latest CFileMan operation did not return an error, or if it did,
1.2564 + the error was not one for which additional information is available.
1.2565 + */
1.2566 + ENoExtraInformation,
1.2567 +
1.2568 +
1.2569 + /**
1.2570 + A leave occurred while setting up the initial scan.
1.2571 +
1.2572 + This indicates that the operation did not begin.
1.2573 +
1.2574 + @see CDirScan.
1.2575 + */
1.2576 + EInitializationFailed,
1.2577 +
1.2578 +
1.2579 + /**
1.2580 + A leave occurred while scanning the next directory in the course of a file
1.2581 + management function.
1.2582 +
1.2583 + This indicates that the operation did begin.
1.2584 +
1.2585 + @see CDirScan.
1.2586 + */
1.2587 + EScanNextDirectoryFailed,
1.2588 +
1.2589 +
1.2590 + /**
1.2591 + Error occurred when attempting to open the source file for a file copy
1.2592 + or move.
1.2593 + */
1.2594 + ESrcOpenFailed,
1.2595 +
1.2596 +
1.2597 + /**
1.2598 + Error occurred while attempting to create, or, if overwriting is in effect,
1.2599 + replace the target file for a file copy or move.
1.2600 + */
1.2601 + ETrgOpenFailed,
1.2602 +
1.2603 +
1.2604 + /**
1.2605 + The operation completed without processing any files because no matching
1.2606 + files were found.
1.2607 + */
1.2608 + ENoFilesProcessed
1.2609 + };
1.2610 +
1.2611 +
1.2612 +
1.2613 +
1.2614 +class MFileManObserver
1.2615 +/**
1.2616 +@publishedAll
1.2617 +@released
1.2618 +
1.2619 +Provides notification of the progress of synchronous or asynchronous
1.2620 +file management operations.
1.2621 +
1.2622 +It should be inherited by classes which implement this protocol.
1.2623 +
1.2624 +The enquiry functions provided by CFileBase and CFileMan may be used by
1.2625 +the observer to display information about the progress of the operation
1.2626 +such as error messages, the names of the target and destination files,
1.2627 +and the number of bytes transferred during a copy operation.
1.2628 +Notification may take place before or after an entry has been processed,
1.2629 +or during a file copy or move.
1.2630 +Each notification function returns a value which can be used to enable
1.2631 +the user to control the progress of the operation, for example to cancel
1.2632 +a long-running multiple file copy.
1.2633 +To use this class, pass a pointer to an instance of the class to
1.2634 +the CFileMan constructor, or use SetObserver(), defined in CFileBase.
1.2635 +*/
1.2636 + {
1.2637 +public:
1.2638 + /**
1.2639 + Control for the current CFileMan operation.
1.2640 + */
1.2641 + enum TControl
1.2642 + {
1.2643 + /**
1.2644 + Proceed with the current or the next entry.
1.2645 + */
1.2646 + EContinue,
1.2647 +
1.2648 +
1.2649 + /**
1.2650 + Retry processing the previous entry.
1.2651 + */
1.2652 + ERetry,
1.2653 +
1.2654 +
1.2655 + /**
1.2656 + Abort operation, causes function to return KErrCancel.
1.2657 + */
1.2658 + EAbort,
1.2659 +
1.2660 +
1.2661 + /**
1.2662 + Cancel processing the current entry.
1.2663 + */
1.2664 + ECancel
1.2665 + };
1.2666 +public:
1.2667 + IMPORT_C virtual TControl NotifyFileManStarted();
1.2668 + IMPORT_C virtual TControl NotifyFileManOperation();
1.2669 + IMPORT_C virtual TControl NotifyFileManEnded();
1.2670 + };
1.2671 +
1.2672 +
1.2673 +
1.2674 +
1.2675 +class CFileBase : public CBase
1.2676 +/**
1.2677 +@publishedAll
1.2678 +@released
1.2679 +
1.2680 +Abstract base class for file management.
1.2681 +
1.2682 +It provides functions to set an observer for the derived class
1.2683 +CFileMan, and to get information about the entry being processed.
1.2684 +
1.2685 +@see CFileMan
1.2686 +*/
1.2687 + {
1.2688 +public:
1.2689 + IMPORT_C void SetObserver(MFileManObserver* anObserver);
1.2690 +public:
1.2691 + IMPORT_C const TEntry& CurrentEntry();
1.2692 + IMPORT_C TPtrC AbbreviatedPath();
1.2693 + IMPORT_C TPtrC FullPath();
1.2694 + IMPORT_C TInt GetLastError();
1.2695 + IMPORT_C TFileManError GetMoreInfoAboutError();
1.2696 +protected:
1.2697 + IMPORT_C CFileBase(RFs& anFs);
1.2698 + IMPORT_C void ConstructL();
1.2699 + IMPORT_C ~CFileBase();
1.2700 + IMPORT_C void RunL();
1.2701 + IMPORT_C void RunInSeparateThreadL(TThreadFunction aThreadFunction);
1.2702 +// virtual
1.2703 + /**
1.2704 + Called from RunL to perform tidy up after an operation.
1.2705 +
1.2706 + @see CFileMan
1.2707 + @see CFileBase::RunL
1.2708 + */
1.2709 + virtual void CompleteOperationL() {};
1.2710 +
1.2711 +//pure virtual
1.2712 + /**
1.2713 + Called from RunL to perform the requested operation.
1.2714 +
1.2715 + @see CFileMan
1.2716 + @see CFileBase::RunL
1.2717 + */
1.2718 + virtual void DoOperationL() = 0;
1.2719 +protected:
1.2720 + RFs iFs;
1.2721 + RFs iFsOld;
1.2722 + RThread iFManThread;
1.2723 + RSemaphore iSynchronizer;
1.2724 + CDirScan* iScanner;
1.2725 + CDir* iDirList;
1.2726 + TInt iCurrentEntry;
1.2727 + TUint iMatchEntry;
1.2728 + TUint iSwitches;
1.2729 + TParse iSrcFile;
1.2730 + MFileManObserver* iObserver;
1.2731 + TInt iLastError;
1.2732 + TFileManError iErrorInfo;
1.2733 + TRequestStatus* iStatus;
1.2734 + HBufC* iSessionPath;
1.2735 + TInt iNumberOfFilesProcessed;
1.2736 +
1.2737 +
1.2738 +
1.2739 +
1.2740 +friend void DoFManBaseOperationL(TAny* aPtr);
1.2741 +friend TInt FManBaseThreadFunction(TAny* aPtr);
1.2742 + };
1.2743 +
1.2744 +
1.2745 +
1.2746 +
1.2747 +NONSHARABLE_CLASS(CFileMan) : public CFileBase
1.2748 +/**
1.2749 +@publishedAll
1.2750 +@released
1.2751 +
1.2752 +Offers file management services which accept the use of wildcards;
1.2753 +synchronous and asynchronous.
1.2754 +
1.2755 +It also provides enquiry functions, which, like those provided by
1.2756 +the base class CFileBase, may be used by an observer class object
1.2757 +to provide the user with information about the progress of the operation.
1.2758 +
1.2759 +All of the file management functions provided by this class accept the use of
1.2760 +wildcards, and may operate either synchronously or asynchronously.
1.2761 +When CFileMan is operating asynchronously, the operation takes place in
1.2762 +a separate thread from the calling code.
1.2763 +
1.2764 +A file notification observer (an instance of a class deriving
1.2765 +from MFileManObserver) may optionally be used by CFileMan when operating
1.2766 +synchronously or asynchronously. If provided, the appropriate notification
1.2767 +function is called before or after each entry has been processed,
1.2768 +or during a file copy or move.
1.2769 +This notification can be used to provide information about the state of
1.2770 +the operation, such as the number of bytes transferred during a
1.2771 +large-scale file copy. It can also be used to allow the user to cancel,
1.2772 +retry or continue processing an entry, or to abort the whole operation.
1.2773 +If such notification is required, specify an object deriving from
1.2774 +MFileManObserver class in the constructor, or call SetObserver(),
1.2775 +defined in the base class, CFileBase.
1.2776 +
1.2777 +All of the file manipulation functions except Rename() may operate recursively,
1.2778 +and all can operate non-recursively. When operating recursively,
1.2779 +these functions will act on all matching files located throughout
1.2780 +the source directory’s hierarchy. When operating non-recursively,
1.2781 +these functions act upon files contained in the single top level source
1.2782 +directory only. Recursion is set or unset using the switch parameter to
1.2783 +these functions.
1.2784 +
1.2785 +This class is not intended for user derivation.
1.2786 +
1.2787 +Note:
1.2788 +
1.2789 +To support wildcard, CFileMan needs to store the entire directory entry
1.2790 +information. Therefore, in a extreme condition, if a directory contains
1.2791 +a huge number of files (e.g. more than 15000 files with 10 characters' long file
1.2792 +names), user may encounter KErrNoMemory errors. Developers who have a need to handle
1.2793 +this rare case should increase the heap size limitation of their applications.
1.2794 +
1.2795 +For more information about heap size configuration, please refer following
1.2796 +section in Symbian Developer Library:
1.2797 +Symbian OS build guide >> Build Tools Reference >> MMP file syntax >> epocheapsize
1.2798 +
1.2799 +@see MFileManObserver
1.2800 +*/
1.2801 + {
1.2802 +public:
1.2803 + /**
1.2804 + An enumeration that identifies CFileMan tasks. This enumeration is used
1.2805 + by CurrentAction() to identify which task currently being carried out.
1.2806 +
1.2807 + @see CFileMan::CurrentAction
1.2808 + */
1.2809 + enum TAction
1.2810 + {
1.2811 + /**
1.2812 + Inactive
1.2813 + */
1.2814 + ENone,
1.2815 +
1.2816 +
1.2817 + /**
1.2818 + Setting attributes
1.2819 + */
1.2820 + EAttribs,
1.2821 +
1.2822 +
1.2823 + /**
1.2824 + Copying files
1.2825 + */
1.2826 + ECopy,
1.2827 +
1.2828 +
1.2829 + /**
1.2830 + Deleting files
1.2831 + */
1.2832 + EDelete,
1.2833 +
1.2834 +
1.2835 + /**
1.2836 + Moving files
1.2837 + */
1.2838 + EMove,
1.2839 +
1.2840 +
1.2841 + /**
1.2842 + Renaming files
1.2843 + */
1.2844 + ERename,
1.2845 +
1.2846 +
1.2847 + /**
1.2848 + Deleting a directory and all contents
1.2849 + */
1.2850 + ERmDir,
1.2851 +
1.2852 +
1.2853 + /**
1.2854 + Renaming component to VFAT short name (guaranteed to be unique)
1.2855 + */
1.2856 + ERenameInvalidEntry,
1.2857 +
1.2858 + /**
1.2859 + Copying file from open file handle
1.2860 + */
1.2861 + ECopyFromHandle,
1.2862 + };
1.2863 +
1.2864 +
1.2865 + /**
1.2866 + Overwriting and recursion switch.
1.2867 +
1.2868 + Used in CFileMan functions to set whether operations are applied to
1.2869 + the specified directory and all directories below it, or
1.2870 + the specified directory only.
1.2871 + */
1.2872 + enum TSwitch
1.2873 + {
1.2874 + /**
1.2875 + Any files in the destination directory that have the same name as
1.2876 + the source files in a rename, move or copy operation, will
1.2877 + be overwritten.
1.2878 + */
1.2879 + EOverWrite=1,
1.2880 +
1.2881 +
1.2882 + /**
1.2883 + Recursive operation.
1.2884 + */
1.2885 + ERecurse=2
1.2886 + };
1.2887 +public:
1.2888 + IMPORT_C static CFileMan* NewL(RFs& aFs);
1.2889 + IMPORT_C static CFileMan* NewL(RFs& aFs,MFileManObserver* anObserver);
1.2890 + ~CFileMan();
1.2891 + IMPORT_C TAction CurrentAction();
1.2892 + IMPORT_C void GetCurrentTarget(TFileName& aFile);
1.2893 + IMPORT_C void GetCurrentSource(TFileName& aFile);
1.2894 + IMPORT_C TInt BytesTransferredByCopyStep();
1.2895 +public:
1.2896 + IMPORT_C TInt Attribs(const TDesC& aName,TUint aSetMask,TUint aClearMask,const TTime& aTime,TUint aSwitch=0);
1.2897 + IMPORT_C TInt Attribs(const TDesC& aName,TUint aSetMask,TUint aClearMask,const TTime& aTime,TUint aSwitch,TRequestStatus& aStatus);
1.2898 + IMPORT_C TInt Copy(const TDesC& anOld,const TDesC& aNew,TUint aSwitch=EOverWrite);
1.2899 + IMPORT_C TInt Copy(const TDesC& anOld,const TDesC& aNew,TUint aSwitch,TRequestStatus& aStatus);
1.2900 + IMPORT_C TInt Delete(const TDesC& aName,TUint aSwitch=0);
1.2901 + IMPORT_C TInt Delete(const TDesC& aName,TUint aSwitch,TRequestStatus& aStatus);
1.2902 + IMPORT_C TInt Move(const TDesC& anOld,const TDesC& aNew,TUint aSwitch=EOverWrite);
1.2903 + IMPORT_C TInt Move(const TDesC& anOld,const TDesC& aNew,TUint aSwitch,TRequestStatus& aStatus);
1.2904 + IMPORT_C TInt Rename(const TDesC& anOld,const TDesC& aNew,TUint aSwitch=EOverWrite);
1.2905 + IMPORT_C TInt Rename(const TDesC& anOld,const TDesC& aNew,TUint aSwitch,TRequestStatus& aStatus);
1.2906 + IMPORT_C TInt RmDir(const TDesC& aDirName);
1.2907 + IMPORT_C TInt RmDir(const TDesC& aDirName,TRequestStatus& aStatus);
1.2908 + IMPORT_C TInt Copy(const RFile& anOld,const TDesC& aNew,TUint aSwitches=EOverWrite);
1.2909 + IMPORT_C TInt Copy(const RFile& anOld,const TDesC& aNew,TUint aSwitches,TRequestStatus& aStatus);
1.2910 +protected:
1.2911 + CFileMan(RFs& aFs);
1.2912 + TInt RenameInvalidEntry(const TDesC& anOld,const TDesC& aNew,TUint aSwitch=EOverWrite);
1.2913 +private:
1.2914 + /**
1.2915 + This is an internal enumeration for CFileMan implementation.
1.2916 + THis enumeration is mapped into TAction when user wants to identify the current
1.2917 + task of CFileMan by CurrentAction().
1.2918 +
1.2919 + @see CFileMan::TAction
1.2920 + @see CFileMan::CurrentAction
1.2921 + */
1.2922 + enum TInternalAction
1.2923 + {
1.2924 + /**
1.2925 + Internal indicator for None operation.
1.2926 + This is mapped to CFileMan::ENone.
1.2927 + */
1.2928 + EInternalNone,
1.2929 +
1.2930 + /**
1.2931 + Internal indicator for Attribs() operation.
1.2932 + This is mapped to CFileMan::EAttribs.
1.2933 + */
1.2934 + EInternalAttribs,
1.2935 +
1.2936 + /**
1.2937 + Internal indicator for Copy() operation.
1.2938 + This is mapped to CFileMan::ECopy.
1.2939 + */
1.2940 + EInternalCopy,
1.2941 +
1.2942 + /**
1.2943 + Internal indicator for Delete() operation.
1.2944 + This is mapped to CFileMan::EDelete.
1.2945 + */
1.2946 + EInternalDelete,
1.2947 +
1.2948 + /**
1.2949 + Internal indicator for Move() operation on different drives.
1.2950 + This is mapped to CFileMan::Move.
1.2951 + */
1.2952 + EInternalCopyForMove,
1.2953 +
1.2954 + /**
1.2955 + Internal indicator for Move() operation on the same drive.
1.2956 + This is mapped to CFileMan::Rename.
1.2957 + Note for compatibility reasons, it is not mapped to CFileMan::Move.
1.2958 + */
1.2959 + EInternalRenameForMove,
1.2960 +
1.2961 + /**
1.2962 + Internal indicator for Rename() operation.
1.2963 + This is mapped to CFileMan::ERename.
1.2964 + */
1.2965 + EInternalRename,
1.2966 +
1.2967 + /**
1.2968 + Internal indicator for RmDir() operation.
1.2969 + This is mapped to CFileMan::ERmDir.
1.2970 + */
1.2971 + EInternalRmDir,
1.2972 +
1.2973 + /**
1.2974 + Internal indicator for RenameInvalidEntry() operation.
1.2975 + This is mapped to CFileMan::ERenameInvalidEntry.
1.2976 + */
1.2977 + EInternalRenameInvalidEntry,
1.2978 +
1.2979 + /**
1.2980 + Internal indicator for CopyFromHandle() operation.
1.2981 + This is mapped to CFileMan::ECopyFromHandle.
1.2982 + */
1.2983 + EInternalCopyFromHandle,
1.2984 + };
1.2985 +
1.2986 + void CompleteOperationL();
1.2987 + void DoOperationL();
1.2988 + void CheckForDirectory();
1.2989 + void SetFlags(TBool aOverWrite,TBool aRecurse,TBool aScanDirection,TBool aMoveRename);
1.2990 + void GetSrcAndTrg(TParse& aSrcName,TFileName& aTrgName);
1.2991 + void DoSynchronize(TInt aRetVal);
1.2992 + TInt CheckRenameAllowed(const TDesC& aSrcName,const TDesC& aTrgName);
1.2993 + TInt SetupMoveOnSameDrive(TUint aSwitches, TBool& aComplete);
1.2994 + TInt SetupMoveAcrossDrives(TUint aSwitches);
1.2995 + TInt SetupTargetDirectory(TBool aOverWrite, TBool& aComplete);
1.2996 + TBool SrcTrgDrivesIdentical();
1.2997 + TInt SetupDirectoryForMove(TBool& aSrcIsDir);
1.2998 +private:
1.2999 + void DoAttribsL();
1.3000 + void DoCopyOrMoveL();
1.3001 + void DoDeleteL();
1.3002 + void DoRenameL();
1.3003 + void DoRmDirL();
1.3004 + void DoCopyFromHandleL();
1.3005 +#ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.3006 + TInt DoCopy(const RFile& aSrcFile, RFile& aDstFile, TInt& aRet);
1.3007 +#else
1.3008 + TInt DoCopy(const RFile64& aSrcFile, RFile64& aDstFile, TInt& aRet);
1.3009 +#endif
1.3010 +private:
1.3011 + TParse iTrgFile;
1.3012 + TInternalAction iAction;
1.3013 + TUint iSetMask;
1.3014 + TUint iClearMask;
1.3015 + TTime iTime;
1.3016 + TInt iBytesTransferred;
1.3017 +#ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.3018 + RFile iSrcFileHandle;
1.3019 +#else
1.3020 + RFile64 iSrcFileHandle;
1.3021 +#endif
1.3022 + TBool iMovingContents;
1.3023 + TEntry iTmpEntry;
1.3024 + TParse iTmpParse;
1.3025 + TFileName iTmpName1;
1.3026 + TFileName iTmpName2;
1.3027 +
1.3028 +friend void RenameInvalidEntryL(RFs& aFs,TParse& aSrcFile);
1.3029 + };
1.3030 +
1.3031 +
1.3032 +
1.3033 +
1.3034 +class TFindFile
1.3035 +/**
1.3036 +@publishedAll
1.3037 +@released
1.3038 +
1.3039 +Searches for files and directories.
1.3040 +
1.3041 +Each function has a variant which searches for multiple files/directories,
1.3042 +using one or more wildcard characters in the filename.
1.3043 +If an initial search is successful, further searches can be carried out
1.3044 +using Find() or FindWild().
1.3045 +You can also retrieve the fully qualified file specification,
1.3046 +and manipulate and interrogate it using the TParse class (or related classes).
1.3047 +
1.3048 +Note that when specifying the path of a directory to search, the path should
1.3049 +always end with a backslash character.When trailing backslash is not present
1.3050 +then it is considered as file. And path will be taken till last backslash.
1.3051 +The client must have appropriate capabilities for the directory to be searched.
1.3052 +For example without ALL FILES Capability, it is not possible to successfully
1.3053 +find any files under \sys\bin directory.
1.3054 +
1.3055 +By default if the file is not found in the current drive the rest of the drives,
1.3056 +excluding the remote ones, will be searched. Using function SetFindMask it is
1.3057 +possible to specify a combination of drive attributes(aMask) that the drives to
1.3058 +be searched must match.
1.3059 +
1.3060 +*/
1.3061 + {
1.3062 +public:
1.3063 + IMPORT_C TFindFile(RFs& aFs);
1.3064 + IMPORT_C TInt FindByPath(const TDesC& aFileName,const TDesC* aPathList);
1.3065 + IMPORT_C TInt FindByDir(const TDesC& aFileName,const TDesC& aDirPath);
1.3066 + IMPORT_C TInt Find();
1.3067 + IMPORT_C TInt FindWildByPath(const TDesC& aFileName,const TDesC* aPathList,CDir*& aDirList);
1.3068 + IMPORT_C TInt FindWildByDir(const TDesC& aFileName,const TDesC& aDirPath,CDir*& aDir);
1.3069 + IMPORT_C TInt FindWild(CDir*& aDirList);
1.3070 + IMPORT_C TInt SetFindMask(TUint aMask);
1.3071 + inline const TDesC& File() const;
1.3072 +private:
1.3073 + TInt DoFind();
1.3074 + TInt DoFindByPath(const TDesC& aFileName,const TDesC* aPathList);
1.3075 + TInt DoFindByDir(const TDesC& aFileName,const TDesC& aDir);
1.3076 + TInt DoFindInDir();
1.3077 + TInt DoFindNextInPath();
1.3078 + TInt DoFindNextInDriveList();
1.3079 +private:
1.3080 + RFs* const iFs;
1.3081 + TParse iFile;
1.3082 + TInt iPathPos;
1.3083 + TInt iCurrentDrive;
1.3084 + TInt iMode;
1.3085 + const TDesC* iPath;
1.3086 + TDriveList iDrvList;
1.3087 + CDir** iDir;
1.3088 + TUint32 iMatchMask;
1.3089 + };
1.3090 +
1.3091 +
1.3092 +
1.3093 +
1.3094 +/**
1.3095 +@publishedAll
1.3096 +@released
1.3097 +
1.3098 +Contains a list of entries for the files which were opened in
1.3099 +a file server session.
1.3100 +
1.3101 +@see CDir
1.3102 +*/
1.3103 +typedef CDir CFileList;
1.3104 +
1.3105 +
1.3106 +
1.3107 +
1.3108 +class TOpenFileScan
1.3109 +/**
1.3110 +@publishedAll
1.3111 +@released
1.3112 +
1.3113 +Scans open files to get a list of the entries for all files which are currently
1.3114 +open in a particular file server session.
1.3115 +
1.3116 +NextL() creates a list of the files opened by the session.
1.3117 +The ID of the thread which opened the files listed may be obtained by calling ThreadId().
1.3118 +If multiple sessions are in use, repeatedly calling NextL() will return a list
1.3119 +of open files in each session.
1.3120 +*/
1.3121 + {
1.3122 +public:
1.3123 + IMPORT_C TOpenFileScan(RFs& aFs);
1.3124 + IMPORT_C void NextL(CFileList*& aFileList);
1.3125 + IMPORT_C TThreadId ThreadId() const;
1.3126 +private:
1.3127 + RFs* iFs;
1.3128 + TThreadId iThreadId;
1.3129 + TInt iScanPos;
1.3130 + TInt iEntryListPos;
1.3131 + };
1.3132 +
1.3133 +
1.3134 +
1.3135 +
1.3136 +class TFileText
1.3137 +/**
1.3138 +@publishedAll
1.3139 +@released
1.3140 +
1.3141 +Reads and writes single lines of text to or from a Unicode file.
1.3142 +*/
1.3143 + {
1.3144 +private:
1.3145 + enum TFileState
1.3146 + {
1.3147 + EStartOfFile,
1.3148 + ENormal,
1.3149 + EReverse
1.3150 + };
1.3151 +public:
1.3152 + IMPORT_C TFileText();
1.3153 + IMPORT_C void Set(RFile& aFile);
1.3154 + IMPORT_C TInt Read(TDes& aDes);
1.3155 + IMPORT_C TInt Write(const TDesC& aDes);
1.3156 + IMPORT_C TInt Seek(TSeek aMode);
1.3157 +private:
1.3158 + void NextRecord();
1.3159 + TInt CheckForTerminator(TBool& anAnswer);
1.3160 + TInt FillBuffer();
1.3161 +private:
1.3162 + const TText* iNext;
1.3163 + const TText* iEnd;
1.3164 + TFileState iState;
1.3165 +#ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.3166 + RFile iFile;
1.3167 +#else
1.3168 + RFile64 iFile;
1.3169 +#endif
1.3170 + TBuf8<0x100> iReadBuf;
1.3171 + };
1.3172 +
1.3173 +
1.3174 +
1.3175 +
1.3176 +/**
1.3177 +@publishedAll
1.3178 +@released
1.3179 +*/
1.3180 +IMPORT_C TBool FileNamesIdentical(const TDesC& aFileName1,const TDesC& aFileName2);
1.3181 +
1.3182 +/**
1.3183 +@publishedAll
1.3184 +@released
1.3185 +
1.3186 +The UID of the File Server process
1.3187 +*/
1.3188 +const TInt KFileServerUidValue = 0x100039e3;
1.3189 +
1.3190 +
1.3191 +#include <f32file.inl>
1.3192 +#ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
1.3193 +#include <f32file64.inl>
1.3194 +#endif
1.3195 +
1.3196 +#ifdef SYMBIAN_F32_ENHANCED_CHANGE_NOTIFICATION
1.3197 +#include <f32notification.h>
1.3198 +#endif
1.3199 +
1.3200 +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
1.3201 +#include <f32file_private.h>
1.3202 +#endif
1.3203 +
1.3204 +#endif