00001 /* Copyright (c) MediaArea.net SARL. All Rights Reserved. 00002 * 00003 * Use of this source code is governed by a zlib-style license that can 00004 * be found in the License.txt file in the root of the source tree. 00005 */ 00006 00007 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00008 // 00009 // ZtringListList with file load/save 00010 // 00011 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 00012 00013 //--------------------------------------------------------------------------- 00014 #ifndef ZtringListListFH 00015 #define ZtringListListFH 00016 //--------------------------------------------------------------------------- 00017 00018 //--------------------------------------------------------------------------- 00019 #include "ZenLib/ZtringListList.h" 00020 //--------------------------------------------------------------------------- 00021 00022 namespace ZenLib 00023 { 00024 00025 //*************************************************************************** 00026 /// @brief ZtringListList with file management 00027 //*************************************************************************** 00028 00029 class ZtringListListF : public ZtringListList 00030 { 00031 public : 00032 //Constructors/Destructor 00033 ZtringListListF (); 00034 ZtringListListF (const ZtringListList &Source); 00035 ZtringListListF (const Ztring &Source); 00036 ZtringListListF (const Char *Source); 00037 #ifdef _UNICODE 00038 ZtringListListF (const char *Source); //convert a UTF-8 string into Unicode 00039 #endif 00040 00041 //File management 00042 bool Load (const Ztring &FileName=Ztring()); 00043 bool Save (const Ztring &FileName=Ztring()); 00044 bool Cancel (); 00045 00046 //Configuration 00047 // @brief enable or disable backup creation 00048 void Backup_Set (bool Save); 00049 // @brief Set the count of versions to save 00050 void Backup_Count_Set (int8u Count); 00051 // @brief Set if the content of file is a localized (=not UTF8) file 00052 void Local_Set (bool Local); 00053 00054 protected : 00055 Ztring Name; //Nom du fichier 00056 bool Sauvegarde; //Indicateur si on a le droit de sauvegarder (par defaut) 00057 int8u Backup_Nb_Max; //Nombre maxi de sauvegardes 00058 int8u Backup_Nb; //Nombre actuel de backups pour cette session 00059 bool Local; //if true, this is a local charset, else this is a UTF8 charset 00060 00061 //File management 00062 bool CSV_Charger (); 00063 bool CFG_Charger (); 00064 bool CSV_Sauvegarder (); 00065 bool CFG_Sauvegarder (); 00066 bool File_Load (); 00067 00068 //Divers 00069 bool NettoyerEspaces (Ztring &ANettoyer); //Enlever les espaces avant et apres 00070 00071 private: 00072 void ZtringListListF_Common(); 00073 }; 00074 00075 } //Namespace 00076 00077 #endif