File: classwx_text_file.html

package info (click to toggle)
wxpython3.0 3.0.2.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 482,760 kB
  • ctags: 518,293
  • sloc: cpp: 2,127,226; python: 294,045; makefile: 51,942; ansic: 19,033; sh: 3,013; xml: 1,629; perl: 17
file content (838 lines) | stat: -rw-r--r-- 61,928 bytes parent folder | download | duplicates (2)
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
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
<!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: wxTextFile 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&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;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&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="classwx_text_file-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">wxTextFile 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 &lt;wx/textfile.h&gt;</code></p>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The <a class="el" href="classwx_text_file.html" title="The wxTextFile is a simple class which allows to work with text files on line by line basis...">wxTextFile</a> is a simple class which allows to work with text files on line by line basis. </p>
<p>It also understands the differences in line termination characters under different platforms and will not do anything bad to files with "non
native" line termination sequences - in fact, it can be also used to modify the text files and change the line termination characters from one type (say DOS) to another (say Unix).</p>
<p>One word of warning: the class is not at all optimized for big files and thus it will load the file entirely into memory when opened. Of course, you should not work in this way with large files (as an estimation, anything over 1 Megabyte is surely too big for this class). On the other hand, it is not a serious limitation for small files like configuration files or program sources which are well handled by <a class="el" href="classwx_text_file.html" title="The wxTextFile is a simple class which allows to work with text files on line by line basis...">wxTextFile</a>.</p>
<p>The typical things you may do with <a class="el" href="classwx_text_file.html" title="The wxTextFile is a simple class which allows to work with text files on line by line basis...">wxTextFile</a> in order are:</p>
<ul>
<li>Create and open it: this is done with either <a class="el" href="classwx_text_file.html#a1d332b0de7bd9b02af42564de6163a12" title="Creates the file with the name which was given in the wxTextFile(const wxString&amp;) constructor...">wxTextFile::Create</a> or <a class="el" href="classwx_text_file.html#a627cf46a2209de3084fc7f6631fd4f78" title="Opens the file with the name which was given in the wxTextFile(const wxString&amp;) constructor and also ...">wxTextFile::Open</a> function which opens the file (name may be specified either as the argument to these functions or in the constructor), reads its contents in memory (in the case of <a class="el" href="classwx_text_file.html#a627cf46a2209de3084fc7f6631fd4f78" title="Opens the file with the name which was given in the wxTextFile(const wxString&amp;) constructor and also ...">wxTextFile::Open()</a>) and closes it.</li>
<li>Work with the lines in the file: this may be done either with "direct
  access" functions like <a class="el" href="classwx_text_file.html#a478857cce2edade3fea4a962b85c567b" title="Get the number of lines in the file.">wxTextFile::GetLineCount</a> and <a class="el" href="classwx_text_file.html#a0066519546e6cbead80621b9fe5c0493" title="Retrieves the line number n from the file.">wxTextFile::GetLine</a> (<em>operator</em>[] does exactly the same but looks more like array addressing) or with "sequential access" functions which include <a class="el" href="classwx_text_file.html#a34dba92dd33454179b9537aee0ed0871" title="This method together with GetNextLine() allows more &quot;iterator-like&quot; traversal of the list of lines...">wxTextFile::GetFirstLine</a>, <a class="el" href="classwx_text_file.html#a1c7e9023dc31336524f44da5659b28a8" title="Gets the next line (see GetFirstLine() for the example).">wxTextFile::GetNextLine</a> and also <a class="el" href="classwx_text_file.html#ad42633ac6b3c009155159639485b3045" title="Gets the last line of the file.">wxTextFile::GetLastLine</a>, <a class="el" href="classwx_text_file.html#ac800c410c6ac0d565e0a70e2ebfc4364" title="Gets the previous line in the file.">wxTextFile::GetPrevLine</a>. For the sequential access functions the current line number is maintained: it is returned by <a class="el" href="classwx_text_file.html#ac8922e4da677e0b03ad52fbacfdffb99" title="Returns the current line: it has meaning only when you&#39;re using GetFirstLine()/GetNextLine() function...">wxTextFile::GetCurrentLine</a> and may be changed with <a class="el" href="classwx_text_file.html#a8e0dd930c68dc78c26442c778d9c42a4" title="Changes the value returned by GetCurrentLine() and used by GetFirstLine() and GetNextLine().">wxTextFile::GoToLine</a>.</li>
