File: compilererrors.h

package info (click to toggle)
codeblocks 16.01%2Bdfsg-2.1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 85,420 kB
  • ctags: 90,657
  • sloc: cpp: 665,947; ansic: 48,306; sh: 32,198; xml: 29,690; makefile: 6,054; asm: 3,827; python: 3,251; f90: 1,202; pascal: 839; yacc: 291; perl: 261; sed: 16
file content (57 lines) | stat: -rw-r--r-- 1,563 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
 * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
 * http://www.gnu.org/licenses/gpl-3.0.html
 */

#ifndef COMPILERERRORS_H
#define COMPILERERRORS_H

#include <wx/arrstr.h>
#include <wx/dynarray.h>
#include <wx/string.h>
#include "compiler.h" // CompilerLineType

class cbProject;

struct CompileError
{
    CompilerLineType lineType;
    cbProject* project;
    wxString filename;
    long int line;
    wxArrayString errors;
};
WX_DECLARE_OBJARRAY(CompileError, ErrorsArray);

class CompilerErrors
{
    public:
        CompilerErrors();
        virtual ~CompilerErrors();

        void AddError(CompilerLineType lt, cbProject* project, const wxString& filename, long int line, const wxString& error);

        void GotoError(int nr);
        void Next();
        void Previous();
        void Clear();
        bool HasNextError() const;
        bool HasPreviousError() const;
        int GetCount() const { return m_Errors.GetCount(); }
        wxString GetErrorString(int index);

        unsigned int GetCount(CompilerLineType lt) const;

        int GetFirstError() const;
        int GetFocusedError() const { return m_ErrorIndex; }
    private:
        void DoAddError(const CompileError& error);
        void DoGotoError(const CompileError& error);
        void DoClearErrorMarkFromAllEditors();
        int ErrorLineHasMore(const wxString& filename, long int line) const; // returns the index in the array
        ErrorsArray m_Errors;
        int m_ErrorIndex;
};

#endif // COMPILERERRORS_H