| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeStdFile.h
Go to the documentation of this file.

    00001 /************************************************************************************
    00002 TerraLib - a library for developing GIS applications.
    00003 Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
    00004
    00005 This code is part of the TerraLib library.
    00006 This library is free software; you can redistribute it and/or
    00007 modify it under the terms of the GNU Lesser General Public
    00008 License as published by the Free Software Foundation; either
    00009 version 2.1 of the License, or (at your option) any later version.
    00010
    00011 You should have received a copy of the GNU Lesser General Public
    00012 License along with this library.
    00013
    00014 The authors reassure the license terms regarding the warranties.
    00015 They specifically disclaim any warranties, including, but not limited to,
    00016 the implied warranties of merchantability and fitness for a particular purpose.
    00017 The library provided hereunder is on an "as is" basis, and the authors have no
    00018 obligation to provide maintenance, support, updates, enhancements, or modifications.
    00019 In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
    00020 indirect, special, incidental, or consequential damages arising out of the use
    00021 of this library and its documentation.
    00022 *************************************************************************************/
    00026 #ifndef  __TERRALIB_INTERNAL_STDFILE_H
    00027 #define  __TERRALIB_INTERNAL_STSFILE_H
    00028
    00029 #include "TeDefines.h"
    00030 #include <stdio.h>
    00031 #include <string>
    00032 using namespace std;
    00033
    00035 /*  Provide support for using a file as a class, and
    00036     throws exceptions if things go wrong
    00037            \sa TeException TeAsciiFile
    00038 */
    00039 class TL_DLL TeStdFile {
    00040 public:
    00041
    00043                       TeStdFile(const string& name, const char* mode = "r");
    00044
    00045            virtual ~TeStdFile();
    00046
    00048            bool isNotAtEOF()
    00049            {
    00050                       if ( feof ( file_ ) != 0  )
    00051                                  return false;
    00052                       return true;
    00053            }
    00054
    00055 // name
    00056            string name ()
    00057            { return fileName_; }
    00058
    00059 // -- operator ()
    00060            operator FILE*() { return file_; }
    00061
    00062 // -- returns the file pointer
    00063            FILE* FilePtr() { return file_; }
    00064
    00065            void rewind();
    00066
    00067 protected:
    00068
    00069 // -- File pointer
    00070
    00071            FILE *file_;
    00072            string fileName_;
    00073            string mode_;
    00074
    00075 private:
    00076
    00077 // No copy allowed
    00078            TeStdFile(const TeStdFile&);
    00079            TeStdFile& operator=(const TeStdFile&);
    00080
    00081 };
    00082
    00083 #endif
    00084

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines