Skip to content

Commit 89eb3c0

Browse files
author
Colin Robertson
committed
Remove more "please" and Acrolinx stuff
1 parent 8e1aa64 commit 89eb3c0

File tree

6 files changed

+56
-56
lines changed

6 files changed

+56
-56
lines changed

docs/mfc/reference/cfile-class.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ It directly provides unbuffered, binary disk input/output services, and it indir
7676

7777
The hierarchical relationship between this class and its derived classes allows your program to operate on all file objects through the polymorphic `CFile` interface. A memory file, for example, behaves like a disk file.
7878

79-
Use `CFile` and its derived classes for general-purpose disk I/O. Use `ofstream` or other Microsoft iostream classes for formatted text sent to a disk file.
79+
Use `CFile` and its derived classes for general-purpose disk I/O. Use `ofstream` or other Microsoft `iostream` classes for formatted text sent to a disk file.
8080

8181
Normally, a disk file is opened automatically on `CFile` construction and closed on destruction. Static member functions permit you to interrogate a file's status without opening the file.
8282

@@ -102,9 +102,9 @@ virtual void Abort();
102102

103103
### Remarks
104104

105-
If you have not closed the file before destroying the object, the destructor closes it for you.
105+
If you haven't closed the file before destroying the object, the destructor closes it for you.
106106

107-
When handling exceptions, `CFile::Abort` differs from `CFile::Close` in two important ways. First, the `Abort` function will not throw an exception on failures because failures are ignored by `Abort`. Second, `Abort` will not **ASSERT** if the file has not been opened or was closed previously.
107+
When handling exceptions, `CFile::Abort` differs from `CFile::Close` in two important ways. First, the `Abort` function won't throw an exception on failures, because failures are ignored by `Abort`. Second, `Abort` won't **ASSERT** if the file hasn't been opened, or was closed previously.
108108

109109
If you used **new** to allocate the `CFile` object on the heap, then you must delete it after closing the file. `Abort` sets `m_hFile` to `CFile::hFileNull`.
110110

@@ -178,31 +178,31 @@ Choose the first, or both, of the following file creation mode options. The defa
178178

179179
|Value|Description|
180180
|-----------|-----------------|
181-
|`CFile::modeCreate`|Creates a new file if no file exists. If the file already exists, it is overwritten and initially set to zero length.|
182-
|`CFile::modeNoTruncate`|Creates a new file if no file exists; otherwise, if the file already exists, it is attached to the `CFile` object.|
181+
|`CFile::modeCreate`|Creates a new file if no file exists. If the file already exists, it's overwritten and initially set to zero length.|
182+
|`CFile::modeNoTruncate`|Creates a new file if no file exists; otherwise, if the file already exists, it's attached to the `CFile` object.|
183183

184-
Choose the following file caching options as described. By default, the system uses a general purpose caching scheme that is not available as an option.
184+
Choose the following file caching options as described. By default, the system uses a general-purpose caching scheme that isn't available as an option.
185185

186186
|Value|Description|
187187
|-----------|-----------------|
188-
|`CFile::osNoBuffer`|The system does not use an intermediate cache for the file. This option cancels the following 2 options.|
189-
|`CFile::osRandomAccess`|The file cache is optimized for random access. Do not use this option and the sequential scan option.|
190-
|`CFile::osSequentialScan`|The file cache is optimized for sequential access. Do not use this option and the random access option.|
191-
|`CFile::osWriteThrough`|Write operations are performed without delay.|
188+
|`CFile::osNoBuffer`|The system doesn't use an intermediate cache for the file. This option cancels the following 2 options.|
189+
|`CFile::osRandomAccess`|The file cache is optimized for random access. Don't use both this option and the sequential scan option.|
190+
|`CFile::osSequentialScan`|The file cache is optimized for sequential access. Don't use both this option and the random access option.|
191+
|`CFile::osWriteThrough`|Write operations are done without delay.|
192192

193193
Choose the following security option to prevent the file handle from being inherited. By default, any new child processes can use the file handle.
194194

195195
|Value|Description|
196196
|-----------|-----------------|
197197
|`CFile::modeNoInherit`|Prevents any child processes from using the file handle.|
198198