<li>Add/remove lines to the file: <a class="el" href="classwx_text_file.html#abed1a69c2e35828fadddf8e1cb0365d6" title="Adds a line to the end of file.">wxTextFile::AddLine</a> and <a class="el" href="classwx_text_file.html#a4d7dea995d33ee094fb5645395eb4d9c" title="Insert a line before the line number n.">wxTextFile::InsertLine</a> add new lines while <a class="el" href="classwx_text_file.html#aa39d04978b59dde58372c043240049ae" title="Delete line number n from the file.">wxTextFile::RemoveLine</a> deletes the existing ones. <a class="el" href="classwx_text_file.html#aa1959fb872da49445852b631ad5f5076" title="Delete all lines from the file, set current line number to 0.">wxTextFile::Clear</a> resets the file to empty.</li>
<li>Save your changes: notice that the changes you make to the file will <b>not</b> be saved automatically; calling <a class="el" href="classwx_text_file.html#a9745296181a5991bbfa663e587bbf7c4" title="Closes the file and frees memory, &quot;losing all changes&quot;.">wxTextFile::Close</a> or doing nothing discards them! To save the changes you must explicitly call <a class="el" href="classwx_text_file.html#add5fdaa0aa021d462fd9d5063167b89b" title="Change the file on disk.">wxTextFile::Write</a> - here, you may also change the line termination type if you wish.</li>
</ul>
<h2></h2>
<div><span class="lib">Library:</span>&#160;&#160;<span class="lib_text"><a class="el" href="page_libs.html#page_libs_wxbase">wxBase</a></span></div><div><span class="category">Category:</span>&#160;&#160;<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_file.html" title="A wxFile performs raw file I/O.">wxFile</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:a6db03940c46e79610b5d6b36bf30503e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#a6db03940c46e79610b5d6b36bf30503e">wxTextFile</a> ()</td></tr>
<tr class="memdesc:a6db03940c46e79610b5d6b36bf30503e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor, use <a class="el" href="classwx_text_file.html#a1d332b0de7bd9b02af42564de6163a12" title="Creates the file with the name which was given in the wxTextFile(const wxString&amp;) constructor...">Create()</a> or <a class="el" href="classwx_text_file.html#a627cf46a2209de3084fc7f6631fd4f78" title="Opens the file with the name which was given in the wxTextFile(const wxString&amp;) constructor and also ...">Open()</a> with a file name parameter to initialize the object.  <a href="#a6db03940c46e79610b5d6b36bf30503e"></a><br/></td></tr>
<tr class="separator:a6db03940c46e79610b5d6b36bf30503e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a275108258ea8216b5c87784266bd678e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#a275108258ea8216b5c87784266bd678e">wxTextFile</a> (const <a class="el" href="classwx_string.html">wxString</a> &amp;strFile)</td></tr>
<tr class="memdesc:a275108258ea8216b5c87784266bd678e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor does not load the file into memory, use <a class="el" href="classwx_text_file.html#a627cf46a2209de3084fc7f6631fd4f78" title="Opens the file with the name which was given in the wxTextFile(const wxString&amp;) constructor and also ...">Open()</a> to do it.  <a href="#a275108258ea8216b5c87784266bd678e"></a><br/></td></tr>
<tr class="separator:a275108258ea8216b5c87784266bd678e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1237cdd1b9fe55ba52b8038452ff6685"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#a1237cdd1b9fe55ba52b8038452ff6685">~wxTextFile</a> ()</td></tr>
<tr class="memdesc:a1237cdd1b9fe55ba52b8038452ff6685"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor does nothing.  <a href="#a1237cdd1b9fe55ba52b8038452ff6685"></a><br/></td></tr>
<tr class="separator:a1237cdd1b9fe55ba52b8038452ff6685"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abed1a69c2e35828fadddf8e1cb0365d6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#abed1a69c2e35828fadddf8e1cb0365d6">AddLine</a> (const <a class="el" href="classwx_string.html">wxString</a> &amp;str, <a class="el" href="textfile_8h.html#a6a6d37c2bb834f5ffba195db0eb6e023">wxTextFileType</a> type=<a class="el" href="classwx_text_file.html#a2556d86c0c6130379d9122a3c076340b">typeDefault</a>)</td></tr>
<tr class="memdesc:abed1a69c2e35828fadddf8e1cb0365d6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds a line to the end of file.  <a href="#abed1a69c2e35828fadddf8e1cb0365d6"></a><br/></td></tr>
<tr class="separator:abed1a69c2e35828fadddf8e1cb0365d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa1959fb872da49445852b631ad5f5076"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#aa1959fb872da49445852b631ad5f5076">Clear</a> ()</td></tr>
<tr class="memdesc:aa1959fb872da49445852b631ad5f5076"><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete all lines from the file, set current line number to 0.  <a href="#aa1959fb872da49445852b631ad5f5076"></a><br/></td></tr>
<tr class="separator:aa1959fb872da49445852b631ad5f5076"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9745296181a5991bbfa663e587bbf7c4"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#a9745296181a5991bbfa663e587bbf7c4">Close</a> ()</td></tr>
<tr class="memdesc:a9745296181a5991bbfa663e587bbf7c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Closes the file and frees memory, <b>"losing all changes"</b>.  <a href="#a9745296181a5991bbfa663e587bbf7c4"></a><br/></td></tr>
<tr class="separator:a9745296181a5991bbfa663e587bbf7c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d332b0de7bd9b02af42564de6163a12"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#a1d332b0de7bd9b02af42564de6163a12">Create</a> ()</td></tr>
<tr class="memdesc:a1d332b0de7bd9b02af42564de6163a12"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates the file with the name which was given in the <a class="el" href="classwx_text_file.html#a275108258ea8216b5c87784266bd678e" title="Constructor does not load the file into memory, use Open() to do it.">wxTextFile(const wxString&amp;)</a> constructor.  <a href="#a1d332b0de7bd9b02af42564de6163a12"></a><br/></td></tr>
<tr class="separator:a1d332b0de7bd9b02af42564de6163a12"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb0c99656d6a0be088596fd27976cee9"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#afb0c99656d6a0be088596fd27976cee9">Create</a> (const <a class="el" href="classwx_string.html">wxString</a> &amp;strFile)</td></tr>
<tr class="memdesc:afb0c99656d6a0be088596fd27976cee9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates the file with the given name.  <a href="#afb0c99656d6a0be088596fd27976cee9"></a><br/></td></tr>
<tr class="separator:afb0c99656d6a0be088596fd27976cee9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a351c68daa30b83f338b669bfe931c21d"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#a351c68daa30b83f338b669bfe931c21d">Eof</a> () const </td></tr>
<tr class="memdesc:a351c68daa30b83f338b669bfe931c21d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns <span class="literal">true</span> if the current line is the last one.  <a href="#a351c68daa30b83f338b669bfe931c21d"></a><br/></td></tr>
<tr class="separator:a351c68daa30b83f338b669bfe931c21d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab25b098ffce74c399f441e05c82846df"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#ab25b098ffce74c399f441e05c82846df">Exists</a> () const </td></tr>
<tr class="memdesc:ab25b098ffce74c399f441e05c82846df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return <span class="literal">true</span> if file exists - the name of the file should have been specified in the constructor before calling <a class="el" href="classwx_text_file.html#ab25b098ffce74c399f441e05c82846df" title="Return true if file exists - the name of the file should have been specified in the constructor befor...">Exists()</a>.  <a href="#ab25b098ffce74c399f441e05c82846df"></a><br/></td></tr>
<tr class="separator:ab25b098ffce74c399f441e05c82846df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac8922e4da677e0b03ad52fbacfdffb99"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#ac8922e4da677e0b03ad52fbacfdffb99">GetCurrentLine</a> () const </td></tr>
<tr class="memdesc:ac8922e4da677e0b03ad52fbacfdffb99"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current line: it has meaning only when you're using <a class="el" href="classwx_text_file.html#a34dba92dd33454179b9537aee0ed0871" title="This method together with GetNextLine() allows more &quot;iterator-like&quot; traversal of the list of lines...">GetFirstLine()</a>/GetNextLine() functions, it doesn't get updated when you're using "direct access" functions like <a class="el" href="classwx_text_file.html#a0066519546e6cbead80621b9fe5c0493" title="Retrieves the line number n from the file.">GetLine()</a>.  <a href="#ac8922e4da677e0b03ad52fbacfdffb99"></a><br/></td></tr>
<tr class="separator:ac8922e4da677e0b03ad52fbacfdffb99"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34dba92dd33454179b9537aee0ed0871"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_string.html">wxString</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#a34dba92dd33454179b9537aee0ed0871">GetFirstLine</a> ()</td></tr>
<tr class="memdesc:a34dba92dd33454179b9537aee0ed0871"><td class="mdescLeft">&#160;</td><td class="mdescRight">This method together with <a class="el" href="classwx_text_file.html#a1c7e9023dc31336524f44da5659b28a8" title="Gets the next line (see GetFirstLine() for the example).">GetNextLine()</a> allows more "iterator-like" traversal of the list of lines, i.e.  <a href="#a34dba92dd33454179b9537aee0ed0871"></a><br/></td></tr>
<tr class="separator:a34dba92dd33454179b9537aee0ed0871"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad42633ac6b3c009155159639485b3045"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_string.html">wxString</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#ad42633ac6b3c009155159639485b3045">GetLastLine</a> ()</td></tr>
<tr class="memdesc:ad42633ac6b3c009155159639485b3045"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the last line of the file.  <a href="#ad42633ac6b3c009155159639485b3045"></a><br/></td></tr>
<tr class="separator:ad42633ac6b3c009155159639485b3045"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a478857cce2edade3fea4a962b85c567b"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#a478857cce2edade3fea4a962b85c567b">GetLineCount</a> () const </td></tr>
<tr class="memdesc:a478857cce2edade3fea4a962b85c567b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the number of lines in the file.  <a href="#a478857cce2edade3fea4a962b85c567b"></a><br/></td></tr>
<tr class="separator:a478857cce2edade3fea4a962b85c567b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:affd091ae39a634fc57837d3b05b6aa4f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="textfile_8h.html#a6a6d37c2bb834f5ffba195db0eb6e023">wxTextFileType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#affd091ae39a634fc57837d3b05b6aa4f">GetLineType</a> (size_t n) const </td></tr>
<tr class="memdesc:affd091ae39a634fc57837d3b05b6aa4f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the type of the line (see also <a class="el" href="classwx_text_file.html#a70ef0a9330955eaecd463bec9519d192" title="Get the line termination string corresponding to given constant.">wxTextFile::GetEOL</a>).  <a href="#affd091ae39a634fc57837d3b05b6aa4f"></a><br/></td></tr>
<tr class="separator:affd091ae39a634fc57837d3b05b6aa4f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d4f4ce4e434610bcac90fc6e23029bb"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classwx_string.html">wxString</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#a5d4f4ce4e434610bcac90fc6e23029bb">GetName</a> () const </td></tr>
<tr class="memdesc:a5d4f4ce4e434610bcac90fc6e23029bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the name of the file.  <a href="#a5d4f4ce4e434610bcac90fc6e23029bb"></a><br/></td></tr>
<tr class="separator:a5d4f4ce4e434610bcac90fc6e23029bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c7e9023dc31336524f44da5659b28a8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_string.html">wxString</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#a1c7e9023dc31336524f44da5659b28a8">GetNextLine</a> ()</td></tr>
<tr class="memdesc:a1c7e9023dc31336524f44da5659b28a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the next line (see <a class="el" href="classwx_text_file.html#a34dba92dd33454179b9537aee0ed0871" title="This method together with GetNextLine() allows more &quot;iterator-like&quot; traversal of the list of lines...">GetFirstLine()</a> for the example).  <a href="#a1c7e9023dc31336524f44da5659b28a8"></a><br/></td></tr>
<tr class="separator:a1c7e9023dc31336524f44da5659b28a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac800c410c6ac0d565e0a70e2ebfc4364"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_string.html">wxString</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#ac800c410c6ac0d565e0a70e2ebfc4364">GetPrevLine</a> ()</td></tr>
<tr class="memdesc:ac800c410c6ac0d565e0a70e2ebfc4364"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the previous line in the file.  <a href="#ac800c410c6ac0d565e0a70e2ebfc4364"></a><br/></td></tr>
<tr class="separator:ac800c410c6ac0d565e0a70e2ebfc4364"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e0dd930c68dc78c26442c778d9c42a4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#a8e0dd930c68dc78c26442c778d9c42a4">GoToLine</a> (size_t n)</td></tr>
<tr class="memdesc:a8e0dd930c68dc78c26442c778d9c42a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Changes the value returned by <a class="el" href="classwx_text_file.html#ac8922e4da677e0b03ad52fbacfdffb99" title="Returns the current line: it has meaning only when you&#39;re using GetFirstLine()/GetNextLine() function...">GetCurrentLine()</a> and used by <a class="el" href="classwx_text_file.html#a34dba92dd33454179b9537aee0ed0871" title="This method together with GetNextLine() allows more &quot;iterator-like&quot; traversal of the list of lines...">GetFirstLine()</a> and <a class="el" href="classwx_text_file.html#a1c7e9023dc31336524f44da5659b28a8" title="Gets the next line (see GetFirstLine() for the example).">GetNextLine()</a>.  <a href="#a8e0dd930c68dc78c26442c778d9c42a4"></a><br/></td></tr>
<tr class="separator:a8e0dd930c68dc78c26442c778d9c42a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3c9ee4a521b46b4a133592296366a0fe"><td class="memItemLeft" align="right" valign="top"><a class="el" href="textfile_8h.html#a6a6d37c2bb834f5ffba195db0eb6e023">wxTextFileType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#a3c9ee4a521b46b4a133592296366a0fe">GuessType</a> () const </td></tr>
<tr class="memdesc:a3c9ee4a521b46b4a133592296366a0fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Guess the type of file (which is supposed to be opened).  <a href="#a3c9ee4a521b46b4a133592296366a0fe"></a><br/></td></tr>
<tr class="separator:a3c9ee4a521b46b4a133592296366a0fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4d7dea995d33ee094fb5645395eb4d9c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#a4d7dea995d33ee094fb5645395eb4d9c">InsertLine</a> (const <a class="el" href="classwx_string.html">wxString</a> &amp;str, size_t n, <a class="el" href="textfile_8h.html#a6a6d37c2bb834f5ffba195db0eb6e023">wxTextFileType</a> type=<a class="el" href="classwx_text_file.html#a2556d86c0c6130379d9122a3c076340b">typeDefault</a>)</td></tr>
<tr class="memdesc:a4d7dea995d33ee094fb5645395eb4d9c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Insert a line before the line number <em>n</em>.  <a href="#a4d7dea995d33ee094fb5645395eb4d9c"></a><br/></td></tr>
<tr class="separator:a4d7dea995d33ee094fb5645395eb4d9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a57933998de4ede97ea48db7ba4036b13"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#a57933998de4ede97ea48db7ba4036b13">IsOpened</a> () const </td></tr>
<tr class="memdesc:a57933998de4ede97ea48db7ba4036b13"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns <span class="literal">true</span> if the file is currently opened.  <a href="#a57933998de4ede97ea48db7ba4036b13"></a><br/></td></tr>
<tr class="separator:a57933998de4ede97ea48db7ba4036b13"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a627cf46a2209de3084fc7f6631fd4f78"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#a627cf46a2209de3084fc7f6631fd4f78">Open</a> (const <a class="el" href="classwx_m_b_conv.html">wxMBConv</a> &amp;conv=<a class="el" href="classwx_conv_auto.html">wxConvAuto</a>())</td></tr>
<tr class="memdesc:a627cf46a2209de3084fc7f6631fd4f78"><td class="mdescLeft">&#160;</td><td class="mdescRight">Opens the file with the name which was given in the <a class="el" href="classwx_text_file.html#a275108258ea8216b5c87784266bd678e" title="Constructor does not load the file into memory, use Open() to do it.">wxTextFile(const wxString&amp;)</a> constructor and also loads file in memory on success.  <a href="#a627cf46a2209de3084fc7f6631fd4f78"></a><br/></td></tr>
<tr class="separator:a627cf46a2209de3084fc7f6631fd4f78"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a83ae81cd94a79673adf91174b6e5d675"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#a83ae81cd94a79673adf91174b6e5d675">Open</a> (const <a class="el" href="classwx_string.html">wxString</a> &amp;strFile, const <a class="el" href="classwx_m_b_conv.html">wxMBConv</a> &amp;conv=<a class="el" href="classwx_conv_auto.html">wxConvAuto</a>())</td></tr>
<tr class="memdesc:a83ae81cd94a79673adf91174b6e5d675"><td class="mdescLeft">&#160;</td><td class="mdescRight">Opens the file with the given name and also loads file in memory on success.  <a href="#a83ae81cd94a79673adf91174b6e5d675"></a><br/></td></tr>
<tr class="separator:a83ae81cd94a79673adf91174b6e5d675"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa39d04978b59dde58372c043240049ae"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#aa39d04978b59dde58372c043240049ae">RemoveLine</a> (size_t n)</td></tr>
<tr class="memdesc:aa39d04978b59dde58372c043240049ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete line number <em>n</em> from the file.  <a href="#aa39d04978b59dde58372c043240049ae"></a><br/></td></tr>
<tr class="separator:aa39d04978b59dde58372c043240049ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:add5fdaa0aa021d462fd9d5063167b89b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#add5fdaa0aa021d462fd9d5063167b89b">Write</a> (<a class="el" href="textfile_8h.html#a6a6d37c2bb834f5ffba195db0eb6e023">wxTextFileType</a> typeNew=<a class="el" href="textfile_8h.html#a6a6d37c2bb834f5ffba195db0eb6e023ac7fe3e85c3a682477d30495c5186d653">wxTextFileType_None</a>, const <a class="el" href="classwx_m_b_conv.html">wxMBConv</a> &amp;conv=<a class="el" href="classwx_conv_auto.html">wxConvAuto</a>())</td></tr>
<tr class="memdesc:add5fdaa0aa021d462fd9d5063167b89b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Change the file on disk.  <a href="#add5fdaa0aa021d462fd9d5063167b89b"></a><br/></td></tr>
<tr class="separator:add5fdaa0aa021d462fd9d5063167b89b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad014a633b35638248520491a36c25bcb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_string.html">wxString</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#ad014a633b35638248520491a36c25bcb">operator[]</a> (size_t n) const </td></tr>
<tr class="memdesc:ad014a633b35638248520491a36c25bcb"><td class="mdescLeft">&#160;</td><td class="mdescRight">The same as <a class="el" href="classwx_text_file.html#a0066519546e6cbead80621b9fe5c0493" title="Retrieves the line number n from the file.">GetLine()</a>.  <a href="#ad014a633b35638248520491a36c25bcb"></a><br/></td></tr>
<tr class="separator:ad014a633b35638248520491a36c25bcb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr class="memitem:a0066519546e6cbead80621b9fe5c0493"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classwx_string.html">wxString</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#a0066519546e6cbead80621b9fe5c0493">GetLine</a> (size_t n)</td></tr>
<tr class="memdesc:a0066519546e6cbead80621b9fe5c0493"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the line number <em>n</em> from the file.  <a href="#a0066519546e6cbead80621b9fe5c0493"></a><br/></td></tr>
<tr class="separator:a0066519546e6cbead80621b9fe5c0493"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae57d70f1c4d8c22a9a5cb56274332c67"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classwx_string.html">wxString</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#ae57d70f1c4d8c22a9a5cb56274332c67">GetLine</a> (size_t n) const </td></tr>
<tr class="memdesc:ae57d70f1c4d8c22a9a5cb56274332c67"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the line number <em>n</em> from the file.  <a href="#ae57d70f1c4d8c22a9a5cb56274332c67"></a><br/></td></tr>
<tr class="separator:ae57d70f1c4d8c22a9a5cb56274332c67"><td class="memSeparator" colspan="2">&#160;</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:a70ef0a9330955eaecd463bec9519d192"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="group__group__funcmacro__string.html#gad42f64d8c82f1ce4ae58773a89b2d6a7">wxChar</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#a70ef0a9330955eaecd463bec9519d192">GetEOL</a> (<a class="el" href="textfile_8h.html#a6a6d37c2bb834f5ffba195db0eb6e023">wxTextFileType</a> type=<a class="el" href="classwx_text_file.html#a2556d86c0c6130379d9122a3c076340b">typeDefault</a>)</td></tr>
<tr class="memdesc:a70ef0a9330955eaecd463bec9519d192"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the line termination string corresponding to given constant.  <a href="#a70ef0a9330955eaecd463bec9519d192"></a><br/></td></tr>
<tr class="separator:a70ef0a9330955eaecd463bec9519d192"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:a2556d86c0c6130379d9122a3c076340b"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="textfile_8h.html#a6a6d37c2bb834f5ffba195db0eb6e023">wxTextFileType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwx_text_file.html#a2556d86c0c6130379d9122a3c076340b">typeDefault</a></td></tr>
<tr class="memdesc:a2556d86c0c6130379d9122a3c076340b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default type for current platform determined at compile time.  <a href="#a2556d86c0c6130379d9122a3c076340b"></a><br/></td></tr>
<tr class="separator:a2556d86c0c6130379d9122a3c076340b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a6db03940c46e79610b5d6b36bf30503e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wxTextFile::wxTextFile </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_text_file.html#a1d332b0de7bd9b02af42564de6163a12" title="Creates the file with the name which was given in the wxTextFile(const wxString&amp;) constructor...">Create()</a> or <a class="el" href="classwx_text_file.html#a627cf46a2209de3084fc7f6631fd4f78" title="Opens the file with the name which was given in the wxTextFile(const wxString&amp;) constructor and also ...">Open()</a> with a file name parameter to initialize the object. </p>

