This file is indexed.

/usr/include/codeblocks/loggers.h is in codeblocks-dev 16.01+dfsg-2.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/*
 * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
 * http://www.gnu.org/licenses/lgpl-3.0.html
 */

#ifndef LOGGERS_H
#define LOGGERS_H

#include "logger.h"

#include <wx/colour.h>
#include <wx/font.h>
#include <wx/ffile.h>
#include <wx/textctrl.h>

class wxListCtrl;

// this file contains some kinds of loggers, they can save/record messages to different kind of devices
// all these specific logger classes are derived from Logger class defined in logger.h

/** a logger simply does nothing */
class DLLIMPORT NullLogger : public Logger
{
public:
    virtual void Append(cb_unused const wxString& msg, cb_unused Logger::level lv){};
};

/** a logger which prints messages to the standard console IO */
class DLLIMPORT StdoutLogger : public Logger
{
public:
    virtual void Append(const wxString& msg, Logger::level lv)
    {
        fputs(wxSafeConvertWX2MB(msg), lv < error ? stdout : stderr);
        fputs(::newline_string.mb_str(), lv < error ? stdout : stderr);
    }
};

/** a logger which prints messages to a file */
class DLLIMPORT FileLogger : public Logger
{
protected:
    wxFFile f;
public:
    FileLogger(const wxString& filename) : f(filename, _T("wb")) {};
    FileLogger() {};

    virtual void Append(const wxString& msg, cb_unused Logger::level lv)
    {
        fputs(wxSafeConvertWX2MB(msg), f.fp());
        fputs(::newline_string.mb_str(), f.fp());
    };

    virtual void Open(const wxString& filename) { Close(); f.Open(filename, _T("wb")); };
    virtual void Close(){ if(f.IsOpened()) f.Close(); };
};

/** Cascading Style Sheets class for HTML logger */
struct CSS
{
    wxString caption;
    wxString info;
    wxString warning;
    wxString success;
    wxString error;
    wxString critical;
    wxString failure;
    wxString pagetitle;
    wxString spacer;
    wxString asterisk;

    CSS();
    operator wxString();
};

/** a logger which prints messages to an HTML file */
class DLLIMPORT HTMLFileLogger : public FileLogger
{
    CSS css;
public:
    HTMLFileLogger(const wxString& filename);
    void SetCSS(const CSS& in_css) { css = in_css; };

    virtual void Append(const wxString& msg, Logger::level lv);
    virtual void Open(const wxString& filename);
    virtual void Close();
};

/** a logger which prints messages to a wxTextCtrl */
class DLLIMPORT TextCtrlLogger : public Logger
{
protected:

    wxTextCtrl* control;
    bool        fixed;
    wxTextAttr  style[num_levels];

public:
    TextCtrlLogger(bool fixedPitchFont = false);
    ~TextCtrlLogger();

    virtual void      CopyContentsToClipboard(bool selectionOnly = false);
    virtual void      UpdateSettings();
    virtual void      Append(const wxString& msg, Logger::level lv = info);
    virtual void      Clear();
    virtual wxWindow* CreateControl(wxWindow* parent);
    virtual bool      GetWrapMode() const;
    virtual void      ToggleWrapMode();
    virtual bool      HasFeature(Feature::Enum feature) const;
};

/** an extended logger from TextCtrlLogger, since it add time stamps for each log message */
class DLLIMPORT TimestampTextCtrlLogger : public TextCtrlLogger
{
public:
    virtual void Append(const wxString& msg, Logger::level lv = info);
};

/** a logger which prints messages to a wxListCtrl */
class DLLIMPORT ListCtrlLogger : public Logger
{
protected:

    wxListCtrl*   control;
    bool          fixed;
    wxArrayString titles;
    wxArrayInt    widths;

    struct ListStyles
    {
        wxFont font;
        wxColour colour;
    };
    ListStyles style[num_levels];

    wxString GetItemAsText(long item) const;
public:

    ListCtrlLogger(const wxArrayString& titles, const wxArrayInt& widths, bool fixedPitchFont = false);
    ~ListCtrlLogger();

    virtual void      CopyContentsToClipboard(bool selectionOnly = false);
    virtual void      UpdateSettings();
    virtual void      Append(const wxString& msg, Logger::level lv = info);
    virtual void      Append(const wxArrayString& colValues, Logger::level lv = info, int autoSize = -1);
    virtual size_t    GetItemsCount() const;
    virtual void      Clear();
    virtual wxWindow* CreateControl(wxWindow* parent);
    virtual bool      HasFeature(Feature::Enum feature) const;
    virtual void      AutoFitColumns(int column);
};

#endif // LOGGERS_H