Code::Blocks  SVN r11506
macrosmanager.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
3  * http://www.gnu.org/licenses/lgpl-3.0.html
4  */
5 
6 #ifndef MACROSMANAGER_H
7 #define MACROSMANAGER_H
8 
9 #include "settings.h"
10 #include "manager.h"
11 #include <wx/regex.h>
12 #include <wx/filename.h>
13 
14 // forward decls;
15 class wxMenuBar;
16 class cbProject;
17 class ProjectBuildTarget;
18 class EditorBase;
20 
22 
23 class DLLIMPORT MacrosManager : public Mgr<MacrosManager>
24 {
25 public:
26  friend class Manager;
27  friend class Mgr<MacrosManager>;
28  void CreateMenu(wxMenuBar* menuBar);
29  void ReleaseMenu(wxMenuBar* menuBar);
30  void ReplaceMacros(wxString& buffer, ProjectBuildTarget* target = nullptr, bool subrequest = false);
31  wxString ReplaceMacros(const wxString& buffer, ProjectBuildTarget* target = nullptr);
32  void ReplaceEnvVars(wxString& buffer) { ReplaceMacros(buffer); } /* misnomer, should be ReplaceVariables */;
33  void RecalcVars(cbProject* project, EditorBase* editor, ProjectBuildTarget* target);
34  void ClearProjectKeys();
35  void Reset();
36 protected:
39 
42 
63 
64  MacrosMap m_Macros;
74 
75 private:
76  MacrosManager();
77  ~MacrosManager() override;
78  wxString EvalCondition(const wxString& cond, const wxString& true_clause, const wxString& false_clause, ProjectBuildTarget* target);
79  int MatchBrace(const wxString& buffer, int index);
80 };
81 
82 #endif // MACROSMANAGER_H
83 
wxString m_ProjectFiles
Definition: macrosmanager.h:56
wxFileName m_ProjectWxFileName
Definition: macrosmanager.h:40
wxString m_WorkspaceDir
Definition: macrosmanager.h:51
wxString m_Makefile
Definition: macrosmanager.h:57
wxRegEx m_RE_Script
Definition: macrosmanager.h:69
UserVariableManager * m_UserVarMan
Definition: macrosmanager.h:73
ProjectBuildTarget * m_LastTarget
Definition: macrosmanager.h:37
wxString m_ProjectDir
Definition: macrosmanager.h:54
wxArrayInt CreateMenu(wxMenuBar *mbar)
wxString m_ProjectFilename
Definition: macrosmanager.h:52
wxRegEx m_RE_RemoveQuotes
Definition: macrosmanager.h:72
wxString m_TargetOutputBaseName
Definition: macrosmanager.h:60
wxString m_TargetOutputDir
Definition: macrosmanager.h:58
wxString m_TargetFilename
Definition: macrosmanager.h:62
WX_DECLARE_STRING_HASH_MAP(wxString, MacrosMap)
wxString m_TargetOutputFilename
Definition: macrosmanager.h:61
#define DLLIMPORT
Definition: settings.h:16
wxString m_AppPath
Definition: macrosmanager.h:43
Represents a Code::Blocks project.
Definition: cbproject.h:96
wxString m_TargetName
Definition: macrosmanager.h:59
wxRegEx m_RE_DOS
Definition: macrosmanager.h:66
wxString m_Plugins
Definition: macrosmanager.h:45
Base class that all "editors" should inherit from.
Definition: editorbase.h:30
wxString m_WorkspaceName
Definition: macrosmanager.h:50
wxRegEx m_RE_Unix
Definition: macrosmanager.h:65
wxString m_WorkspaceFilename
Definition: macrosmanager.h:49
MacrosMap m_Macros
Definition: macrosmanager.h:64
Definition: manager.h:183
int m_ActiveEditorLine
Definition: macrosmanager.h:47
cbProject * m_LastProject
Definition: macrosmanager.h:38
wxString m_DataPath
Definition: macrosmanager.h:44
void ReplaceEnvVars(wxString &buffer)
Definition: macrosmanager.h:32
int m_ActiveEditorColumn
Definition: macrosmanager.h:48
wxRegEx m_RE_If
Definition: macrosmanager.h:67
wxString m_ActiveEditorFilename
Definition: macrosmanager.h:46
Represents a Code::Blocks project build target.
wxRegEx m_RE_To83Path
Definition: macrosmanager.h:71
wxRegEx m_RE_ToAbsolutePath
Definition: macrosmanager.h:70
wxFileName m_WorkspaceWxFileName
Definition: macrosmanager.h:41
wxRegEx m_RE_IfSp
Definition: macrosmanager.h:68
wxString m_ProjectName
Definition: macrosmanager.h:53
wxString m_ProjectTopDir
Definition: macrosmanager.h:55