</div>
</div>
<a class="anchor" id="a275108258ea8216b5c87784266bd678e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wxTextFile::wxTextFile </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> &amp;&#160;</td>
          <td class="paramname"><em>strFile</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor does not load the file into memory, use <a class="el" href="classwx_text_file.html#a627cf46a2209de3084fc7f6631fd4f78" title="Opens the file with the name which was given in the wxTextFile(const wxString&amp;) constructor and also ...">Open()</a> to do it. </p>

</div>
</div>
<a class="anchor" id="a1237cdd1b9fe55ba52b8038452ff6685"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual wxTextFile::~wxTextFile </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Destructor does nothing. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="abed1a69c2e35828fadddf8e1cb0365d6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wxTextFile::AddLine </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> &amp;&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="textfile_8h.html#a6a6d37c2bb834f5ffba195db0eb6e023">wxTextFileType</a>&#160;</td>
          <td class="paramname"><em>type</em> = <code><a class="el" href="classwx_text_file.html#a2556d86c0c6130379d9122a3c076340b">typeDefault</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Adds a line to the end of file. </p>

</div>
</div>
<a class="anchor" id="aa1959fb872da49445852b631ad5f5076"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wxTextFile::Clear </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Delete all lines from the file, set current line number to 0. </p>

</div>
</div>
<a class="anchor" id="a9745296181a5991bbfa663e587bbf7c4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wxTextFile::Close </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Closes the file and frees memory, <b>"losing all changes"</b>. </p>
<p>Use <a class="el" href="classwx_text_file.html#add5fdaa0aa021d462fd9d5063167b89b" title="Change the file on disk.">Write()</a> if you want to save them. </p>

