1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>wxWidgets: wxFFile Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra_stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="page_container">
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0" style="width: 100%;">
<tbody>
<tr>
<td id="projectlogo">
<a href="http://www.wxwidgets.org/" target="_new">
<img alt="wxWidgets" src="logo.png"/>
</a>
</td>
<td style="padding-left: 0.5em; text-align: right;">
<span id="projectnumber">Version: 3.0.2</span>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.8.2 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Categories</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> |
<a href="classwx_f_file-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">wxFFile Class Reference<div class="ingroups"><a class="el" href="group__group__class__file.html">File Handling</a></div></div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include <wx/ffile.h></code></p>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classwx_f_file.html" title="wxFFile implements buffered file I/O.">wxFFile</a> implements buffered file I/O. </p>
<p>This is a very small class designed to minimize the overhead of using it - in fact, there is hardly any overhead at all, but using it brings you automatic error checking and hides differences between platforms and compilers.</p>
<p>It wraps inside it a <code>FILE</code> * handle used by standard C IO library (also known as <code>stdio</code>).</p>
<h2></h2>
<div><span class="lib">Library:</span>  <span class="lib_text"><a class="el" href="page_libs.html#page_libs_wxbase">wxBase</a></span></div><div><span class="category">Category:</span>  <span class="category_text"><a class="el" href="group__group__class__file.html">File Handling</a></span></div><dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_f_file.html#a8d957fe6f3c765d0141186e0aac9a7bf" title="Returns true if the file is opened.">wxFFile::IsOpened</a> </dd></dl>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aef8e8fcc709f5b03c2a605602652b31f"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#aef8e8fcc709f5b03c2a605602652b31f">wxFFile</a> ()</td></tr>
<tr class="separator:aef8e8fcc709f5b03c2a605602652b31f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a957a84c52a104a88892e647900b666a5"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#a957a84c52a104a88892e647900b666a5">wxFFile</a> (FILE *<a class="el" href="classwx_f_file.html#a6a63fa1dd92a895a4925ad3bafc46636">fp</a>)</td></tr>
<tr class="memdesc:a957a84c52a104a88892e647900b666a5"><td class="mdescLeft"> </td><td class="mdescRight">Opens a file with the given file pointer, which has already been opened. <a href="#a957a84c52a104a88892e647900b666a5"></a><br/></td></tr>
<tr class="separator:a957a84c52a104a88892e647900b666a5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a07a6341e1b5d624064e5d09559e6481b"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#a07a6341e1b5d624064e5d09559e6481b">wxFFile</a> (const <a class="el" href="classwx_string.html">wxString</a> &filename, const <a class="el" href="classwx_string.html">wxString</a> &mode="r")</td></tr>
<tr class="memdesc:a07a6341e1b5d624064e5d09559e6481b"><td class="mdescLeft"> </td><td class="mdescRight">Opens a file with the given mode. <a href="#a07a6341e1b5d624064e5d09559e6481b"></a><br/></td></tr>
<tr class="separator:a07a6341e1b5d624064e5d09559e6481b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a60ead93a3fcd003b74ae9fe39694b1fd"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#a60ead93a3fcd003b74ae9fe39694b1fd">~wxFFile</a> ()</td></tr>
<tr class="memdesc:a60ead93a3fcd003b74ae9fe39694b1fd"><td class="mdescLeft"> </td><td class="mdescRight">Destructor will close the file. <a href="#a60ead93a3fcd003b74ae9fe39694b1fd"></a><br/></td></tr>
<tr class="separator:a60ead93a3fcd003b74ae9fe39694b1fd"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7e793b723e47955790b3f381bef450de"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#a7e793b723e47955790b3f381bef450de">Attach</a> (FILE *<a class="el" href="classwx_f_file.html#a6a63fa1dd92a895a4925ad3bafc46636">fp</a>, const <a class="el" href="classwx_string.html">wxString</a> &name=<a class="el" href="interface_2wx_2string_8h.html#a9a321d587166a30017b608dd2d234033">wxEmptyString</a>)</td></tr>
<tr class="memdesc:a7e793b723e47955790b3f381bef450de"><td class="mdescLeft"> </td><td class="mdescRight">Attaches an existing file pointer to the <a class="el" href="classwx_f_file.html" title="wxFFile implements buffered file I/O.">wxFFile</a> object. <a href="#a7e793b723e47955790b3f381bef450de"></a><br/></td></tr>
<tr class="separator:a7e793b723e47955790b3f381bef450de"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a00f1f75c98adc0a8c401d702006f406a"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#a00f1f75c98adc0a8c401d702006f406a">Close</a> ()</td></tr>
<tr class="memdesc:a00f1f75c98adc0a8c401d702006f406a"><td class="mdescLeft"> </td><td class="mdescRight">Closes the file and returns <span class="literal">true</span> on success. <a href="#a00f1f75c98adc0a8c401d702006f406a"></a><br/></td></tr>
<tr class="separator:a00f1f75c98adc0a8c401d702006f406a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a91bb5a2ee79e3720301a39ebf5fe5138"><td class="memItemLeft" align="right" valign="top">FILE * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#a91bb5a2ee79e3720301a39ebf5fe5138">Detach</a> ()</td></tr>
<tr class="memdesc:a91bb5a2ee79e3720301a39ebf5fe5138"><td class="mdescLeft"> </td><td class="mdescRight">Get back a file pointer from <a class="el" href="classwx_f_file.html" title="wxFFile implements buffered file I/O.">wxFFile</a> object – the caller is responsible for closing the file if this descriptor is opened. <a href="#a91bb5a2ee79e3720301a39ebf5fe5138"></a><br/></td></tr>
<tr class="separator:a91bb5a2ee79e3720301a39ebf5fe5138"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a16992b8b1da3d2a06b8be60529f29327"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#a16992b8b1da3d2a06b8be60529f29327">Eof</a> () const </td></tr>
<tr class="memdesc:a16992b8b1da3d2a06b8be60529f29327"><td class="mdescLeft"> </td><td class="mdescRight">Returns <span class="literal">true</span> if an attempt has been made to read <em>past</em> the end of the file. <a href="#a16992b8b1da3d2a06b8be60529f29327"></a><br/></td></tr>
<tr class="separator:a16992b8b1da3d2a06b8be60529f29327"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad720e6da582c899997ab79c7aa323155"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#ad720e6da582c899997ab79c7aa323155">Error</a> () const </td></tr>
<tr class="memdesc:ad720e6da582c899997ab79c7aa323155"><td class="mdescLeft"> </td><td class="mdescRight">Returns <span class="literal">true</span> if an error has occurred on this file, similar to the standard <code>ferror()</code> function. <a href="#ad720e6da582c899997ab79c7aa323155"></a><br/></td></tr>
<tr class="separator:ad720e6da582c899997ab79c7aa323155"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a914af50f413957a7decd928ababf1112"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#a914af50f413957a7decd928ababf1112">Flush</a> ()</td></tr>
<tr class="memdesc:a914af50f413957a7decd928ababf1112"><td class="mdescLeft"> </td><td class="mdescRight">Flushes the file and returns <span class="literal">true</span> on success. <a href="#a914af50f413957a7decd928ababf1112"></a><br/></td></tr>
<tr class="separator:a914af50f413957a7decd928ababf1112"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7d1b48920f6583f9a50f7f21cbaa6b2e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__funcmacro__file.html#ga68af15575db590aaa874d40a1073809d">wxFileKind</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#a7d1b48920f6583f9a50f7f21cbaa6b2e">GetKind</a> () const </td></tr>
<tr class="memdesc:a7d1b48920f6583f9a50f7f21cbaa6b2e"><td class="mdescLeft"> </td><td class="mdescRight">Returns the type of the file. <a href="#a7d1b48920f6583f9a50f7f21cbaa6b2e"></a><br/></td></tr>
<tr class="separator:a7d1b48920f6583f9a50f7f21cbaa6b2e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a3d85586d6b75a9213dea048bab61fc9a"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classwx_string.html">wxString</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#a3d85586d6b75a9213dea048bab61fc9a">GetName</a> () const </td></tr>
<tr class="memdesc:a3d85586d6b75a9213dea048bab61fc9a"><td class="mdescLeft"> </td><td class="mdescRight">Returns the file name. <a href="#a3d85586d6b75a9213dea048bab61fc9a"></a><br/></td></tr>
<tr class="separator:a3d85586d6b75a9213dea048bab61fc9a"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a8d957fe6f3c765d0141186e0aac9a7bf"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#a8d957fe6f3c765d0141186e0aac9a7bf">IsOpened</a> () const </td></tr>
<tr class="memdesc:a8d957fe6f3c765d0141186e0aac9a7bf"><td class="mdescLeft"> </td><td class="mdescRight">Returns <span class="literal">true</span> if the file is opened. <a href="#a8d957fe6f3c765d0141186e0aac9a7bf"></a><br/></td></tr>
<tr class="separator:a8d957fe6f3c765d0141186e0aac9a7bf"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a0fe2858580e9d94623228ce98afdd116"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__funcmacro__file.html#ga69d831b3febabc149c67b716c8e22de5">wxFileOffset</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#a0fe2858580e9d94623228ce98afdd116">Length</a> () const </td></tr>
<tr class="memdesc:a0fe2858580e9d94623228ce98afdd116"><td class="mdescLeft"> </td><td class="mdescRight">Returns the length of the file. <a href="#a0fe2858580e9d94623228ce98afdd116"></a><br/></td></tr>
<tr class="separator:a0fe2858580e9d94623228ce98afdd116"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a93670081c85d725649660611e5dccb9c"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#a93670081c85d725649660611e5dccb9c">Open</a> (const <a class="el" href="classwx_string.html">wxString</a> &filename, const <a class="el" href="classwx_string.html">wxString</a> &mode="r")</td></tr>
<tr class="memdesc:a93670081c85d725649660611e5dccb9c"><td class="mdescLeft"> </td><td class="mdescRight">Opens the file, returning <span class="literal">true</span> if successful. <a href="#a93670081c85d725649660611e5dccb9c"></a><br/></td></tr>
<tr class="separator:a93670081c85d725649660611e5dccb9c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:affb9aa57da40a29e4ca2d8f0abc804a7"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#affb9aa57da40a29e4ca2d8f0abc804a7">Read</a> (void *buffer, size_t count)</td></tr>
<tr class="memdesc:affb9aa57da40a29e4ca2d8f0abc804a7"><td class="mdescLeft"> </td><td class="mdescRight">Reads the specified number of bytes into a buffer, returning the actual number read. <a href="#affb9aa57da40a29e4ca2d8f0abc804a7"></a><br/></td></tr>
<tr class="separator:affb9aa57da40a29e4ca2d8f0abc804a7"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af8ac1ea8df8df72d0bfddfb179b40af3"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#af8ac1ea8df8df72d0bfddfb179b40af3">ReadAll</a> (<a class="el" href="classwx_string.html">wxString</a> *str, const <a class="el" href="classwx_m_b_conv.html">wxMBConv</a> &conv=<a class="el" href="classwx_conv_auto.html">wxConvAuto</a>())</td></tr>
<tr class="memdesc:af8ac1ea8df8df72d0bfddfb179b40af3"><td class="mdescLeft"> </td><td class="mdescRight">Reads the entire contents of the file into a string. <a href="#af8ac1ea8df8df72d0bfddfb179b40af3"></a><br/></td></tr>
<tr class="separator:af8ac1ea8df8df72d0bfddfb179b40af3"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5b629e330a80275fc8275b8b08a5b40e"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#a5b629e330a80275fc8275b8b08a5b40e">Seek</a> (<a class="el" href="group__group__funcmacro__file.html#ga69d831b3febabc149c67b716c8e22de5">wxFileOffset</a> ofs, <a class="el" href="group__group__funcmacro__file.html#gae3981f8632f0391e5c852bf62eb982b0">wxSeekMode</a> mode=<a class="el" href="group__group__funcmacro__file.html#ggae3981f8632f0391e5c852bf62eb982b0afe95aa5f8bbda276d20a0860a2af841d">wxFromStart</a>)</td></tr>
<tr class="memdesc:a5b629e330a80275fc8275b8b08a5b40e"><td class="mdescLeft"> </td><td class="mdescRight">Seeks to the specified position and returns <span class="literal">true</span> on success. <a href="#a5b629e330a80275fc8275b8b08a5b40e"></a><br/></td></tr>
<tr class="separator:a5b629e330a80275fc8275b8b08a5b40e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a74fd996691eb2ba0f06371a17ea3dbb4"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#a74fd996691eb2ba0f06371a17ea3dbb4">SeekEnd</a> (<a class="el" href="group__group__funcmacro__file.html#ga69d831b3febabc149c67b716c8e22de5">wxFileOffset</a> ofs=0)</td></tr>
<tr class="memdesc:a74fd996691eb2ba0f06371a17ea3dbb4"><td class="mdescLeft"> </td><td class="mdescRight">Moves the file pointer to the specified number of bytes before the end of the file and returns <span class="literal">true</span> on success. <a href="#a74fd996691eb2ba0f06371a17ea3dbb4"></a><br/></td></tr>
<tr class="separator:a74fd996691eb2ba0f06371a17ea3dbb4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a1b84187b39d443c83f37727a4e69051f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__funcmacro__file.html#ga69d831b3febabc149c67b716c8e22de5">wxFileOffset</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#a1b84187b39d443c83f37727a4e69051f">Tell</a> () const </td></tr>
<tr class="memdesc:a1b84187b39d443c83f37727a4e69051f"><td class="mdescLeft"> </td><td class="mdescRight">Returns the current position. <a href="#a1b84187b39d443c83f37727a4e69051f"></a><br/></td></tr>
<tr class="separator:a1b84187b39d443c83f37727a4e69051f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:afd41f8e0692c46a31f15b66bbb9bb6e4"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#afd41f8e0692c46a31f15b66bbb9bb6e4">Write</a> (const <a class="el" href="classwx_string.html">wxString</a> &str, const <a class="el" href="classwx_m_b_conv.html">wxMBConv</a> &conv=<a class="el" href="classwx_conv_auto.html">wxConvAuto</a>())</td></tr>
<tr class="memdesc:afd41f8e0692c46a31f15b66bbb9bb6e4"><td class="mdescLeft"> </td><td class="mdescRight">Writes the contents of the string to the file, returns <span class="literal">true</span> on success. <a href="#afd41f8e0692c46a31f15b66bbb9bb6e4"></a><br/></td></tr>
<tr class="separator:afd41f8e0692c46a31f15b66bbb9bb6e4"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4bf1d6b4ba02051b31c52f091cd6f53e"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#a4bf1d6b4ba02051b31c52f091cd6f53e">Write</a> (const void *buffer, size_t count)</td></tr>
<tr class="memdesc:a4bf1d6b4ba02051b31c52f091cd6f53e"><td class="mdescLeft"> </td><td class="mdescRight">Writes the specified number of bytes from a buffer. <a href="#a4bf1d6b4ba02051b31c52f091cd6f53e"></a><br/></td></tr>
<tr class="separator:a4bf1d6b4ba02051b31c52f091cd6f53e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a6a63fa1dd92a895a4925ad3bafc46636"><td class="memItemLeft" align="right" valign="top">FILE * </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_f_file.html#a6a63fa1dd92a895a4925ad3bafc46636">fp</a> () const </td></tr>
<tr class="memdesc:a6a63fa1dd92a895a4925ad3bafc46636"><td class="mdescLeft"> </td><td class="mdescRight">Returns the file pointer associated with the file. <a href="#a6a63fa1dd92a895a4925ad3bafc46636"></a><br/></td></tr>
<tr class="separator:a6a63fa1dd92a895a4925ad3bafc46636"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a class="anchor" id="aef8e8fcc709f5b03c2a605602652b31f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">wxFFile::wxFFile </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<a class="anchor" id="a957a84c52a104a88892e647900b666a5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">wxFFile::wxFFile </td>
<td>(</td>
<td class="paramtype">FILE * </td>
<td class="paramname"><em>fp</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Opens a file with the given file pointer, which has already been opened. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">fp</td><td>An existing file descriptor, such as stderr. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a07a6341e1b5d624064e5d09559e6481b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">wxFFile::wxFFile </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>filename</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>mode</em> = <code>"r"</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Opens a file with the given mode. </p>
<p>As there is no way to return whether the operation was successful or not from the constructor you should test the return value of <a class="el" href="classwx_f_file.html#a8d957fe6f3c765d0141186e0aac9a7bf" title="Returns true if the file is opened.">IsOpened()</a> to check that it didn't fail.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">filename</td><td>The filename. </td></tr>
<tr><td class="paramname">mode</td><td>The mode in which to open the file using standard C strings. Note that you should use "b" flag if you use binary files under Windows or the results might be unexpected due to automatic newline conversion done for the text files. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a60ead93a3fcd003b74ae9fe39694b1fd"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">wxFFile::~wxFFile </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Destructor will close the file. </p>
<dl class="section note"><dt>Note</dt><dd>it is not virtual so you should <em>not</em> derive from wxFFile! </dd></dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a7e793b723e47955790b3f381bef450de"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void wxFFile::Attach </td>
<td>(</td>
<td class="paramtype">FILE * </td>
<td class="paramname"><em>fp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>name</em> = <code><a class="el" href="interface_2wx_2string_8h.html#a9a321d587166a30017b608dd2d234033">wxEmptyString</a></code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Attaches an existing file pointer to the <a class="el" href="classwx_f_file.html" title="wxFFile implements buffered file I/O.">wxFFile</a> object. </p>
<p>The descriptor should be already opened and it will be closed by <a class="el" href="classwx_f_file.html" title="wxFFile implements buffered file I/O.">wxFFile</a> object. </p>
</div>
</div>
<a class="anchor" id="a00f1f75c98adc0a8c401d702006f406a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxFFile::Close </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Closes the file and returns <span class="literal">true</span> on success. </p>
</div>
</div>
<a class="anchor" id="a91bb5a2ee79e3720301a39ebf5fe5138"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">FILE* wxFFile::Detach </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get back a file pointer from <a class="el" href="classwx_f_file.html" title="wxFFile implements buffered file I/O.">wxFFile</a> object – the caller is responsible for closing the file if this descriptor is opened. </p>
<p><a class="el" href="classwx_f_file.html#a8d957fe6f3c765d0141186e0aac9a7bf" title="Returns true if the file is opened.">IsOpened()</a> will return <span class="literal">false</span> after call to <a class="el" href="classwx_f_file.html#a91bb5a2ee79e3720301a39ebf5fe5138" title="Get back a file pointer from wxFFile object – the caller is responsible for closing the file if this ...">Detach()</a>.</p>
<dl class="section return"><dt>Returns</dt><dd>The FILE pointer (this is new since wxWidgets 3.0.0, in the previous versions this method didn't return anything). </dd></dl>
</div>
</div>
<a class="anchor" id="a16992b8b1da3d2a06b8be60529f29327"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxFFile::Eof </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns <span class="literal">true</span> if an attempt has been made to read <em>past</em> the end of the file. </p>
<p>Note that the behaviour of the file descriptor based class <a class="el" href="classwx_file.html" title="A wxFile performs raw file I/O.">wxFile</a> is different as <a class="el" href="classwx_file.html#ae584442c77415e9d287ca7faec0dcca4" title="Returns true if the end of the file has been reached.">wxFile::Eof()</a> will return <span class="literal">true</span> here as soon as the last byte of the file has been read.</p>
<p>Also note that this method may only be called for opened files and may crash if the file is not opened.</p>
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000018">Todo:</a></b></dt><dd>THIS METHOD MAY CRASH? DOESN'T SOUND GOOD</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_f_file.html#a8d957fe6f3c765d0141186e0aac9a7bf" title="Returns true if the file is opened.">IsOpened()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="ad720e6da582c899997ab79c7aa323155"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxFFile::Error </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns <span class="literal">true</span> if an error has occurred on this file, similar to the standard <code>ferror()</code> function. </p>
<p>Please note that this method may only be called for opened files and may crash if the file is not opened.</p>
<dl class="todo"><dt><b><a class="el" href="todo.html#_todo000019">Todo:</a></b></dt><dd>THIS METHOD MAY CRASH? DOESN'T SOUND GOOD</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_f_file.html#a8d957fe6f3c765d0141186e0aac9a7bf" title="Returns true if the file is opened.">IsOpened()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a914af50f413957a7decd928ababf1112"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxFFile::Flush </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Flushes the file and returns <span class="literal">true</span> on success. </p>
</div>
</div>
<a class="anchor" id="a6a63fa1dd92a895a4925ad3bafc46636"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">FILE* wxFFile::fp </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the file pointer associated with the file. </p>
</div>
</div>
<a class="anchor" id="a7d1b48920f6583f9a50f7f21cbaa6b2e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__group__funcmacro__file.html#ga68af15575db590aaa874d40a1073809d">wxFileKind</a> wxFFile::GetKind </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the type of the file. </p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__group__funcmacro__file.html#ga68af15575db590aaa874d40a1073809d" title="File kind enumerations returned from wxGetFileKind().">wxFileKind</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a3d85586d6b75a9213dea048bab61fc9a"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classwx_string.html">wxString</a>& wxFFile::GetName </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the file name. </p>
<p>This is the name that was specified when the object was constructed or to the last call to <a class="el" href="classwx_f_file.html#a93670081c85d725649660611e5dccb9c" title="Opens the file, returning true if successful.">Open()</a>. Notice that it may be empty if <a class="el" href="classwx_f_file.html#a7e793b723e47955790b3f381bef450de" title="Attaches an existing file pointer to the wxFFile object.">Attach()</a> was called without specifying the name. </p>
</div>
</div>
<a class="anchor" id="a8d957fe6f3c765d0141186e0aac9a7bf"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxFFile::IsOpened </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns <span class="literal">true</span> if the file is opened. </p>
<p>Most of the methods of this class may only be used for an opened file. </p>
</div>
</div>
<a class="anchor" id="a0fe2858580e9d94623228ce98afdd116"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__group__funcmacro__file.html#ga69d831b3febabc149c67b716c8e22de5">wxFileOffset</a> wxFFile::Length </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the length of the file. </p>
</div>
</div>
<a class="anchor" id="a93670081c85d725649660611e5dccb9c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxFFile::Open </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>filename</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>mode</em> = <code>"r"</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Opens the file, returning <span class="literal">true</span> if successful. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">filename</td><td>The filename. </td></tr>
<tr><td class="paramname">mode</td><td>The mode in which to open the file. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="affb9aa57da40a29e4ca2d8f0abc804a7"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t wxFFile::Read </td>
<td>(</td>
<td class="paramtype">void * </td>
<td class="paramname"><em>buffer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>count</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Reads the specified number of bytes into a buffer, returning the actual number read. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">buffer</td><td>A buffer to receive the data. </td></tr>
<tr><td class="paramname">count</td><td>The number of bytes to read.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes read. </dd></dl>
</div>
</div>
<a class="anchor" id="af8ac1ea8df8df72d0bfddfb179b40af3"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxFFile::ReadAll </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classwx_string.html">wxString</a> * </td>
<td class="paramname"><em>str</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classwx_m_b_conv.html">wxMBConv</a> & </td>
<td class="paramname"><em>conv</em> = <code><a class="el" href="classwx_conv_auto.html">wxConvAuto</a>()</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Reads the entire contents of the file into a string. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">str</td><td>String to read data into. </td></tr>
<tr><td class="paramname">conv</td><td>Conversion object to use in Unicode build; by default supposes that file contents is encoded in UTF-8.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><span class="literal">true</span> if file was read successfully, <span class="literal">false</span> otherwise. </dd></dl>
</div>
</div>
<a class="anchor" id="a5b629e330a80275fc8275b8b08a5b40e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxFFile::Seek </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__group__funcmacro__file.html#ga69d831b3febabc149c67b716c8e22de5">wxFileOffset</a> </td>
<td class="paramname"><em>ofs</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__group__funcmacro__file.html#gae3981f8632f0391e5c852bf62eb982b0">wxSeekMode</a> </td>
<td class="paramname"><em>mode</em> = <code><a class="el" href="group__group__funcmacro__file.html#ggae3981f8632f0391e5c852bf62eb982b0afe95aa5f8bbda276d20a0860a2af841d">wxFromStart</a></code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Seeks to the specified position and returns <span class="literal">true</span> on success. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ofs</td><td>Offset to seek to. </td></tr>
<tr><td class="paramname">mode</td><td>One of wxFromStart, wxFromEnd, wxFromCurrent. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a74fd996691eb2ba0f06371a17ea3dbb4"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxFFile::SeekEnd </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__group__funcmacro__file.html#ga69d831b3febabc149c67b716c8e22de5">wxFileOffset</a> </td>
<td class="paramname"><em>ofs</em> = <code>0</code></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Moves the file pointer to the specified number of bytes before the end of the file and returns <span class="literal">true</span> on success. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ofs</td><td>Number of bytes before the end of the file. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a1b84187b39d443c83f37727a4e69051f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__group__funcmacro__file.html#ga69d831b3febabc149c67b716c8e22de5">wxFileOffset</a> wxFFile::Tell </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the current position. </p>
</div>
</div>
<a class="anchor" id="afd41f8e0692c46a31f15b66bbb9bb6e4"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxFFile::Write </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>str</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classwx_m_b_conv.html">wxMBConv</a> & </td>
<td class="paramname"><em>conv</em> = <code><a class="el" href="classwx_conv_auto.html">wxConvAuto</a>()</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Writes the contents of the string to the file, returns <span class="literal">true</span> on success. </p>
<p>The second argument is only meaningful in Unicode build of wxWidgets when <em>conv</em> is used to convert <em>str</em> to multibyte representation. </p>
</div>
</div>
<a class="anchor" id="a4bf1d6b4ba02051b31c52f091cd6f53e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t wxFFile::Write </td>
<td>(</td>
<td class="paramtype">const void * </td>
<td class="paramname"><em>buffer</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>count</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Writes the specified number of bytes from a buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">buffer</td><td>A buffer containing the data. </td></tr>
<tr><td class="paramname">count</td><td>The number of bytes to write.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes written. </dd></dl>
</div>
</div>
</div><!-- contents -->
<address class="footer">
<small>
Generated on Thu Nov 27 2014 13:46:47 for wxWidgets by <a href="http://www.doxygen.org/index.html" target="_new">Doxygen</a> 1.8.2
</small>
</address>
<script src="wxwidgets.js" type="text/javascript"></script>
</div><!-- #page_container -->
</body>
</html>
|