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
|
<!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: wxDir 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="#pub-static-methods">Static Public Member Functions</a> |
<a href="classwx_dir-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">wxDir 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/dir.h></code></p>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classwx_dir.html" title="wxDir is a portable equivalent of Unix open/read/closedir functions which allow enumerating of the fi...">wxDir</a> is a portable equivalent of Unix open/read/closedir functions which allow enumerating of the files in a directory. </p>
<p><a class="el" href="classwx_dir.html" title="wxDir is a portable equivalent of Unix open/read/closedir functions which allow enumerating of the fi...">wxDir</a> allows to enumerate files as well as directories.</p>
<p><a class="el" href="classwx_dir.html" title="wxDir is a portable equivalent of Unix open/read/closedir functions which allow enumerating of the fi...">wxDir</a> also provides a flexible way to enumerate files recursively using <a class="el" href="classwx_dir.html#a7621f55a0dff2a394e6da1a61e427df1" title="Enumerate all files and directories under the given directory.">Traverse()</a> or a simpler <a class="el" href="classwx_dir.html#adf11b6104db3ff8c17902328d0ada848" title="The function appends the names of all the files under directory dirname to the array files (note that...">GetAllFiles()</a> function.</p>
<p>Example of use:</p>
<div class="fragment"><div class="line"><a class="code" href="classwx_dir.html" title="wxDir is a portable equivalent of Unix open/read/closedir functions which allow enumerating of the fi...">wxDir</a> dir(<a class="code" href="group__group__funcmacro__file.html#gab0cc6ceca11d23f61cba353c01eeac06" title="Returns a string containing the current (or working) directory.">wxGetCwd</a>());</div>
<div class="line"></div>
<div class="line"><span class="keywordflow">if</span> ( !dir.IsOpened() )</div>
<div class="line">{</div>
<div class="line"> <span class="comment">// deal with the error here - wxDir would already log an error message</span></div>
<div class="line"> <span class="comment">// explaining the exact reason of the failure</span></div>
<div class="line"> <span class="keywordflow">return</span>;</div>
<div class="line">}</div>
<div class="line"></div>
<div class="line">puts(<span class="stringliteral">"Enumerating object files in current directory:"</span>);</div>
<div class="line"></div>
<div class="line"><a class="code" href="classwx_string.html" title="String class for passing textual data to or receiving it from wxWidgets.">wxString</a> filename;</div>
<div class="line"></div>
<div class="line"><span class="keywordtype">bool</span> cont = dir.GetFirst(&filename, filespec, flags);</div>
<div class="line"><span class="keywordflow">while</span> ( cont )</div>
<div class="line">{</div>
<div class="line"> printf(<span class="stringliteral">"%s\n"</span>, filename.<a class="code" href="classwx_string.html#a6418ec90c6d4ffe0b05702be1b35df4f" title="Returns a lightweight intermediate class which is in turn implicitly convertible to both const char* ...">c_str</a>());</div>
<div class="line"></div>
<div class="line"> cont = dir.GetNext(&filename);</div>
<div class="line">}</div>
</div><!-- fragment --><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> </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:a724ddccbd94415322d4bda64de4358c6"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_dir.html#a724ddccbd94415322d4bda64de4358c6">wxDir</a> ()</td></tr>
<tr class="memdesc:a724ddccbd94415322d4bda64de4358c6"><td class="mdescLeft"> </td><td class="mdescRight">Default constructor, use <a class="el" href="classwx_dir.html#a51eb3dd2adf86bfa977aa94526242536" title="Open the directory for enumerating, returns true on success or false if an error occurred.">Open()</a> afterwards. <a href="#a724ddccbd94415322d4bda64de4358c6"></a><br/></td></tr>
<tr class="separator:a724ddccbd94415322d4bda64de4358c6"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac4d7e373292882b38ec367536a0de1d9"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_dir.html#ac4d7e373292882b38ec367536a0de1d9">wxDir</a> (const <a class="el" href="classwx_string.html">wxString</a> &dir)</td></tr>
<tr class="memdesc:ac4d7e373292882b38ec367536a0de1d9"><td class="mdescLeft"> </td><td class="mdescRight">Opens the directory for enumeration, use <a class="el" href="classwx_dir.html#a4746350f9d7fa2971d46e2a19a335868" title="Returns true if the directory was successfully opened by a previous call to Open().">IsOpened()</a> to test for errors. <a href="#ac4d7e373292882b38ec367536a0de1d9"></a><br/></td></tr>
<tr class="separator:ac4d7e373292882b38ec367536a0de1d9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5c2ca66526b2c85ac9fba8c44b95fa16"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_dir.html#a5c2ca66526b2c85ac9fba8c44b95fa16">~wxDir</a> ()</td></tr>
<tr class="memdesc:a5c2ca66526b2c85ac9fba8c44b95fa16"><td class="mdescLeft"> </td><td class="mdescRight">Destructor cleans up the associated resources by calling <a class="el" href="classwx_dir.html#af7d9e9270887b36b7258c9206b5c4dcf" title="Close the directory.">Close()</a>. <a href="#a5c2ca66526b2c85ac9fba8c44b95fa16"></a><br/></td></tr>
<tr class="separator:a5c2ca66526b2c85ac9fba8c44b95fa16"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:af7d9e9270887b36b7258c9206b5c4dcf"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_dir.html#af7d9e9270887b36b7258c9206b5c4dcf">Close</a> ()</td></tr>
<tr class="memdesc:af7d9e9270887b36b7258c9206b5c4dcf"><td class="mdescLeft"> </td><td class="mdescRight">Close the directory. <a href="#af7d9e9270887b36b7258c9206b5c4dcf"></a><br/></td></tr>
<tr class="separator:af7d9e9270887b36b7258c9206b5c4dcf"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a08bad912e7c04ed2b5f7a4e498f77247"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_dir.html#a08bad912e7c04ed2b5f7a4e498f77247">GetFirst</a> (<a class="el" href="classwx_string.html">wxString</a> *filename, const <a class="el" href="classwx_string.html">wxString</a> &filespec=<a class="el" href="interface_2wx_2string_8h.html#a9a321d587166a30017b608dd2d234033">wxEmptyString</a>, int flags=<a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232aa9bf30b24c5c95df5135e564ed08b147">wxDIR_DEFAULT</a>) const </td></tr>
<tr class="memdesc:a08bad912e7c04ed2b5f7a4e498f77247"><td class="mdescLeft"> </td><td class="mdescRight">Start enumerating all files matching <em>filespec</em> (or all files if it is empty) and <em>flags</em>, return <span class="literal">true</span> on success. <a href="#a08bad912e7c04ed2b5f7a4e498f77247"></a><br/></td></tr>
<tr class="separator:a08bad912e7c04ed2b5f7a4e498f77247"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7beabef18fb36071f16b788824a14e2e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_string.html">wxString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_dir.html#a7beabef18fb36071f16b788824a14e2e">GetName</a> () const </td></tr>
<tr class="memdesc:a7beabef18fb36071f16b788824a14e2e"><td class="mdescLeft"> </td><td class="mdescRight">Returns the name of the directory itself. <a href="#a7beabef18fb36071f16b788824a14e2e"></a><br/></td></tr>
<tr class="separator:a7beabef18fb36071f16b788824a14e2e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4a4891cdfb0e5bbe20de2c823e0ea7cb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_string.html">wxString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_dir.html#a4a4891cdfb0e5bbe20de2c823e0ea7cb">GetNameWithSep</a> () const </td></tr>
<tr class="memdesc:a4a4891cdfb0e5bbe20de2c823e0ea7cb"><td class="mdescLeft"> </td><td class="mdescRight">Returns the name of the directory with the path separator appended. <a href="#a4a4891cdfb0e5bbe20de2c823e0ea7cb"></a><br/></td></tr>
<tr class="separator:a4a4891cdfb0e5bbe20de2c823e0ea7cb"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a231c28d6814d9ab89eb1be1b9545590e"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_dir.html#a231c28d6814d9ab89eb1be1b9545590e">GetNext</a> (<a class="el" href="classwx_string.html">wxString</a> *filename) const </td></tr>
<tr class="memdesc:a231c28d6814d9ab89eb1be1b9545590e"><td class="mdescLeft"> </td><td class="mdescRight">Continue enumerating files which satisfy the criteria specified by the last call to <a class="el" href="classwx_dir.html#a08bad912e7c04ed2b5f7a4e498f77247" title="Start enumerating all files matching filespec (or all files if it is empty) and flags, return true on success.">GetFirst()</a>. <a href="#a231c28d6814d9ab89eb1be1b9545590e"></a><br/></td></tr>
<tr class="separator:a231c28d6814d9ab89eb1be1b9545590e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a5c42987615b1a0f9c369f2b8f2a1f88b"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_dir.html#a5c42987615b1a0f9c369f2b8f2a1f88b">HasFiles</a> (const <a class="el" href="classwx_string.html">wxString</a> &filespec=<a class="el" href="interface_2wx_2string_8h.html#a9a321d587166a30017b608dd2d234033">wxEmptyString</a>) const </td></tr>
<tr class="memdesc:a5c42987615b1a0f9c369f2b8f2a1f88b"><td class="mdescLeft"> </td><td class="mdescRight">Returns <span class="literal">true</span> if the directory contains any files matching the given <em>filespec</em>. <a href="#a5c42987615b1a0f9c369f2b8f2a1f88b"></a><br/></td></tr>
<tr class="separator:a5c42987615b1a0f9c369f2b8f2a1f88b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ad3970b5191b479fed70b18fe4a457e48"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_dir.html#ad3970b5191b479fed70b18fe4a457e48">HasSubDirs</a> (const <a class="el" href="classwx_string.html">wxString</a> &dirspec=<a class="el" href="interface_2wx_2string_8h.html#a9a321d587166a30017b608dd2d234033">wxEmptyString</a>) const </td></tr>
<tr class="memdesc:ad3970b5191b479fed70b18fe4a457e48"><td class="mdescLeft"> </td><td class="mdescRight">Returns <span class="literal">true</span> if the directory contains any subdirectories (if a non empty <em>filespec</em> is given, only check for directories matching it). <a href="#ad3970b5191b479fed70b18fe4a457e48"></a><br/></td></tr>
<tr class="separator:ad3970b5191b479fed70b18fe4a457e48"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a4746350f9d7fa2971d46e2a19a335868"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_dir.html#a4746350f9d7fa2971d46e2a19a335868">IsOpened</a> () const </td></tr>
<tr class="memdesc:a4746350f9d7fa2971d46e2a19a335868"><td class="mdescLeft"> </td><td class="mdescRight">Returns <span class="literal">true</span> if the directory was successfully opened by a previous call to <a class="el" href="classwx_dir.html#a51eb3dd2adf86bfa977aa94526242536" title="Open the directory for enumerating, returns true on success or false if an error occurred.">Open()</a>. <a href="#a4746350f9d7fa2971d46e2a19a335868"></a><br/></td></tr>
<tr class="separator:a4746350f9d7fa2971d46e2a19a335868"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a51eb3dd2adf86bfa977aa94526242536"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_dir.html#a51eb3dd2adf86bfa977aa94526242536">Open</a> (const <a class="el" href="classwx_string.html">wxString</a> &dir)</td></tr>
<tr class="memdesc:a51eb3dd2adf86bfa977aa94526242536"><td class="mdescLeft"> </td><td class="mdescRight">Open the directory for enumerating, returns <span class="literal">true</span> on success or <span class="literal">false</span> if an error occurred. <a href="#a51eb3dd2adf86bfa977aa94526242536"></a><br/></td></tr>
<tr class="separator:a51eb3dd2adf86bfa977aa94526242536"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7621f55a0dff2a394e6da1a61e427df1"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_dir.html#a7621f55a0dff2a394e6da1a61e427df1">Traverse</a> (<a class="el" href="classwx_dir_traverser.html">wxDirTraverser</a> &sink, const <a class="el" href="classwx_string.html">wxString</a> &filespec=<a class="el" href="interface_2wx_2string_8h.html#a9a321d587166a30017b608dd2d234033">wxEmptyString</a>, int flags=<a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232aa9bf30b24c5c95df5135e564ed08b147">wxDIR_DEFAULT</a>) const </td></tr>
<tr class="memdesc:a7621f55a0dff2a394e6da1a61e427df1"><td class="mdescLeft"> </td><td class="mdescRight">Enumerate all files and directories under the given directory. <a href="#a7621f55a0dff2a394e6da1a61e427df1"></a><br/></td></tr>
<tr class="separator:a7621f55a0dff2a394e6da1a61e427df1"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:ae03564ab50b6b83947f34477d89f0866"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_dir.html#ae03564ab50b6b83947f34477d89f0866">Exists</a> (const <a class="el" href="classwx_string.html">wxString</a> &dir)</td></tr>
<tr class="memdesc:ae03564ab50b6b83947f34477d89f0866"><td class="mdescLeft"> </td><td class="mdescRight">Test for existence of a directory with the given name. <a href="#ae03564ab50b6b83947f34477d89f0866"></a><br/></td></tr>
<tr class="separator:ae03564ab50b6b83947f34477d89f0866"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a7f61cb07fa58cff063b8acdcaa015bdd"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classwx_string.html">wxString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_dir.html#a7f61cb07fa58cff063b8acdcaa015bdd">FindFirst</a> (const <a class="el" href="classwx_string.html">wxString</a> &dirname, const <a class="el" href="classwx_string.html">wxString</a> &filespec, int flags=<a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232aa9bf30b24c5c95df5135e564ed08b147">wxDIR_DEFAULT</a>)</td></tr>
<tr class="memdesc:a7f61cb07fa58cff063b8acdcaa015bdd"><td class="mdescLeft"> </td><td class="mdescRight">The function returns the path of the first file matching the given <em>filespec</em> or an empty string if there are no files matching it. <a href="#a7f61cb07fa58cff063b8acdcaa015bdd"></a><br/></td></tr>
<tr class="separator:a7f61cb07fa58cff063b8acdcaa015bdd"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:adf11b6104db3ff8c17902328d0ada848"><td class="memItemLeft" align="right" valign="top">static size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_dir.html#adf11b6104db3ff8c17902328d0ada848">GetAllFiles</a> (const <a class="el" href="classwx_string.html">wxString</a> &dirname, <a class="el" href="classwx_array_string.html">wxArrayString</a> *files, const <a class="el" href="classwx_string.html">wxString</a> &filespec=<a class="el" href="interface_2wx_2string_8h.html#a9a321d587166a30017b608dd2d234033">wxEmptyString</a>, int flags=<a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232aa9bf30b24c5c95df5135e564ed08b147">wxDIR_DEFAULT</a>)</td></tr>
<tr class="memdesc:adf11b6104db3ff8c17902328d0ada848"><td class="mdescLeft"> </td><td class="mdescRight">The function appends the names of all the files under directory <em>dirname</em> to the array <em>files</em> (note that its old content is preserved). <a href="#adf11b6104db3ff8c17902328d0ada848"></a><br/></td></tr>
<tr class="separator:adf11b6104db3ff8c17902328d0ada848"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:acec31249ed7a4dd2d36e8e1011f4ac16"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classwx_u_long_long.html">wxULongLong</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_dir.html#acec31249ed7a4dd2d36e8e1011f4ac16">GetTotalSize</a> (const <a class="el" href="classwx_string.html">wxString</a> &dir, <a class="el" href="classwx_array_string.html">wxArrayString</a> *filesSkipped=NULL)</td></tr>
<tr class="memdesc:acec31249ed7a4dd2d36e8e1011f4ac16"><td class="mdescLeft"> </td><td class="mdescRight">Returns the size (in bytes) of all files recursively found in <code>dir</code> or <code>wxInvalidSize</code> in case of error. <a href="#acec31249ed7a4dd2d36e8e1011f4ac16"></a><br/></td></tr>
<tr class="separator:acec31249ed7a4dd2d36e8e1011f4ac16"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:a97ee8e2dc2154b14bcd4b2f78cb5733d"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_dir.html#a97ee8e2dc2154b14bcd4b2f78cb5733d">Make</a> (const <a class="el" href="classwx_string.html">wxString</a> &dir, int perm=<a class="el" href="group__group__funcmacro__file.html#gga64460401fb35c137c9df28f3c019694da5508d32ba8e3138121f604e731c7f096">wxS_DIR_DEFAULT</a>, int flags=0)</td></tr>
<tr class="memdesc:a97ee8e2dc2154b14bcd4b2f78cb5733d"><td class="mdescLeft"> </td><td class="mdescRight">Creates a directory. <a href="#a97ee8e2dc2154b14bcd4b2f78cb5733d"></a><br/></td></tr>
<tr class="separator:a97ee8e2dc2154b14bcd4b2f78cb5733d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ac72c21a6fc1a1f1e681be21e6538b034"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_dir.html#ac72c21a6fc1a1f1e681be21e6538b034">Remove</a> (const <a class="el" href="classwx_string.html">wxString</a> &dir, int flags=0)</td></tr>
<tr class="memdesc:ac72c21a6fc1a1f1e681be21e6538b034"><td class="mdescLeft"> </td><td class="mdescRight">Removes a directory. <a href="#ac72c21a6fc1a1f1e681be21e6538b034"></a><br/></td></tr>
<tr class="separator:ac72c21a6fc1a1f1e681be21e6538b034"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
<a class="anchor" id="a724ddccbd94415322d4bda64de4358c6"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">wxDir::wxDir </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Default constructor, use <a class="el" href="classwx_dir.html#a51eb3dd2adf86bfa977aa94526242536" title="Open the directory for enumerating, returns true on success or false if an error occurred.">Open()</a> afterwards. </p>
</div>
</div>
<a class="anchor" id="ac4d7e373292882b38ec367536a0de1d9"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">wxDir::wxDir </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>dir</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Opens the directory for enumeration, use <a class="el" href="classwx_dir.html#a4746350f9d7fa2971d46e2a19a335868" title="Returns true if the directory was successfully opened by a previous call to Open().">IsOpened()</a> to test for errors. </p>
</div>
</div>
<a class="anchor" id="a5c2ca66526b2c85ac9fba8c44b95fa16"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">wxDir::~wxDir </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Destructor cleans up the associated resources by calling <a class="el" href="classwx_dir.html#af7d9e9270887b36b7258c9206b5c4dcf" title="Close the directory.">Close()</a>. </p>
<p>It is not virtual and so this class is not meant to be used polymorphically. </p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="af7d9e9270887b36b7258c9206b5c4dcf"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void wxDir::Close </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Close the directory. </p>
<p>The object can't be used after closing it, but <a class="el" href="classwx_dir.html#a51eb3dd2adf86bfa977aa94526242536" title="Open the directory for enumerating, returns true on success or false if an error occurred.">Open()</a> may be called again to reopen it later.</p>
<dl class="section since"><dt>Since</dt><dd>2.9.5 </dd></dl>
</div>
</div>
<a class="anchor" id="ae03564ab50b6b83947f34477d89f0866"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static bool wxDir::Exists </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>dir</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Test for existence of a directory with the given name. </p>
</div>
</div>
<a class="anchor" id="a7f61cb07fa58cff063b8acdcaa015bdd"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="classwx_string.html">wxString</a> wxDir::FindFirst </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>dirname</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>filespec</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>flags</em> = <code><a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232aa9bf30b24c5c95df5135e564ed08b147">wxDIR_DEFAULT</a></code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The function returns the path of the first file matching the given <em>filespec</em> or an empty string if there are no files matching it. </p>
<p>The <em>flags</em> parameter may or may not include <a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232a0f5850a0da2466b891dfd7b4ecc48b23" title="Includes files.">wxDIR_FILES</a>, the function always behaves as if it were specified. By default, <em>flags</em> includes <a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232af881be92c5a0289778803f3f45ad1f8d" title="Includes directories.">wxDIR_DIRS</a> and so the function recurses into the subdirectories but if this flag is not specified, the function restricts the search only to the directory <em>dirname</em> itself. See <a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232" title="These flags affect the behaviour of GetFirst/GetNext() and Traverse(), determining what types are inc...">wxDirFlags</a> for the list of the possible flags.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_dir.html#a7621f55a0dff2a394e6da1a61e427df1" title="Enumerate all files and directories under the given directory.">Traverse()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="adf11b6104db3ff8c17902328d0ada848"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static size_t wxDir::GetAllFiles </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>dirname</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classwx_array_string.html">wxArrayString</a> * </td>
<td class="paramname"><em>files</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>filespec</em> = <code><a class="el" href="interface_2wx_2string_8h.html#a9a321d587166a30017b608dd2d234033">wxEmptyString</a></code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>flags</em> = <code><a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232aa9bf30b24c5c95df5135e564ed08b147">wxDIR_DEFAULT</a></code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The function appends the names of all the files under directory <em>dirname</em> to the array <em>files</em> (note that its old content is preserved). </p>
<p>Only files matching the <em>filespec</em> are taken, with empty spec matching all the files.</p>
<p>The <em>flags</em> parameter should always include <a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232a0f5850a0da2466b891dfd7b4ecc48b23" title="Includes files.">wxDIR_FILES</a> or the array would be unchanged and should include <a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232af881be92c5a0289778803f3f45ad1f8d" title="Includes directories.">wxDIR_DIRS</a> flag to recurse into subdirectories (both flags are included in the value by default). See <a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232" title="These flags affect the behaviour of GetFirst/GetNext() and Traverse(), determining what types are inc...">wxDirFlags</a> for the list of the possible flags.</p>
<dl class="section return"><dt>Returns</dt><dd>Returns the total number of files found while traversing the directory <em>dirname</em> (i.e. the number of entries appended to the <em>files</em> array).</dd></dl>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_dir.html#a7621f55a0dff2a394e6da1a61e427df1" title="Enumerate all files and directories under the given directory.">Traverse()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a08bad912e7c04ed2b5f7a4e498f77247"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxDir::GetFirst </td>
<td>(</td>
<td class="paramtype"><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>filespec</em> = <code><a class="el" href="interface_2wx_2string_8h.html#a9a321d587166a30017b608dd2d234033">wxEmptyString</a></code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>flags</em> = <code><a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232aa9bf30b24c5c95df5135e564ed08b147">wxDIR_DEFAULT</a></code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Start enumerating all files matching <em>filespec</em> (or all files if it is empty) and <em>flags</em>, return <span class="literal">true</span> on success. </p>
<p>See <a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232" title="These flags affect the behaviour of GetFirst/GetNext() and Traverse(), determining what types are inc...">wxDirFlags</a> for the list of the possible flags. </p>
</div>
</div>
<a class="anchor" id="a7beabef18fb36071f16b788824a14e2e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classwx_string.html">wxString</a> wxDir::GetName </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the name of the directory itself. </p>
<p>The returned string does not have the trailing path separator (slash or backslash).</p>
<p>Notice that in spite of this the last character of the returned string can still be the path separator if this directory is the root one. Because of this, don't append <code>wxFILE_SEP_PATH</code> to the returned value if you do need a slash-terminated directory name but use <a class="el" href="classwx_dir.html#a4a4891cdfb0e5bbe20de2c823e0ea7cb" title="Returns the name of the directory with the path separator appended.">GetNameWithSep()</a> instead to avoid having duplicate consecutive slashes. </p>
</div>
</div>
<a class="anchor" id="a4a4891cdfb0e5bbe20de2c823e0ea7cb"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classwx_string.html">wxString</a> wxDir::GetNameWithSep </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the name of the directory with the path separator appended. </p>
<p>The last character of the returned string is always <code>wxFILE_SEP_PATH</code> unless the string is empty, indicating that this directory is invalid.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_dir.html#a7beabef18fb36071f16b788824a14e2e" title="Returns the name of the directory itself.">GetName()</a></dd></dl>
<dl class="section since"><dt>Since</dt><dd>2.9.4 </dd></dl>
</div>
</div>
<a class="anchor" id="a231c28d6814d9ab89eb1be1b9545590e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxDir::GetNext </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classwx_string.html">wxString</a> * </td>
<td class="paramname"><em>filename</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Continue enumerating files which satisfy the criteria specified by the last call to <a class="el" href="classwx_dir.html#a08bad912e7c04ed2b5f7a4e498f77247" title="Start enumerating all files matching filespec (or all files if it is empty) and flags, return true on success.">GetFirst()</a>. </p>
</div>
</div>
<a class="anchor" id="acec31249ed7a4dd2d36e8e1011f4ac16"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static <a class="el" href="classwx_u_long_long.html">wxULongLong</a> wxDir::GetTotalSize </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>dir</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="classwx_array_string.html">wxArrayString</a> * </td>
<td class="paramname"><em>filesSkipped</em> = <code>NULL</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the size (in bytes) of all files recursively found in <code>dir</code> or <code>wxInvalidSize</code> in case of error. </p>
<p>In case it happens that while traversing folders a file's size cannot be read, that file is added to the <em>filesSkipped</em> array, if not <span class="literal">NULL</span>, and then skipped. This usually happens with some special folders which are locked by the operating system or by another process. Remember that when the size of <em>filesSkipped</em> is not zero, then the returned value is not 100% accurate and, if the skipped files were big, it could be far from real size of the directory.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_file_name.html#abc3e8d14a555ac691d56b6edc506f351" title="Returns the representation of the file size in a human-readable form.">wxFileName::GetHumanReadableSize()</a>, <a class="el" href="group__group__funcmacro__file.html#gab94c2e0044fd40d901ac250be547d0da" title="This function returns the total number of bytes and number of free bytes on the disk containing the d...">wxGetDiskSpace()</a> </dd></dl>
</div>
</div>
<a class="anchor" id="a5c42987615b1a0f9c369f2b8f2a1f88b"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxDir::HasFiles </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>filespec</em> = <code><a class="el" href="interface_2wx_2string_8h.html#a9a321d587166a30017b608dd2d234033">wxEmptyString</a></code></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns <span class="literal">true</span> if the directory contains any files matching the given <em>filespec</em>. </p>
<p>If <em>filespec</em> is empty, look for any files at all. In any case, even hidden files are taken into account. </p>
</div>
</div>
<a class="anchor" id="ad3970b5191b479fed70b18fe4a457e48"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxDir::HasSubDirs </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>dirspec</em> = <code><a class="el" href="interface_2wx_2string_8h.html#a9a321d587166a30017b608dd2d234033">wxEmptyString</a></code></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns <span class="literal">true</span> if the directory contains any subdirectories (if a non empty <em>filespec</em> is given, only check for directories matching it). </p>
<p>The hidden subdirectories are taken into account as well. </p>
</div>
</div>
<a class="anchor" id="a4746350f9d7fa2971d46e2a19a335868"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxDir::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 directory was successfully opened by a previous call to <a class="el" href="classwx_dir.html#a51eb3dd2adf86bfa977aa94526242536" title="Open the directory for enumerating, returns true on success or false if an error occurred.">Open()</a>. </p>
</div>
</div>
<a class="anchor" id="a97ee8e2dc2154b14bcd4b2f78cb5733d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static bool wxDir::Make </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>dir</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>perm</em> = <code><a class="el" href="group__group__funcmacro__file.html#gga64460401fb35c137c9df28f3c019694da5508d32ba8e3138121f604e731c7f096">wxS_DIR_DEFAULT</a></code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>flags</em> = <code>0</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a directory. </p>
<p>This is just an alias for <a class="el" href="classwx_file_name.html#a852d4f699225e767242d54df53d6f3be" title="Creates a directory.">wxFileName::Mkdir()</a>; refer to that function for more info. </p>
</div>
</div>
<a class="anchor" id="a51eb3dd2adf86bfa977aa94526242536"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool wxDir::Open </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>dir</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Open the directory for enumerating, returns <span class="literal">true</span> on success or <span class="literal">false</span> if an error occurred. </p>
</div>
</div>
<a class="anchor" id="ac72c21a6fc1a1f1e681be21e6538b034"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static bool wxDir::Remove </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> & </td>
<td class="paramname"><em>dir</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>flags</em> = <code>0</code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Removes a directory. </p>
<p>This is just an alias for <a class="el" href="classwx_file_name.html#aa718276c012c7e64a1e2c28b47a1056b" title="Deletes the specified directory from the file system.">wxFileName::Rmdir()</a>; refer to that function for more info. </p>
</div>
</div>
<a class="anchor" id="a7621f55a0dff2a394e6da1a61e427df1"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t wxDir::Traverse </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classwx_dir_traverser.html">wxDirTraverser</a> & </td>
<td class="paramname"><em>sink</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>filespec</em> = <code><a class="el" href="interface_2wx_2string_8h.html#a9a321d587166a30017b608dd2d234033">wxEmptyString</a></code>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>flags</em> = <code><a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232aa9bf30b24c5c95df5135e564ed08b147">wxDIR_DEFAULT</a></code> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Enumerate all files and directories under the given directory. </p>
<p>If <em>flags</em> contains <a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232af881be92c5a0289778803f3f45ad1f8d" title="Includes directories.">wxDIR_DIRS</a> this enumeration is recursive, i.e. all the subdirectories of the given one and the files inside them will be traversed. Otherwise only the files in this directory itself are.</p>
<p>If <em>flags</em> doesn't contain <a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232a0f5850a0da2466b891dfd7b4ecc48b23" title="Includes files.">wxDIR_FILES</a> then only subdirectories are examined but not normal files. It doesn't make sense to not specify either <a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232af881be92c5a0289778803f3f45ad1f8d" title="Includes directories.">wxDIR_DIRS</a> or <a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232a0f5850a0da2466b891dfd7b4ecc48b23" title="Includes files.">wxDIR_FILES</a> and usually both of them should be specified, as is the case by default.</p>
<p>For each directory found, <a class="el" href="classwx_dir_traverser.html#a1a63d55b08f7da5c39269f649db32aeb">sink.OnDir()</a> is called and <a class="el" href="classwx_dir_traverser.html#ad51354154a38c89d288a933866501ea8">sink.OnFile()</a> is called for every file. Depending on the return value, the enumeration may continue or stop. If entering a subdirectory fails, <a class="el" href="classwx_dir_traverser.html#a0cf17e9c925c17bef9e77bbc185c90a7">sink.OnOpenError()</a> is called.</p>
<p>The function returns the total number of files found or <code>"(size_t)-1"</code> on error.</p>
<p>See <a class="el" href="dir_8h.html#aa45988fae9ce0d0c4f8312a6cf026232" title="These flags affect the behaviour of GetFirst/GetNext() and Traverse(), determining what types are inc...">wxDirFlags</a> for the full list of the possible flags.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="classwx_dir.html#adf11b6104db3ff8c17902328d0ada848" title="The function appends the names of all the files under directory dirname to the array files (note that...">GetAllFiles()</a> </dd></dl>
</div>
</div>
</div><!-- contents -->
<address class="footer">
<small>
Generated on Thu Nov 27 2014 13:46:46 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>
|