</div>
</div>
<a class="anchor" id="a1d332b0de7bd9b02af42564de6163a12"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wxTextFile::Create </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates the file with the name which was given in the <a class="el" href="classwx_text_file.html#a275108258ea8216b5c87784266bd678e" title="Constructor does not load the file into memory, use Open() to do it.">wxTextFile(const wxString&amp;)</a> constructor. </p>
<p>The array of file lines is initially empty.</p>
<p>It will fail if the file already exists, <a class="el" href="classwx_text_file.html#a627cf46a2209de3084fc7f6631fd4f78" title="Opens the file with the name which was given in the wxTextFile(const wxString&amp;) constructor and also ...">Open()</a> should be used in this case. </p>

</div>
</div>
<a class="anchor" id="afb0c99656d6a0be088596fd27976cee9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wxTextFile::Create </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> &amp;&#160;</td>
          <td class="paramname"><em>strFile</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Creates the file with the given name. </p>
<p>The array of file lines is initially empty.</p>
<p>It will fail if the file already exists, <a class="el" href="classwx_text_file.html#a627cf46a2209de3084fc7f6631fd4f78" title="Opens the file with the name which was given in the wxTextFile(const wxString&amp;) constructor and also ...">Open()</a> should be used in this case. </p>

</div>
</div>
<a class="anchor" id="a351c68daa30b83f338b669bfe931c21d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wxTextFile::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 the current line is the last one. </p>

