~ubuntu-branches/ubuntu/karmic/codelite/karmic

« back to all changes in this revision

Viewing changes to CodeLite/archive.h

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2009-08-15 17:42:43 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090815174243-nlb9ikgigbiybz12
Tags: 1.0.2893+dfsg-0ubuntu1
* debian/rules:
  + Tidy up get-orig-source rule
* debian/control:
  + Bump Standards-Version
  + Change Maintainer email address to @ubuntu.com
  + Drop cdbs build-dependency
* debian/copyright:
  + Update to DEP-5 format
* debian/patches/00_add-fPIC.patch:
  + Dropped, fix upstream
* Closes LP: #413992

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//////////////////////////////////////////////////////////////////////////////
2
 
//////////////////////////////////////////////////////////////////////////////
3
 
//
4
 
// copyright            : (C) 2008 by Eran Ifrah                            
5
 
// file name            : archive.h              
6
 
//                                                                          
7
 
// -------------------------------------------------------------------------
8
 
// A                                                                        
9
 
//              _____           _      _     _ _                            
10
 
//             /  __ \         | |    | |   (_) |                           
11
 
//             | /  \/ ___   __| | ___| |    _| |_ ___                      
12
 
//             | |    / _ \ / _  |/ _ \ |   | | __/ _ )                     
13
 
//             | \__/\ (_) | (_| |  __/ |___| | ||  __/                     
14
 
//              \____/\___/ \__,_|\___\_____/_|\__\___|                     
15
 
//                                                                          
16
 
//                                                  F i l e                 
17
 
//                                                                          
18
 
//    This program is free software; you can redistribute it and/or modify  
19
 
//    it under the terms of the GNU General Public License as published by  
20
 
//    the Free Software Foundation; either version 2 of the License, or     
21
 
//    (at your option) any later version.                                   
22
 
//                                                                          
23
 
//////////////////////////////////////////////////////////////////////////////
24
 
//////////////////////////////////////////////////////////////////////////////
25
 
 #ifndef ARCHIVE_H
26
 
#define ARCHIVE_H
27
 
 
28
 
#include "wx/string.h"
29
 
#include "wx/hashmap.h"
30
 
#include <wx/arrstr.h>
31
 
#include "wx/filename.h"
32
 
#include <wx/gdicmn.h>
33
 
#include <vector>
34
 
#include <map>
35
 
 
36
 
class wxXmlNode;
37
 
 
38
 
#ifndef WXDLLIMPEXP_CL
39
 
#ifdef WXMAKINGDLL_CODELITE
40
 
#    define WXDLLIMPEXP_CL WXEXPORT
41
 
#elif defined(WXUSINGDLL_CODELITE)
42
 
#    define WXDLLIMPEXP_CL WXIMPORT
43
 
#else /* not making nor using FNB as DLL */
44
 
#    define WXDLLIMPEXP_CL
45
 
#endif // WXMAKINGDLL_CODELITE
46
 
#endif // WXDLLIMPEXP_CL
47
 
 
48
 
class SerializedObject;
49
 
class TabInfo;
50
 
 
51
 
WX_DECLARE_STRING_HASH_MAP( wxString, StringMap );
52
 
 
53
 
/**
54
 
 * \class Archive
55
 
 * \brief an auxulariy class which serializes variables into XML format
56
 
 * \author Eran
57
 
 * \date 07/20/07
58
 
 */
59
 
class WXDLLIMPEXP_CL Archive
60
 
