PTLib  Version 2.18.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
textfile.h
Go to the documentation of this file.
1 /*
2  * textfile.h
3  *
4  * A text file I/O channel class.
5  *
6  * Portable Windows Library
7  *
8  * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
9  *
10  * The contents of this file are subject to the Mozilla Public License
11  * Version 1.0 (the "License"); you may not use this file except in
12  * compliance with the License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS"
16  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  * the License for the specific language governing rights and limitations
18  * under the License.
19  *
20  * The Original Code is Portable Windows Library.
21  *
22  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
23  *
24  * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
25  * All Rights Reserved.
26  *
27  * Contributor(s): ______________________________________.
28  */
29 
30 #ifndef PTLIB_TEXTFILE_H
31 #define PTLIB_TEXTFILE_H
32 
33 #ifdef P_USE_PRAGMA
34 #pragma interface
35 #endif
36 
37 
39 // Text Files
40 
45 class PTextFile : public PFile
46 {
47  PCLASSINFO(PTextFile, PFile);
48 
49  public:
56  PTextFile();
57 
66  PTextFile(
67  OpenMode mode,
68  OpenOptions opts = ModeDefault
69  );
70 
77  PTextFile(
78  const PFilePath & name,
79  OpenMode mode = ReadWrite,
80  OpenOptions opts = ModeDefault
81  );
83 
96  PString & str
97  );
98 
109  const PString & str
110  );
112 
113 
114 // Include platform dependent part of class
115 #ifdef _WIN32
116 #include "msos/ptlib/textfile.h"
117 #else
118 #include "unix/ptlib/textfile.h"
119 #endif
120 };
121 
122 #endif // PTLIB_TEXTFILE_H
123 
124 
125 // End Of File ///////////////////////////////////////////////////////////////
This class represents a disk file.
Definition: file.h:57
This class describes a full description for a file on the particular platform.
Definition: filepath.h:61
File can be both read and written.
Definition: file.h:77
PBoolean WriteLine(const PString &str)
Read a line from the text file.
bool PBoolean
Definition: object.h:174
The character string class.
Definition: pstring.h:108
PBoolean ReadLine(PString &str)
Read a line from the text file.
A class representing a a structured file that is portable accross CPU architectures.
Definition: textfile.h:45
PTextFile()
Create a text file object but do not open it.
OpenMode
When a file is opened, it may restrict the access available to operations on the object instance...
Definition: file.h:74