00001 // ZenLib::ZtringListListF - ZtringListList with files 00002 // Copyright (C) 2002-2010 MediaArea.net SARL, Info@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 // ZtringListList with file load/save 00023 // 00024 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00025 00026 //--------------------------------------------------------------------------- 00027 #ifndef ZtringListListFH 00028 #define ZtringListListFH 00029 //--------------------------------------------------------------------------- 00030 00031 //--------------------------------------------------------------------------- 00032 #include "ZenLib/ZtringListList.h" 00033 //--------------------------------------------------------------------------- 00034 00035 namespace ZenLib 00036 { 00037 00038 //*************************************************************************** 00039 /// @brief ZtringListList with file management 00040 //*************************************************************************** 00041 00042 class ZtringListListF : public ZtringListList 00043 { 00044 public : 00045 //Constructors/Destructor 00046 ZtringListListF (); 00047 ZtringListListF (const ZtringListList &Source); 00048 ZtringListListF (const Ztring &Source); 00049 ZtringListListF (const Char *Source); 00050 #ifdef _UNICODE 00051 ZtringListListF (const char *Source); //convert a UTF-8 string into Unicode 00052 #endif 00053 00054 //File management 00055 bool Load (const Ztring &FileName=Ztring()); 00056 bool Save (const Ztring &FileName=Ztring()); 00057 bool Cancel (); 00058 00059 //Configuration 00060 // @brief enable or disable backup creation 00061 void Backup_Set (bool Save); 00062 // @brief Set the count of versions to save 00063 void Backup_Count_Set (int8u Count); 00064 // @brief Set if the content of file is a localized (=not UTF8) file 00065 void Local_Set (bool Local); 00066 00067 protected : 00068 Ztring Name; //Nom du fichier 00069 bool Sauvegarde; //Indicateur si on a le droit de sauvegarder (par defaut) 00070 int8u Backup_Nb_Max; //Nombre maxi de sauvegardes 00071 int8u Backup_Nb; //Nombre actuel de backups pour cette session 00072 bool Local; //if true, this is a local charset, else this is a UTF8 charset 00073 00074 //File management 00075 bool CSV_Charger (); 00076 bool CFG_Charger (); 00077 bool CSV_Sauvegarder (); 00078 bool CFG_Sauvegarder (); 00079 bool File_Load (); 00080 00081 //Divers 00082 bool NettoyerEspaces (Ztring &ANettoyer); //Enlever les espaces avant et apres 00083 00084 private: 00085 void ZtringListListF_Common(); 00086 }; 00087 00088 } //Namespace 00089 00090 #endif 00091