{
61
 
        wxXmlNode *m_root;
62
 
 
63
 
public:
64
 
        Archive();
65
 
        virtual ~Archive();
66
 
 
67
 
        /**
68
 
         * \brief set a root node for this Archive object, all Write operations will append their nodes
69
 
         * to this node
70
 
         * \param node wxXmlNode to act as the root
71
 
         */
72
 
        void SetXmlNode(wxXmlNode *node);
73
 
 
74
 
        //--------------------
75
 
        // Write API
76
 
        //--------------------
77
 
        bool Write(const wxString &name, SerializedObject *obj);
78
 
        bool Write(const wxString &name, int value);
79
 
        bool Write(const wxString &name, bool value);
80
 
        bool Write(const wxString &name, long value);
81
 
        bool Write(const wxString &name, const wxString &str);
82
 
        bool Write(const wxString &name, const wxArrayString &arr);
83
 
        bool Write(const wxString &name, const wxFileName &fileName);
84
 
        bool Write(const wxString &name, size_t value);
85
 
        bool Write(const wxString &name, wxSize size);
86
 
        bool Write(const wxString &name, wxPoint pt);
87
 
        bool Write(const wxString &name, const StringMap &str_map);
88
 
        bool Write(const wxString &name, const wxColour &colour);
89
 
        bool Write(const wxString &name, std::vector<TabInfo>& _vTabInfoArr);
90
 
        bool Write(const wxString &name, const std::map<wxString, wxString> &strinMap);
91
 
        
92
 
        //--------------------
93
 
        // Read API
94
 
        //--------------------
95
 
        bool Read(const wxString &name, int &value);
96
 
        bool Read(const wxString &name, bool &value);
97
 
        bool Read(const wxString &name, long &value);
98
 
        bool Read(const wxString &name, wxString &value);
99
 
        bool Read(const wxString &name, wxArrayString &arr);
100
 
        bool Read(const wxString &name, wxFileName &fileName);
101
 
        bool Read(const wxString &name, size_t &value);
102
 
        bool Read(const wxString &name, wxSize &size);
103
 
        bool Read(const wxString &name, wxPoint &pt);
104
 
        bool Read(const wxString &name, StringMap &str_map);
105
 
        bool Read(const wxString &name, SerializedObject *obj);
106
 
        bool Read(const wxString &name, wxColour &colour);      
107
 
        bool Read(const wxString &name, std::vector<TabInfo>& _vTabInfoArr);
108
 
        bool Read(const wxString &name, std::map<wxString, wxString> &strinMap);
109
 
        
110
 
private:
111
 
        bool WriteSimple(long value, const wxString &typeName, const wxString &name);
112
 
        bool ReadSimple(long &value, const wxString &typeName, const wxString &name);
113
 
};
114
 
 
115
 
 
116
 
#endif //ARCHIVE_H
 
1
//////////////////////////////////////////////////////////////////////////////
 
2
//////////////////////////////////////////////////////////////////////////////
 
3
//
 
4
// copyright            : (C) 2008 by Eran Ifrah
 
5
// file name            : archive.h
 
6
//
 
7
// -------------------------------------------------------------------------
 
8
// A
 
9
//              _____           _      _     _ _
 
10
//             /  __ \         | |    | |   (_) |
 
11
//             | /  \/ ___   __| | ___| |    _| |_ ___
 
12
//             | |    / _ \ / _  |/ _ \ |   | | __/ _ )
 
13
//             | \__/\ (_) | (_| |  __/ |___| | ||  __/
 
14
//              \____/\___/ \__,_|\___\_____/_|\__\___|
 
15
//
 
16
//                                                  F i l e
 
17
//
 
18
//    This program is free software; you can redistribute it and/or modify
 
19
//    it under the terms of the GNU General Public License as published by
 
20
//    the Free Software Foundation; either version 2 of the License, or
 
21
//    (at your option) any later version.
 
22
//
 
23
//////////////////////////////////////////////////////////////////////////////
 
24
//////////////////////////////////////////////////////////////////////////////
 
25
 #ifndef ARCHIVE_H
 
26
#define ARCHIVE_H
 
27
 
 
28
#include "wx/string.h"
 
29
#include "wx/hashmap.h"
 
30
#include <wx/arrstr.h>
 
31
#include "wx/filename.h"
 
32
#include <wx/gdicmn.h>
 
33
#include <vector>
 
34
#include <map>
 
35
 
 
36
class wxXmlNode;
 