</div>
</div>
<a class="anchor" id="ab25b098ffce74c399f441e05c82846df"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wxTextFile::Exists </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return <span class="literal">true</span> if file exists - the name of the file should have been specified in the constructor before calling <a class="el" href="classwx_text_file.html#ab25b098ffce74c399f441e05c82846df" title="Return true if file exists - the name of the file should have been specified in the constructor befor...">Exists()</a>. </p>

</div>
</div>
<a class="anchor" id="ac8922e4da677e0b03ad52fbacfdffb99"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t wxTextFile::GetCurrentLine </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the current line: it has meaning only when you're using <a class="el" href="classwx_text_file.html#a34dba92dd33454179b9537aee0ed0871" title="This method together with GetNextLine() allows more &quot;iterator-like&quot; traversal of the list of lines...">GetFirstLine()</a>/GetNextLine() functions, it doesn't get updated when you're using "direct access" functions like <a class="el" href="classwx_text_file.html#a0066519546e6cbead80621b9fe5c0493" title="Retrieves the line number n from the file.">GetLine()</a>. </p>
<p><a class="el" href="classwx_text_file.html#a34dba92dd33454179b9537aee0ed0871" title="This method together with GetNextLine() allows more &quot;iterator-like&quot; traversal of the list of lines...">GetFirstLine()</a> and <a class="el" href="classwx_text_file.html#ad42633ac6b3c009155159639485b3045" title="Gets the last line of the file.">GetLastLine()</a> also change the value of the current line, as well as <a class="el" href="classwx_text_file.html#a8e0dd930c68dc78c26442c778d9c42a4" title="Changes the value returned by GetCurrentLine() and used by GetFirstLine() and GetNextLine().">GoToLine()</a>. </p>

