1 /////////////////////////////////////////////////////////////////////////////
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 2 of the License, or
6 // (at your option) any later version.
8 // This program is distributed in the hope that it will be useful, but
9 // WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
16 /////////////////////////////////////////////////////////////////////////////
20 * @brief Declaration file ProjectFile class
24 #include "UnicodeString.h"
25 #include "PathContext.h"
28 * @brief Class for handling project files.
30 * This class loads and saves project files. Expat parser and SCEW wrapper for
31 * expat are used for XML parsing. We use UTF-8 encoding so Unicode paths are
36 friend class ProjectFileHandler;
39 bool Read(const String& path);
40 bool Save(const String& path) const;
43 bool HasMiddle() const;
44 bool HasRight() const;
45 bool HasFilter() const;
46 bool HasSubfolders() const;
48 String GetLeft(bool * pReadOnly = NULL) const;
49 bool GetLeftReadOnly() const;
50 String GetMiddle(bool * pReadOnly = NULL) const;
51 bool GetMiddleReadOnly() const;
52 String GetMiddle() const;
53 String GetRight(bool * pReadOnly = NULL) const;
54 bool GetRightReadOnly() const;
55 String GetFilter() const;
56 int GetSubfolders() const;
58 void SetLeft(const String& sLeft, const bool * pReadOnly = NULL);
59 void SetMiddle(const String& sMiddle, const bool * pReadOnly = NULL);
60 void SetRight(const String& sRight, const bool * pReadOnly = NULL);
61 void SetFilter(const String& sFilter);
62 void SetSubfolders(int iSubfolder);
64 void GetPaths(PathContext& files, bool & bSubFolders) const;
65 void SetPaths(const PathContext& files, bool bSubFolders = false);
67 static const String PROJECTFILE_EXT;
71 bool m_bHasLeft; /**< Has left path? */
72 bool m_bHasMiddle; /**< Has middle path? */
73 bool m_bHasRight; /**< Has right path? */
74 bool m_bHasFilter; /**< Has filter? */
75 String m_filter; /**< Filter name or mask */
76 bool m_bHasSubfolders; /**< Has subfolders? */
77 int m_subfolders; /**< Are subfolders included (recursive scan) */
78 bool m_bLeftReadOnly; /**< Is left path opened as read-only */
79 bool m_bMiddleReadOnly; /**< Is middle path opened as read-only */
80 bool m_bRightReadOnly; /**< Is right path opened as read-only */