00001 // ZenLib::File - standart files functions 00002 // Copyright (C) 2002-2003 Jérôme Martinez, Zen@MediaArea.net 00003 // 00004 // This software is provided 'as-is', without any express or implied 00005 // warranty. In no event will the authors be held liable for any damages 00006 // arising from the use of this software. 00007 // 00008 // Permission is granted to anyone to use this software for any purpose, 00009 // including commercial applications, and to alter it and redistribute it 00010 // freely, subject to the following restrictions: 00011 // 00012 // 1. The origin of this software must not be misrepresented; you must not 00013 // claim that you wrote the original software. If you use this software 00014 // in a product, an acknowledgment in the product documentation would be 00015 // appreciated but is not required. 00016 // 2. Altered source versions must be plainly marked as such, and must not be 00017 // misrepresented as being the original software. 00018 // 3. This notice may not be removed or altered from any source distribution. 00019 // 00020 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00021 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00022 // File 00023 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00024 // 00025 // Version 0.0.1 00026 // ------------- 00027 // Fonctions de base des entres sorties de fichiers 00028 // 00029 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00030 // 00031 // 1.0.0 (Zen@MediaArea.net) 00032 // Bases 00033 // 00034 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00035 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00036 00037 //--------------------------------------------------------------------------- 00038 #ifndef ZenFileH 00039 #define ZenFileH 00040 //--------------------------------------------------------------------------- 00041 00042 //--------------------------------------------------------------------------- 00043 #include <ZenLib/Conf.h> 00044 #include <ZenLib/ZtringList.h> 00045 //--------------------------------------------------------------------------- 00046 00047 namespace ZenLib 00048 { 00049 00050 //*************************************************************************** 00051 // Classe CFichier_Texte 00052 //*************************************************************************** 00053 00054 class File_ 00055 { 00056 public : 00057 //Gestion de la classe 00058 File_ (); 00059 ~File_ (); 00060 00061 //Ouverture/fermeture 00062 virtual int Ouvrir (const Ztring &Fichier, bool Nouveau=false, bool Ajout=false, bool Ecriture=false)=0; 00063 virtual void Fermer ()=0; 00064 00065 //Divers 00066 virtual bool Eof(); //Fin de fichier 00067 int Supprimer(); //Supprimer le fichier en cours 00068 Ztring Nom_Get(); 00069 uint64 Size_Get(); 00070 static uint64 Size_Get(const Ztring &Fichier); 00071 00072 //Utils 00073 static int Supprimer(Ztring &Fichier); //Supprimer le fichier cite 00074 static ZtringList Chercher(Ztring Liste); //Rechercher la liste de fichier 00075 static int Exist(Ztring File); //Le fichier existe? 00076 static int Copy(Ztring &Existing, Ztring &New, int FailExist=0); //FailExist=false --> Overwrite 00077 00078 protected : 00079 bool End; //Indicateur de fin de fichier 00080 Ztring Nom; //Nom du fichier en cours 00081 }; 00082 00083 } //Namespace 00084 00085 #endif