</div>
</div>
<a class="anchor" id="a70ef0a9330955eaecd463bec9519d192"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static const <a class="el" href="group__group__funcmacro__string.html#gad42f64d8c82f1ce4ae58773a89b2d6a7">wxChar</a>* wxTextFile::GetEOL </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="textfile_8h.html#a6a6d37c2bb834f5ffba195db0eb6e023">wxTextFileType</a>&#160;</td>
          <td class="paramname"><em>type</em> = <code><a class="el" href="classwx_text_file.html#a2556d86c0c6130379d9122a3c076340b">typeDefault</a></code></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>Get the line termination string corresponding to given constant. </p>
<p><em>typeDefault</em> is the value defined during the compilation and corresponds to the native format of the platform, i.e. it will be <code>wxTextFileType_Dos</code> under Windows and <code>wxTextFileType_Unix</code> under Unix (including Mac OS X, the value <code>wxTextFileType_Mac</code> was only used for classic Mac OS versions). </p>

</div>
</div>
<a class="anchor" id="a34dba92dd33454179b9537aee0ed0871"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classwx_string.html">wxString</a>&amp; wxTextFile::GetFirstLine </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This method together with <a class="el" href="classwx_text_file.html#a1c7e9023dc31336524f44da5659b28a8" title="Gets the next line (see GetFirstLine() for the example).">GetNextLine()</a> allows more "iterator-like" traversal of the list of lines, i.e. </p>
<p>you may write something like:</p>
<div class="fragment"><div class="line"><a class="code" href="classwx_text_file.html" title="The wxTextFile is a simple class which allows to work with text files on line by line basis...">wxTextFile</a> file;</div>
<div class="line">...</div>
<div class="line">for ( str = file.<a class="code" href="classwx_text_file.html#a34dba92dd33454179b9537aee0ed0871" title="This method together with GetNextLine() allows more &quot;iterator-like&quot; traversal of the list of lines...">GetFirstLine</a>(); !file.<a class="code" href="classwx_text_file.html#a351c68daa30b83f338b669bfe931c21d" title="Returns true if the current line is the last one.">Eof</a>(); str = file.<a class="code" href="classwx_text_file.html#a1c7e9023dc31336524f44da5659b28a8" title="Gets the next line (see GetFirstLine() for the example).">GetNextLine</a>() )</div>
<div class="line">{</div>
<div class="line">    <span class="comment">// do something with the current line in str</span></div>
<div class="line">}</div>
<div class="line"><span class="comment">// do something with the last line in str</span></div>
</div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="ad42633ac6b3c009155159639485b3045"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classwx_string.html">wxString</a>&amp; wxTextFile::GetLastLine </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the last line of the file. </p>
<p>Together with <a class="el" href="classwx_text_file.html#ac800c410c6ac0d565e0a70e2ebfc4364" title="Gets the previous line in the file.">GetPrevLine()</a> it allows to enumerate the lines in the file from the end to the beginning like this:</p>
<div class="fragment"><div class="line"><a class="code" href="classwx_text_file.html" title="The wxTextFile is a simple class which allows to work with text files on line by line basis...">wxTextFile</a> file;</div>
<div class="line">...</div>
<div class="line">for ( str = file.<a class="code" href="classwx_text_file.html#ad42633ac6b3c009155159639485b3045" title="Gets the last line of the file.">GetLastLine</a>();</div>
<div class="line">    file.<a class="code" href="classwx_text_file.html#ac8922e4da677e0b03ad52fbacfdffb99" title="Returns the current line: it has meaning only when you&#39;re using GetFirstLine()/GetNextLine() function...">GetCurrentLine</a>() &gt; 0;</div>
<div class="line">    str = file.<a class="code" href="classwx_text_file.html#ac800c410c6ac0d565e0a70e2ebfc4364" title="Gets the previous line in the file.">GetPrevLine</a>() )</div>
<div class="line">{</div>
<div class="line">    <span class="comment">// do something with the current line in str</span></div>
<div class="line">}</div>
<div class="line"><span class="comment">// do something with the first line in str</span></div>
</div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="a0066519546e6cbead80621b9fe5c0493"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classwx_string.html">wxString</a>&amp; wxTextFile::GetLine </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>n</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieves the line number <em>n</em> from the file. </p>
<p>The returned line may be modified when non-const method is used but you shouldn't add line terminator at the end &ndash; this will be done by <a class="el" href="classwx_text_file.html" title="The wxTextFile is a simple class which allows to work with text files on line by line basis...">wxTextFile</a> itself. </p>

