All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
textfile.h
Go to the documentation of this file.
/*
* textfile.h
*
* A text file I/O channel class.
*
* Portable Windows Library
*
* Copyright (c) 1993-1998 Equivalence Pty. Ltd.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Portable Windows Library.
*
* The Initial Developer of the Original Code is Equivalence Pty. Ltd.
*
* Portions are Copyright (C) 1993 Free Software Foundation, Inc.
* All Rights Reserved.
*
* Contributor(s): ______________________________________.
*
* $Revision: 24177 $
* $Author: rjongbloed $
* $Date: 2010-04-05 06:52:04 -0500 (Mon, 05 Apr 2010) $
*/
#ifndef PTLIB_TEXTFILE_H
#define PTLIB_TEXTFILE_H
#ifdef P_USE_PRAGMA
#pragma interface
#endif
// Text Files
class PTextFile : public PFile
{
PCLASSINFO(PTextFile, PFile);
public:
PTextFile();
PTextFile(
OpenMode mode,
int opts = ModeDefault
);
PTextFile(
const PFilePath & name,
OpenMode mode = ReadWrite,
int opts = ModeDefault
);
PBoolean ReadLine(
PString & str
);
PBoolean WriteLine(
const PString & str
);
// Include platform dependent part of class
#ifdef _WIN32
#include "msos/ptlib/textfile.h"
#else
#include "unix/ptlib/textfile.h"
#endif
};
#endif // PTLIB_TEXTFILE_H
// End Of File ///////////////////////////////////////////////////////////////
PFile
This class represents a disk file.
Definition: file.h:60
PFilePath
This class describes a full description for a file on the particular platform.
Definition: filepath.h:65
PFile::ReadWrite
File can be both read and written.
Definition: file.h:80
PBoolean
BOOL PBoolean
Definition: object.h:102
PTextFile::WriteLine
PBoolean WriteLine(const PString &str)
Read a line from the text file.
PString
The character string class.
Definition: pstring.h:108
PFile::ModeDefault
File options depend on the OpenMode parameter.
Definition: file.h:95
PTextFile::ReadLine
PBoolean ReadLine(PString &str)
Read a line from the text file.
PTextFile
A class representing a a structured file that is portable accross CPU architectures.
Definition: textfile.h:49
PTextFile::PTextFile
PTextFile()
Create a text file object but do not open it.
PFile::OpenMode
OpenMode
When a file is opened, it may restrict the access available to operations on the object instance...
Definition: file.h:77