37
 
 
38
#ifndef WXDLLIMPEXP_CL
 
39
#ifdef WXMAKINGDLL_CODELITE
 
40
#    define WXDLLIMPEXP_CL WXEXPORT
 
41
#elif defined(WXUSINGDLL_CODELITE)
 
42
#    define WXDLLIMPEXP_CL WXIMPORT
 
43
#else /* not making nor using FNB as DLL */
 
44
#    define WXDLLIMPEXP_CL
 
45
#endif // WXMAKINGDLL_CODELITE
 
46
#endif // WXDLLIMPEXP_CL
 
47
 
 
48
class SerializedObject;
 
49
class TabInfo;
 
50
class BreakpointInfo;
 
51
 
 
52
WX_DECLARE_STRING_HASH_MAP( wxString, StringMap );
 
53
 
 
54
/**
 
55
 * \class Archive
 
56
 * \brief an auxulariy class which serializes variables into XML format
 
57
 * \author Eran
 
58
 * \date 07/20/07
 
59
 */
 
60
class WXDLLIMPEXP_CL Archive
 
61
{
 
62
        wxXmlNode *m_root;
 
63
 
 
64
public:
 
65
        Archive();
 
66
        virtual ~Archive();
 
67
 
 
68
        /**
 
69
         * \brief set a root node for this Archive object, all Write operations will append their nodes
 
70
         * to this node
 
71
         * \param node wxXmlNode to act as the root
 
72
         */
 
73
        void SetXmlNode(wxXmlNode *node);
 
74
 
 
75
        //--------------------
 
76
        // Write API
 
77
        //--------------------
 
78
        bool Write(const wxString &name, SerializedObject *obj);
 
79
        bool Write(const wxString &name, int value);
 
80
        bool Write(const wxString &name, bool value);
 
81
        bool Write(const wxString &name, long value);
 
82
        bool Write(const wxString &name, const wxString &str);
 
83
        bool Write(const wxString &name, const wxArrayString &arr);
 
84
        bool Write(const wxString &name, const wxFileName &fileName);
 
85
        bool Write(const wxString &name, size_t value);
 
86
        bool Write(const wxString &name, wxSize size);
 
87
        bool Write(const wxString &name, wxPoint pt);
 
88
        bool Write(const wxString &name, const StringMap &str_map);
 
89
        bool Write(const wxString &name, const wxColour &colour);
 
90
        bool Write(const wxString &name, std::vector<TabInfo>& _vTabInfoArr);
 
91
        bool Write(const wxString &name, const std::map<wxString, wxString> &strinMap);
 
92
 
 
93
 
 
94
        //--------------------
 
95
        // Read API
 
96
        //--------------------
 
97
        bool Read(const wxString &name, int &value);
 
98
        bool Read(const wxString &name, bool &value);
 
99
        bool Read(const wxString &name, long &value);
 
100
        bool Read(const wxString &name, wxString &value);
 
101
        bool Read(const wxString &name, wxArrayString &arr);
 
102
        bool Read(const wxString &name, wxFileName &fileName);
 
103
        bool Read(const wxString &name, size_t &value);
 
104
        bool Read(const wxString &name, wxSize &size);
 
105
        bool Read(const wxString &name, wxPoint &pt);
 
106
        bool Read(const wxString &name, StringMap &str_map);
 
107
        bool Read(const wxString &name, SerializedObject *obj);
 
108
        bool Read(const wxString &name, wxColour &colour);
 
109
        bool Read(const wxString &name, std::vector<TabInfo>& _vTabInfoArr);
 
110
        bool Read(const wxString &name, std::map<wxString, wxString> &strinMap);
 
111
 
 
112
private:
 
113
        bool WriteSimple(long value, const wxString &typeName, const wxString &name);
 
114
        bool ReadSimple(long &value, const wxString &typeName, const wxString &name);
 
115
};
 
116
 
 
117
 
 
118
#endif //ARCHIVE_H