ionflux.org | Impressum

File.hpp

Go to the documentation of this file.
00001 #ifndef IONFLUX_TOOLS_FILE
00002 #define IONFLUX_TOOLS_FILE
00003 /* ==========================================================================
00004  * Ionflux Tools
00005  * Copyright (c) 2005 Joern P. Meier
00006  * mail@ionflux.org
00007  * --------------------------------------------------------------------------
00008  * File.hpp                          File.
00009  * ==========================================================================
00010  * 
00011  * This file is part of Ionflux Tools.
00012  * 
00013  * Ionflux Tools is free software; you can redistribute it and/or modify it
00014  * under the terms of the GNU General Public License as published by the 
00015  * Free Software Foundation; either version 2 of the License, or (at your 
00016  * option) any later version.
00017  * 
00018  * Ionflux Tools is distributed in the hope that it will be useful, but 
00019  * WITHOUT ANY WARRANTY; without even the implied warranty of 
00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00021  * General Public License for more details.
00022  * 
00023  * You should have received a copy of the GNU General Public License along 
00024  * with Ionflux Tools; if not, write to the Free Software Foundation, Inc.,
00025  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00026  * 
00027  * ========================================================================== */
00028 
00029 #include <string>
00030 #include <iostream>
00031 #include <sstream>
00032 #include <vector>
00033 #include <sys/stat.h>
00034 #include "ionflux/tools.hpp"
00035 #include "ionflux/DateTime.hpp"
00036 #include "ionflux/ObjectPool.hpp"
00037 
00038 namespace Ionflux
00039 {
00040 
00041 namespace Tools
00042 {
00043 
00049 class File
00050 : public Ionflux::Tools::ManagedObject
00051 {
00052     private:
00053         
00054     protected:
00056         struct stat statInfo;
00058         unsigned int size;
00060         time_t accessTime;
00062         time_t modTime;
00064         time_t changeTime;
00066         bool validity;
00068         std::string name;
00070         std::string path;
00072         std::string fullName;
00073         
00080         virtual bool updateStatInfo();
00081         
00082     public:
00087         File();
00088         
00095         File(const std::string& initFullName);
00096         
00101         virtual ~File();
00102         
00107         virtual void refresh();
00108         
00115         virtual bool isValid();
00116         
00123         virtual bool isDir();
00124         
00131         virtual unsigned int getSize();
00132         
00139         virtual time_t getAccessTime();
00140         
00147         virtual time_t getModTime();
00148         
00155         virtual time_t getChangeTime();
00156         
00163         virtual void setName(const std::string& newName);
00164         
00171         virtual void setPath(const std::string& newPath);
00172         
00179         virtual void setFullName(const std::string& newFullName);
00180         
00185         virtual std::string getName() const;
00186         
00191         virtual std::string getPath() const;
00192         
00197         virtual std::string getFullName() const;
00198 };
00199 
00200 }
00201 
00202 }
00203 
00207 #endif

Generated on Tue Mar 14 20:58:29 2006 for Ionflux Tools Class Library (iftools) by  doxygen 1.4.6