</div>
</div>
<a class="anchor" id="ae57d70f1c4d8c22a9a5cb56274332c67"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classwx_string.html">wxString</a>&amp; wxTextFile::GetLine </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>n</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieves the line number <em>n</em> from the file. </p>
<p>The returned line may be modified when non-const method is used but you shouldn't add line terminator at the end &ndash; this will be done by <a class="el" href="classwx_text_file.html" title="The wxTextFile is a simple class which allows to work with text files on line by line basis...">wxTextFile</a> itself. </p>

</div>
</div>
<a class="anchor" id="a478857cce2edade3fea4a962b85c567b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t wxTextFile::GetLineCount </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the number of lines in the file. </p>

</div>
</div>
<a class="anchor" id="affd091ae39a634fc57837d3b05b6aa4f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="textfile_8h.html#a6a6d37c2bb834f5ffba195db0eb6e023">wxTextFileType</a> wxTextFile::GetLineType </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>n</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the type of the line (see also <a class="el" href="classwx_text_file.html#a70ef0a9330955eaecd463bec9519d192" title="Get the line termination string corresponding to given constant.">wxTextFile::GetEOL</a>). </p>

</div>
</div>
<a class="anchor" id="a5d4f4ce4e434610bcac90fc6e23029bb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classwx_string.html">wxString</a>&amp; wxTextFile::GetName </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the name of the file. </p>

</div>
</div>
<a class="anchor" id="a1c7e9023dc31336524f44da5659b28a8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classwx_string.html">wxString</a>&amp; wxTextFile::GetNextLine </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the next line (see <a class="el" href="classwx_text_file.html#a34dba92dd33454179b9537aee0ed0871" title="This method together with GetNextLine() allows more &quot;iterator-like&quot; traversal of the list of lines...">GetFirstLine()</a> for the example). </p>

</div>
</div>
<a class="anchor" id="ac800c410c6ac0d565e0a70e2ebfc4364"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classwx_string.html">wxString</a>&amp; wxTextFile::GetPrevLine </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the previous line in the file. </p>

</div>
</div>
<a class="anchor" id="a8e0dd930c68dc78c26442c778d9c42a4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wxTextFile::GoToLine </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>n</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Changes the value returned by <a class="el" href="classwx_text_file.html#ac8922e4da677e0b03ad52fbacfdffb99" title="Returns the current line: it has meaning only when you&#39;re using GetFirstLine()/GetNextLine() function...">GetCurrentLine()</a> and used by <a class="el" href="classwx_text_file.html#a34dba92dd33454179b9537aee0ed0871" title="This method together with GetNextLine() allows more &quot;iterator-like&quot; traversal of the list of lines...">GetFirstLine()</a> and <a class="el" href="classwx_text_file.html#a1c7e9023dc31336524f44da5659b28a8" title="Gets the next line (see GetFirstLine() for the example).">GetNextLine()</a>. </p>

