Skip to content

Commit 1efe322

Browse files
authored
Merge pull request #3544 from msebolt/code-escape-pr15
initial
2 parents 1df8366 + 127817c commit 1efe322

10 files changed

+1835
-1836
lines changed

docs/mfc/reference/application-information-and-management.md

+195-195
Large diffs are not rendered by default.

docs/mfc/reference/cbitmap-class.md

+96-96
Large diffs are not rendered by default.

docs/mfc/reference/cframewnd-class.md

+254-254
Large diffs are not rendered by default.

docs/mfc/reference/cmap-class.md

+95-95
Large diffs are not rendered by default.

docs/mfc/reference/cmenu-class.md

+365-366
Large diffs are not rendered by default.

docs/mfc/reference/cricheditctrl-class.md

+460-460
Large diffs are not rendered by default.

docs/mfc/reference/cstdiofile-class.md

+60-60
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ f1_keywords: ["CStdioFile", "AFX/CStdioFile", "AFX/CStdioFile::CStdioFile", "AFX
66
helpviewer_keywords: ["CStdioFile [MFC], CStdioFile", "CStdioFile [MFC], Open", "CStdioFile [MFC], ReadString", "CStdioFile [MFC], Seek", "CStdioFile [MFC], WriteString", "CStdioFile [MFC], m_pStream"]
77
ms.assetid: 88c2274c-4f0e-4327-882a-557ba4b3ae15
88
---
9-
# CStdioFile Class
9+
# `CStdioFile` Class
1010

11-
Represents a C run-time stream file as opened by the run-time function [fopen](../../c-runtime-library/reference/fopen-wfopen.md).
11+
Represents a C run-time stream file as opened by the run-time function [`fopen`](../../c-runtime-library/reference/fopen-wfopen.md).
1212

1313
## Syntax
1414

@@ -22,48 +22,48 @@ class CStdioFile : public CFile
2222

2323
|Name|Description|
2424
|----------|-----------------|
25-
|[CStdioFile::CStdioFile](#cstdiofile)|Constructs a `CStdioFile` object from a path or file pointer.|
25+
|[`CStdioFile::CStdioFile`](#cstdiofile)|Constructs a `CStdioFile` object from a path or file pointer.|
2626

2727
### Public Methods
2828

2929
|Name|Description|
3030
|----------|-----------------|
31-
|[CStdioFile::Open](#open)|Overloaded. Open is designed for use with the default `CStdioFile` constructor (Overrides [CFile::Open](../../mfc/reference/cfile-class.md#open)).|
32-
|[CStdioFile::ReadString](#readstring)|Reads a single line of text.|
33-
|[CStdioFile::Seek](#seek)|Positions the current file pointer.|
34-
|[CStdioFile::WriteString](#writestring)|Writes a single line of text.|
31+
|[`CStdioFile::Open`](#open)|Overloaded. Open is designed for use with the default `CStdioFile` constructor (Overrides [`CFile::Open`](../../mfc/reference/cfile-class.md#open)).|
32+
|[`CStdioFile::ReadString`](#readstring)|Reads a single line of text.|
33+
|[`CStdioFile::Seek`](#seek)|Positions the current file pointer.|
34+
|[`CStdioFile::WriteString`](#writestring)|Writes a single line of text.|
3535

3636
### Public Data Members
3737

3838
|Name|Description|
3939
|----------|-----------------|
40-
|[CStdioFile::m_pStream](#m_pstream)|Contains a pointer to an open file.|
40+
|[`CStdioFile::m_pStream`](#m_pstream)|Contains a pointer to an open file.|
4141

4242
## Remarks
4343

4444
Stream files are buffered and can be opened in either text mode (the default) or binary mode.
4545

4646
Text mode provides special processing for carriage return-line feed pairs. When you write a line feed (newline) character (0x0A) to a text-mode `CStdioFile` object, the byte pair (0x0D, 0x0A) is sent to the file. When you read, the byte pair (0x0D, 0x0A) is translated to a single 0x0A byte.
4747

48-
The [CFile](../../mfc/reference/cfile-class.md) functions [Duplicate](../../mfc/reference/cfile-class.md#duplicate), [LockRange](../../mfc/reference/cfile-class.md#lockrange), and [UnlockRange](../../mfc/reference/cfile-class.md#unlockrange) are not supported for `CStdioFile`.
48+
The [`CFile`](../../mfc/reference/cfile-class.md) functions [`Duplicate`](../../mfc/reference/cfile-class.md#duplicate), [`LockRange`](../../mfc/reference/cfile-class.md#lockrange), and [`UnlockRange`](../../mfc/reference/cfile-class.md#unlockrange) are not supported for `CStdioFile`.
4949

50-
If you call these functions on a `CStdioFile`, you will get a [CNotSupportedException](../../mfc/reference/cnotsupportedexception-class.md).
50+
If you call these functions on a `CStdioFile`, you will get a [`CNotSupportedException`](../../mfc/reference/cnotsupportedexception-class.md).
5151

5252
For more information on using `CStdioFile`, see the articles [Files in MFC](../../mfc/files-in-mfc.md) and [File Handling](../../c-runtime-library/file-handling.md) in the *Run-Time Library Reference*.
5353

5454
## Inheritance Hierarchy
5555

56-
[CObject](../../mfc/reference/cobject-class.md)
56+
[`CObject`](../../mfc/reference/cobject-class.md)
5757

58-
[CFile](../../mfc/reference/cfile-class.md)
58+
[`CFile`](../../mfc/reference/cfile-class.md)
5959

6060
`CStdioFile`
6161

6262
## Requirements
6363

64-
**Header:** afx.h
64+
**Header:** `afx.h`
6565

66-
## <a name="cstdiofile"></a> CStdioFile::CStdioFile
66+
## <a name="cstdiofile"></a> `CStdioFile::CStdioFile`
6767

6868
Constructs and initializes a `CStdioFile` object.
6969

@@ -84,37 +84,37 @@ CStdioFile(
8484

8585
### Parameters
8686

87-
*pOpenStream*<br/>
88-
Specifies the file pointer returned by a call to the C run-time function [fopen](../../c-runtime-library/reference/fopen-wfopen.md).
87+
*`pOpenStream`*<br/>
88+
Specifies the file pointer returned by a call to the C run-time function [`fopen`](../../c-runtime-library/reference/fopen-wfopen.md).
8989

90-
*lpszFileName*<br/>
90+
*`lpszFileName`*<br/>
9191
Specifies a string that is the path to the desired file. The path can be relative or absolute.
9292

93-
*nOpenFlags*<br/>
94-
Specifies options for file creation, file sharing, and file access modes. You can specify multiple options by using the bitwise OR ( **|** ) operator.
93+
*`nOpenFlags`*<br/>
94+
Specifies options for file creation, file sharing, and file access modes. You can specify multiple options by using the bitwise OR ( **`|`** ) operator.
9595

96-
One file access mode option is required; other modes are optional. See [CFile::CFile](../../mfc/reference/cfile-class.md#cfile) for a list of mode options and other flags. In MFC version 3.0 and later, share flags are allowed.
96+
One file access mode option is required; other modes are optional. See [`CFile::CFile`](../../mfc/reference/cfile-class.md#cfile) for a list of mode options and other flags. In MFC version 3.0 and later, share flags are allowed.
9797

98-
*pTM*<br/>
99-
Pointer to CAtlTransactionManager object.
98+
*`pTM`*<br/>
99+
Pointer to `CAtlTransactionManager` object.
100100

101101
### Remarks
102102

103103
The default constructor does not attach a file to the `CStdioFile` object. When using this constructor, you must use the `CStdioFile::Open` method to open a file and attach it to the `CStdioFile` object.
104104

105-
The single-parameter constructor attaches an open file stream to the `CStdioFile` object. Allowed pointer values include the predefined input/output file pointers *stdin*, *stdout*, or *stderr*.
105+
The single-parameter constructor attaches an open file stream to the `CStdioFile` object. Allowed pointer values include the predefined input/output file pointers *`stdin`*, *`stdout`*, or *`stderr`*.
106106

107107
The two-parameter constructor creates a `CStdioFile` object and opens the corresponding file with the given path.
108108

109-
If you pass NULL for either *pOpenStream* or *lpszFileName*, the constructor throws a `CInvalidArgException*`.
109+
If you pass `NULL` for either *`pOpenStream`* or *`lpszFileName`*, the constructor throws a `CInvalidArgException*`.
110110

111111
If the file cannot be opened or created, the constructor throws a `CFileException*`.
112112

113113
### Example
114114

115115
[!code-cpp[NVC_MFCFiles#37](../../atl-mfc-shared/reference/codesnippet/cpp/cstdiofile-class_1.cpp)]
116116

117-
## <a name="m_pstream"></a> CStdioFile::m_pStream
117+
## <a name="m_pstream"></a> `CStdioFile::m_pStream`
118118

119119
The `m_pStream` data member is the pointer to an open file as returned by the C run-time function `fopen`.
120120

@@ -124,9 +124,9 @@ FILE* m_pStream;
124124

125125
### Remarks
126126

127-
It is NULL if the file has never been opened or has been closed.
127+
It is `NULL` if the file has never been opened or has been closed.
128128

129-
## <a name="open"></a> CStdioFile::Open
129+
## <a name="open"></a> `CStdioFile::Open`
130130

131131
Overloaded. Open is designed for use with the default `CStdioFile` constructor.
132132

@@ -145,27 +145,27 @@ virtual BOOL Open(
145145

146146
### Parameters
147147

148-
*lpszFileName*<br/>
148+
*`lpszFileName`*<br/>
149149
A string that is the path to the desired file. The path can be relative or absolute.
150150

151-
*nOpenFlags*<br/>
151+
*`nOpenFlags`*<br/>
152152
Sharing and access mode. 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.
153153

154-
*pError*<br/>
154+
*`pError`*<br/>
155155
A pointer to an existing file-exception object that will receive the status of a failed operation.
156156

157-
*pTM*<br/>
157+
*`pTM`*<br/>
158158
Pointer to a `CAtlTransactionManager` object.
159159

160160
### Return Value
161161

162-
TRUE if successful; otherwise FALSE.
162+
`TRUE` if successful; otherwise `FALSE`.
163163

164164
### Remarks
165165

166-
## <a name="readstring"></a> CStdioFile::ReadString
166+
## <a name="readstring"></a> `CStdioFile::ReadString`
167167

168-
Reads text data into a buffer, up to a limit of *nMax*-1 characters, from the file associated with the `CStdioFile` object.
168+
Reads text data into a buffer, up to a limit of *`nMax`*-1 characters, from the file associated with the `CStdioFile` object.
169169

170170
```
171171
virtual LPTSTR ReadString(
@@ -177,33 +177,33 @@ virtual BOOL ReadString(CString& rString);
177177

178178
### Parameters
179179

180-
*lpsz*<br/>
180+
*`lpsz`*<br/>
181181
Specifies a pointer to a user-supplied buffer that will receive a null-terminated text string.
182182

183-
*nMax*<br/>
183+
*`nMax`*<br/>
184184
Specifies the maximum number of characters to read, not counting the terminating null character.
185185

186-
*rString*<br/>
186+
*`rString`*<br/>
187187
A reference to a `CString` object that will contain the string when the function returns.
188188

189189
### Return Value
190190

191-
A pointer to the buffer containing the text data. NULL if end-of-file was reached without reading any data; or if boolean, FALSE if end-of-file was reached without reading any data.
191+
A pointer to the buffer containing the text data. `NULL` if end-of-file was reached without reading any data; or if boolean, `FALSE` if end-of-file was reached without reading any data.
192192

193193
### Remarks
194194

195-
Reading is stopped by the first newline character. If, in that case, fewer than *nMax*-1 characters have been read, a newline character is stored in the buffer. A null character ('\0') is appended in either case.
195+
Reading is stopped by the first newline character. If, in that case, fewer than *`nMax`*-1 characters have been read, a newline character is stored in the buffer. A null character (`'\0'`) is appended in either case.
196196

197-
[CFile::Read](../../mfc/reference/cfile-class.md#read) is also available for text-mode input, but it does not terminate on a carriage return-line feed pair.
197+
[`CFile::Read`](../../mfc/reference/cfile-class.md#read) is also available for text-mode input, but it does not terminate on a carriage return-line feed pair.
198198

199199
> [!NOTE]
200-
> The `CString` version of this function removes the `'\n'` if present; the LPTSTR version does not.
200+
> The `CString` version of this function removes the `'\n'` if present; the `LPTSTR` version does not.
201201
202202
### Example
203203

204204
[!code-cpp[NVC_MFCFiles#38](../../atl-mfc-shared/reference/codesnippet/cpp/cstdiofile-class_2.cpp)]
205205

206-
## <a name="seek"></a> CStdioFile::Seek
206+
## <a name="seek"></a> `CStdioFile::Seek`
207207

208208
Repositions the pointer in a previously opened file.
209209

@@ -215,17 +215,17 @@ virtual ULONGLONG Seek(
215215

216216
### Parameters
217217

218-
*lOff*<br/>
218+
*`lOff`*<br/>
219219
Number of bytes to move the pointer.
220220

221-
*nFrom*<br/>
221+
*`nFrom`*<br/>
222222
Pointer movement mode. Must be one of the following values:
223223

224-
- `CFile::begin`: Move the file pointer *lOff* bytes forward from the beginning of the file.
224+
- `CFile::begin`: Move the file pointer *`lOff`* bytes forward from the beginning of the file.
225225

226-
- `CFile::current`: Move the file pointer *lOff* bytes from the current position in the file.
226+
- `CFile::current`: Move the file pointer *`lOff`* bytes from the current position in the file.
227227

228-
- `CFile::end`: Move the file pointer *lOff* bytes from the end of the file. Note that *lOff* must be negative to seek into the existing file; positive values will seek past the end of the file.
228+
- `CFile::end`: Move the file pointer *`lOff`* bytes from the end of the file. Note that *`lOff`* must be negative to seek into the existing file; positive values will seek past the end of the file.
229229

230230
### Return Value
231231

@@ -237,15 +237,15 @@ The `Seek` function permits random access to a file's contents by moving the poi
237237

238238
When a file is opened, the file pointer is positioned at offset 0, the beginning of the file.
239239

240-
This implementation of `Seek` is based on the Run-Time Library (CRT) function `fseek`. There are several limits on the usage of `Seek` on streams opened in text mode. For more information, see [fseek, _fseeki64](../../c-runtime-library/reference/fseek-fseeki64.md).
240+
This implementation of `Seek` is based on the Run-Time Library (CRT) function `fseek`. There are several limits on the usage of `Seek` on streams opened in text mode. For more information, see [`fseek`, `_fseeki64`](../../c-runtime-library/reference/fseek-fseeki64.md).
241241

242242
### Example
243243

244-
The following example shows how to use `Seek` to move the pointer 1000 bytes from the beginning of the `cfile` file. Note that `Seek` does not read data, so you must subsequently call [CStdioFile::ReadString](#readstring) to read data.
244+
The following example shows how to use `Seek` to move the pointer 1000 bytes from the beginning of the `cfile` file. Note that `Seek` does not read data, so you must subsequently call [`CStdioFile::ReadString`](#readstring) to read data.
245245

246246
[!code-cpp[NVC_MFCFiles#39](../../atl-mfc-shared/reference/codesnippet/cpp/cstdiofile-class_3.cpp)]
247247

248-
## <a name="writestring"></a> CStdioFile::WriteString
248+
## <a name="writestring"></a> `CStdioFile::WriteString`
249249

250250
Writes data from a buffer to the file associated with the `CStdioFile` object.
251251

@@ -255,16 +255,16 @@ virtual void WriteString(LPCTSTR lpsz);
255255

256256
### Parameters
257257

258-
*lpsz*<br/>
258+
*`lpsz`*<br/>
259259
Specifies a pointer to a buffer that contains a null-terminated string.
260260

261261
### Remarks
262262

263-
The terminating null character ( `\0`) is not written to the file. This method writes newline characters in *lpsz* to the file as a carriage return-line feed pair.
263+
The terminating null character ( `\0`) is not written to the file. This method writes newline characters in *`lpsz`* to the file as a carriage return-line feed pair.
264264

265-
If you want to write data that is not null-terminated to a file, use `CStdioFile::Write` or [CFile::Write](../../mfc/reference/cfile-class.md#write).
265+
If you want to write data that is not null-terminated to a file, use `CStdioFile::Write` or [`CFile::Write`](../../mfc/reference/cfile-class.md#write).
266266

267-
This method throws a `CInvalidArgException*` if you specify NULL for the *lpsz* parameter.
267+
This method throws a `CInvalidArgException*` if you specify `NULL` for the *`lpsz`* parameter.
268268

269269
This method throws a `CFileException*` in response to file system errors.
270270

@@ -274,10 +274,10 @@ This method throws a `CFileException*` in response to file system errors.
274274

275275
## See also
276276

277-
[CFile Class](../../mfc/reference/cfile-class.md)<br/>
277+
[`CFile` Class](../../mfc/reference/cfile-class.md)<br/>
278278
[Hierarchy Chart](../../mfc/hierarchy-chart.md)<br/>
279-
[CFile Class](../../mfc/reference/cfile-class.md)<br/>
280-
[CFile::Duplicate](../../mfc/reference/cfile-class.md#duplicate)<br/>
281-
[CFile::LockRange](../../mfc/reference/cfile-class.md#lockrange)<br/>
282-
[CFile::UnlockRange](../../mfc/reference/cfile-class.md#unlockrange)<br/>
283-
[CNotSupportedException Class](../../mfc/reference/cnotsupportedexception-class.md)
279+
[`CFile` Class](../../mfc/reference/cfile-class.md)<br/>
280+
[`CFile::Duplicate`](../../mfc/reference/cfile-class.md#duplicate)<br/>
281+
[`CFile::LockRange`](../../mfc/reference/cfile-class.md#lockrange)<br/>
282+
[`CFile::UnlockRange`](../../mfc/reference/cfile-class.md#unlockrange)<br/>
283+
[`CNotSupportedException` Class](../../mfc/reference/cnotsupportedexception-class.md)

0 commit comments

Comments
 (0)