199-
The default constructor initializes members but does not attach a file to the `CFile` object. After using this constructor, use the [CFile::Open](#open) method to open a file and attach it to the `CFile` object.
199+
The default constructor initializes members but doesn't attach a file to the `CFile` object. After using this constructor, use the [CFile::Open](#open) method to open a file and attach it to the `CFile` object.
200200

201201
The constructor with one parameter initializes members and attaches an existing file to the `CFile` object.
202202

203203
The constructor with two parameters initializes members and tries to open the specified file. If this constructor successfully opens the specified file, the file is attached to the `CFile` object; otherwise, this constructor throws a pointer to a `CInvalidArgException` object. For more information about how to handle exceptions, see [Exceptions](../../mfc/exception-handling-in-mfc.md).
204204

205-
If a `CFile` object successfully opens a specified file, it will close this file automatically when the `CFile` object is destroyed; otherwise, you must explicitly close the file after it is no longer attached to the `CFile` object.
205+
If a `CFile` object successfully opens a specified file, it will close this file automatically when the `CFile` object is destroyed; otherwise, you must explicitly close the file after it's no longer attached to the `CFile` object.
206206

207207
### Example
208208

@@ -220,7 +220,7 @@ virtual void Close();
220220

221221
### Remarks
222222

223-
If you have not closed the file before destroying the object, the destructor closes it for you.
223+
If you haven't closed the file before destroying the object, the destructor closes it for you.
224224

225225
If you used **new** to allocate the `CFile` object on the heap, then you must delete it after closing the file. `Close` sets `m_hFile` to `CFile::hFileNull`.
226226

@@ -242,7 +242,7 @@ A pointer to a duplicate `CFile` object.
242242

243243
### Remarks
244244

245-
This is equivalent to the C run-time function `_dup`.
245+
This function is equivalent to the C run-time function `_dup`.
246246

247247
## <a name="flush"></a> CFile::Flush
248248

@@ -254,7 +254,7 @@ virtual void Flush();
254254

255255
### Remarks
256256

257-
The use of `Flush` does not guarantee flushing of `CArchive` buffers. If you are using an archive, call [CArchive::Flush](../../mfc/reference/carchive-class.md#flush) first.
257+
The use of `Flush` doesn't guarantee flushing of `CArchive` buffers. If you're using an archive, call [CArchive::Flush](../../mfc/reference/carchive-class.md#flush) first.
258258

259259
### Example
260260

@@ -320,7 +320,7 @@ The title of the underlying file.
320320

321321
### Remarks
322322

323-
This method calls [GetFileTitle](/windows/desktop/api/commdlg/nf-commdlg-getfiletitlea) to retrieve the title of the file. If successful, the method returns the string that the system would use to display the file name to the user. Otherwise, the method calls [PathFindFileName](/windows/desktop/api/shlwapi/nf-shlwapi-pathfindfilenamea) to retrieve the file name (including the file extension) of the underlying file. Therefore, the file extension will not always be included in the returned file title string. For more information, see [GetFileTitle](/windows/desktop/api/commdlg/nf-commdlg-getfiletitlea) and [PathFindFileName](/windows/desktop/api/shlwapi/nf-shlwapi-pathfindfilenamea) in the Windows SDK.
323+
This method calls [GetFileTitle](/windows/desktop/api/commdlg/nf-commdlg-getfiletitlea) to retrieve the title of the file. If successful, the method returns the string that the system would use to display the file name to the user. Otherwise, the method calls [PathFindFileName](/windows/desktop/api/shlwapi/nf-shlwapi-pathfindfilenamea) to retrieve the file name (including the file extension) of the underlying file. That means the file extension isn't always included in the returned file title string. For more information, see [GetFileTitle](/windows/desktop/api/commdlg/nf-commdlg-getfiletitlea) and [PathFindFileName](/windows/desktop/api/shlwapi/nf-shlwapi-pathfindfilenamea) in the Windows SDK.
324324

325325
To return the entire path of the file, including the name, call [GetFilePath](#getfilepath). To return just the name of the file, call [GetFileName](#getfilename).
326326

@@ -346,7 +346,7 @@ The length of the file.
346346

347347
## <a name="getposition"></a> CFile::GetPosition
348348

349-
Obtains the current value of the file pointer, which can be used in subsequent calls to `Seek`.
349+
Obtains the current value of the file pointer, which can be used in later calls to `Seek`.
350350

351351
```
352352
virtual ULONGLONG GetPosition() const;
@@ -402,7 +402,7 @@ TRUE if the status information for the specified file is successfully obtained;
402402

403403
### Remarks
404404

405-
The non-static version of `GetStatus` retrieves status information of the open file associated with the given `CFile` object. The static version of `GetStatus` obtains the file status from a given file path without actually opening the file. This is useful for testing the existence and access rights of a file.
405+
The non-static version of `GetStatus` retrieves status information of the open file associated with the given `CFile` object. The static version of `GetStatus` obtains the file status from a given file path without actually opening the file. This version is useful for testing the existence and access rights of a file.
406406

407407
The `m_attribute` member of the `CFileStatus` structure refers to the file attribute set. The `CFile` class provides the **Attribute** enumeration type so file attributes can be specified symbolically:
408408

@@ -460,10 +460,10 @@ The number of bytes in the range to lock.
460460

461461
Locking bytes in a file prevents access to those bytes by other processes. You can lock more than one region of a file, but no overlapping regions are allowed.
462462

463-
When you unlock the region, using the `UnlockRange` member function, the byte range must correspond exactly to the region that was previously locked. The `LockRange` function does not merge adjacent regions; if two locked regions are adjacent, you must unlock each region separately.
463+
When you unlock the region using the `UnlockRange` member function, the byte range must correspond exactly to the region that was previously locked. The `LockRange` function doesn't merge adjacent regions. If two locked regions are adjacent, you must unlock each region separately.
464464

465465
> [!NOTE]
466-
> This function is not available for the `CMemFile`-derived class.
466+
> This function isn't available for the `CMemFile`-derived class.
467467
468468
### Example
469469

@@ -479,9 +479,9 @@ HANDLE m_hFile;
479479

480480
### Remarks
481481

482-
`m_hFile` is a public variable of type UINT. It contains `CFile::hFileNull` (an operating-system-independent empty file indicator) if the handle has not been assigned.
482+
`m_hFile` is a public variable of type UINT. It contains `CFile::hFileNull`, an operating-system-independent empty file indicator, if the handle hasn't been assigned.
483483

484-
Use of `m_hFile` is not recommended because the member's meaning depends on the derived class. `m_hFile` is made a public member for convenience in supporting nonpolymorphic use of the class.
484+
Use of `m_hFile` isn't recommended, because the member's meaning depends on the derived class. `m_hFile` is made a public member for convenience in supporting nonpolymorphic use of the class.
485485

486486
## <a name="m_ptm"></a> CFile::m_pTM
487487

@@ -513,7 +513,7 @@ virtual BOOL Open(
513513
### Parameters
514514

515515
*lpszFileName*<br/>
516-
A string that is the path to the desired file. The path can be relative, absolute, or a network name (UNC).
516+
A string that contains the path to the desired file. The path can be relative, absolute, or a network name (UNC).
517517

518518
*nOpenFlags*<br/>
519519
A UINT that defines the file's sharing and access mode. It specifies the action to take when opening the file. You can combine options by using the bitwise-OR ( **&#124;** ) operator. One access permission and one share option are required; the `modeCreate` and `modeNoInherit` modes are optional. See the [CFile](#cfile) constructor for a list of mode options.
@@ -530,9 +530,9 @@ Nonzero if the open was successful; otherwise 0. The *pError* parameter is meani
530530

531531
### Remarks
532532

533-
The two functions form a "safe" method for opening a file where a failure is a normal, expected condition.
533+
The two `Open` functions are "safe" methods for opening a file, where a failure is a normal, expected condition.
534534

535-
While the `CFile` constructor will throw an exception in an error condition, `Open` will return FALSE for error conditions. `Open` can still initialize a [CFileException](../../mfc/reference/cfileexception-class.md) object to describe the error, however. If you don't supply the *pError* parameter, or if you pass NULL for *pError*, `Open` will return FALSE and not throw a `CFileException`. If you pass a pointer to an existing `CFileException`, and `Open` encounters an error, the function will fill it with information describing that error. In neither case will `Open` throw an exception.
535+
While the `CFile` constructor throws an exception in an error condition, `Open` returns FALSE for error conditions. `Open` can still initialize a [CFileException](../../mfc/reference/cfileexception-class.md) object to describe the error, however. If you don't supply the *pError* parameter, or if you pass NULL for *pError*, `Open` returns FALSE and doesn't throw a `CFileException`. If you pass a pointer to an existing `CFileException`, and `Open` encounters an error, the function fills it with information describing that error. `Open` doesn't throw an exception in either case.
536536

537537
The following table describes the possible results of `Open`.
538538

@@ -577,13 +577,13 @@ The maximum number of bytes to be read from the file. For text-mode files, carri
577577

578578
### Return Value
579579

580-
The number of bytes transferred to the buffer. Note that for all `CFile` classes, the return value may be less than *nCount* if the end of file was reached.
580+
The number of bytes transferred to the buffer. For all `CFile` classes, the return value may be less than *nCount* if the end of file was reached.
581581

582582
### Example
583583

584584
[!code-cpp[NVC_MFCFiles#15](../../atl-mfc-shared/reference/codesnippet/cpp/cfile-class_11.cpp)]
585585

586-
For another example see [CFile::Open](#open).
586+
For another example, see [CFile::Open](#open).
587587

588588
## <a name="remove"></a> CFile::Remove
589589

@@ -605,9 +605,9 @@ Pointer to CAtlTransactionManager object
605605

606606
### Remarks
607607

608-
It will not remove a directory.
608+
`Remove` won't remove a directory.
609609

610-
The `Remove` member function throws an exception if the connected file is open or if the file cannot be removed. This is equivalent to the DEL command.
610+
The `Remove` member function throws an exception if the connected file is open or if the file can't be removed. This function is equivalent to the DEL command.
611611

612612
### Example
613613

@@ -637,7 +637,7 @@ Pointer to CAtlTransactionManager object
637637

638638
### Remarks
639639

640-
Directories cannot be renamed. This is equivalent to the REN command.
640+
Directories can't be renamed. This function is equivalent to the REN command.
641641

642642
### Example
643643

@@ -677,7 +677,7 @@ The following table lists possible values for the *nFrom* parameter.
677677

678678
When a file is opened, the file pointer is positioned at 0, the start of the file.
679679

680-
You can set the file pointer to a position beyond the end of a file. If you do this, the size of the file does not increase until you write to the file.
680+
You can set the file pointer to a position beyond the end of a file. If you do, the size of the file doesn't increase until you write to the file.
681681

682682
The exception handler for this method must delete the exception object after the exception is processed.
683683

@@ -723,7 +723,7 @@ The length of the file in bytes.
723723

724724
## <a name="setfilepath"></a> CFile::SetFilePath
725725

726-
Call this function to specify the path of the file; for example, if the path of a file is not available when a [CFile](../../mfc/reference/cfile-class.md) object is constructed, call `SetFilePath` to provide it.
726+
Call this function to specify the path of the file. For example, if the path of a file isn't available when a [CFile](../../mfc/reference/cfile-class.md) object is constructed, call `SetFilePath` to provide it.
727727

728728
```
729729
virtual void SetFilePath(LPCTSTR lpszNewName);
@@ -782,7 +782,7 @@ static void PASCAL SetStatus(
782782
A string that is the path to the desired file. The path can be relative or absolute, and can contain a network name.
783783

784784
*status*<br/>
785-
The buffer containing the new status information. Call the `GetStatus` member function to prefill the `CFileStatus` structure with current values, then make changes as required. If a value is 0, then the corresponding status item is not updated. See the [GetStatus](#getstatus) member function for a description of the `CFileStatus` structure.
785+
The buffer containing the new status information. Call the `GetStatus` member function to prefill the `CFileStatus` structure with current values, then make changes as required. If a value is 0, then the corresponding status item isn't updated. See the [GetStatus](#getstatus) member function for a description of the `CFileStatus` structure.
786786

787787
*pTM*<br/>
788788
Pointer to CAtlTransactionManager object
@@ -791,7 +791,7 @@ Pointer to CAtlTransactionManager object
791791

792792
To set the time, modify the `m_mtime` field of *status*.
793793

794-
Please note that when you make a call to `SetStatus` in an attempt to change only the attributes of the file, and the `m_mtime` member of the file status structure is nonzero, the attributes may also be affected (changing the time stamp may have side effects on the attributes). If you want to only change the attributes of the file, first set the `m_mtime` member of the file status structure to zero and then make a call to `SetStatus`.
794+
When you make a call to `SetStatus` in an attempt to change only the attributes of the file, and the `m_mtime` member of the file status structure is nonzero, the attributes may also be affected (changing the time stamp may have side effects on the attributes). If you want to only change the attributes of the file, first set the `m_mtime` member of the file status structure to zero and then make a call to `SetStatus`.
795795

796796
### Example
797797

@@ -852,7 +852,7 @@ The number of bytes to be transferred from the buffer. For text-mode files, carr
852852

853853
[!code-cpp[NVC_MFCFiles#16](../../atl-mfc-shared/reference/codesnippet/cpp/cfile-class_19.cpp)]
854854

855-
In addition, see the examples for [CFile::CFile](#cfile) and [CFile::Open](#open).
855+
Also see the examples for [CFile::CFile](#cfile) and [CFile::Open](#open).
856856

857857
## See also
858858

0 commit comments

Comments
 (0)