</div>
</div>
<a class="anchor" id="a3c9ee4a521b46b4a133592296366a0fe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="textfile_8h.html#a6a6d37c2bb834f5ffba195db0eb6e023">wxTextFileType</a> wxTextFile::GuessType </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Guess the type of file (which is supposed to be opened). </p>
<p>If sufficiently many lines of the file are in DOS/Unix/Mac format, the corresponding value will be returned. If the detection mechanism fails <code>wxTextFileType_None</code> is returned. </p>

</div>
</div>
<a class="anchor" id="a4d7dea995d33ee094fb5645395eb4d9c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wxTextFile::InsertLine </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> &amp;&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="textfile_8h.html#a6a6d37c2bb834f5ffba195db0eb6e023">wxTextFileType</a>&#160;</td>
          <td class="paramname"><em>type</em> = <code><a class="el" href="classwx_text_file.html#a2556d86c0c6130379d9122a3c076340b">typeDefault</a></code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Insert a line before the line number <em>n</em>. </p>

</div>
</div>
<a class="anchor" id="a57933998de4ede97ea48db7ba4036b13"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wxTextFile::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 currently opened. </p>

</div>
</div>
<a class="anchor" id="a627cf46a2209de3084fc7f6631fd4f78"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wxTextFile::Open </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classwx_m_b_conv.html">wxMBConv</a> &amp;&#160;</td>
          <td class="paramname"><em>conv</em> = <code><a class="el" href="classwx_conv_auto.html">wxConvAuto</a>()</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Opens the file with the name which was given in the <a class="el" href="classwx_text_file.html#a275108258ea8216b5c87784266bd678e" title="Constructor does not load the file into memory, use Open() to do it.">wxTextFile(const wxString&amp;)</a> constructor and also loads file in memory on success. </p>
<p>It will fail if the file does not exist, <a class="el" href="classwx_text_file.html#a1d332b0de7bd9b02af42564de6163a12" title="Creates the file with the name which was given in the wxTextFile(const wxString&amp;) constructor...">Create()</a> should be used in this case.</p>
<p>The <em>conv</em> argument is only meaningful in Unicode build of wxWidgets when it is used to convert the file to wide character representation. </p>

</div>
</div>
<a class="anchor" id="a83ae81cd94a79673adf91174b6e5d675"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wxTextFile::Open </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classwx_string.html">wxString</a> &amp;&#160;</td>
          <td class="paramname"><em>strFile</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> &amp;&#160;</td>
          <td class="paramname"><em>conv</em> = <code><a class="el" href="classwx_conv_auto.html">wxConvAuto</a>()</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Opens the file with the given name and also loads file in memory on success. </p>
<p>It will fail if the file does not exist, <a class="el" href="classwx_text_file.html#a1d332b0de7bd9b02af42564de6163a12" title="Creates the file with the name which was given in the wxTextFile(const wxString&amp;) constructor...">Create()</a> should be used in this case.</p>
<p>The <em>conv</em> argument is only meaningful in Unicode build of wxWidgets when it is used to convert the file to wide character representation. </p>

</div>
</div>
<a class="anchor" id="ad014a633b35638248520491a36c25bcb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classwx_string.html">wxString</a>&amp; wxTextFile::operator[] </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>n</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The same as <a class="el" href="classwx_text_file.html#a0066519546e6cbead80621b9fe5c0493" title="Retrieves the line number n from the file.">GetLine()</a>. </p>

</div>
</div>
<a class="anchor" id="aa39d04978b59dde58372c043240049ae"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wxTextFile::RemoveLine </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>n</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Delete line number <em>n</em> from the file. </p>

</div>
</div>
<a class="anchor" id="add5fdaa0aa021d462fd9d5063167b89b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wxTextFile::Write </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="textfile_8h.html#a6a6d37c2bb834f5ffba195db0eb6e023">wxTextFileType</a>&#160;</td>
          <td class="paramname"><em>typeNew</em> = <code><a class="el" href="textfile_8h.html#a6a6d37c2bb834f5ffba195db0eb6e023ac7fe3e85c3a682477d30495c5186d653">wxTextFileType_None</a></code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classwx_m_b_conv.html">wxMBConv</a> &amp;&#160;</td>
          <td class="paramname"><em>conv</em> = <code><a class="el" href="classwx_conv_auto.html">wxConvAuto</a>()</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Change the file on disk. </p>
<p>The <em>typeNew</em> parameter allows you to change the file format (default argument means "don't change type") and may be used to convert, for example, DOS files to Unix.</p>
<p>The <em>conv</em> argument is only meaningful in Unicode build of wxWidgets when it is used to convert all lines to multibyte representation before writing them to physical file.</p>
<dl class="section return"><dt>Returns</dt><dd><span class="literal">true</span> if operation succeeded, <span class="literal">false</span> if it failed. </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a2556d86c0c6130379d9122a3c076340b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="textfile_8h.html#a6a6d37c2bb834f5ffba195db0eb6e023">wxTextFileType</a> wxTextFile::typeDefault</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>Default type for current platform determined at compile time. </p>

</div>
</div>
</div><!-- contents -->

<address class="footer">
	<small>
		Generated on Thu Nov 27 2014 13:47:00 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>