icinga2/lib/db_ido/dbquery.cpp
Yonas Habteab 91c7e60df8 Replace all existing copyright headers with SPDX headers
I've used the following command to replace the original copyright header
lines in a C-style comment block:

```
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f -exec perl -pi -e 's{/\*[^*]*\(\s*c\s*\)\s*(\d{4})\s*Icinga\s+GmbH[^*]*\*/}{// SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n// SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
```

For files that use shell-style comments (#) like CMakeLists.txt, I've
used this command:

```
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f -exec perl -pi -e 's{#.*\(\s*c\s*\)\s(\d{4})\sIcinga\s+GmbH.*}{# SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n# SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
```

And for SQL files:

```
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f \( -name '*.sql' \) -exec perl -pi -e 's{--.*\(c\)\s(\d{4})\sIcinga\sGmbH.*}{-- SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n-- SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
$ find . \( -type d \( -name '\..*' -o -name third-party -o -name scripts -o -name prefix -o -name malloc -o -name server -o -name docker -o -name build -o -name doc \) -prune \) -o -type f \( -name '*.sql' \) -exec perl -pi -e 's{-- Copyright \(c\)\s(\d{4})\sIcinga\s+Development\sTeam.*}{-- SPDX-FileCopyrightText: \1 Icinga GmbH <https://icinga.com>\n-- SPDX-License-Identifier: GPL-2.0-or-later}gi' {} +
```
2026-02-04 14:00:05 +01:00

53 lines
2.2 KiB
C++

// SPDX-FileCopyrightText: 2012 Icinga GmbH <https://icinga.com>
// SPDX-License-Identifier: GPL-2.0-or-later
#include "db_ido/dbquery.hpp"
#include "base/initialize.hpp"
#include "base/scriptglobal.hpp"
using namespace icinga;
INITIALIZE_ONCE(&DbQuery::StaticInitialize);
std::map<String, int> DbQuery::m_CategoryFilterMap;
void DbQuery::StaticInitialize()
{
ScriptGlobal::Set("Icinga.DbCatConfig", DbCatConfig);
ScriptGlobal::Set("Icinga.DbCatState", DbCatState);
ScriptGlobal::Set("Icinga.DbCatAcknowledgement", DbCatAcknowledgement);
ScriptGlobal::Set("Icinga.DbCatComment", DbCatComment);
ScriptGlobal::Set("Icinga.DbCatDowntime", DbCatDowntime);
ScriptGlobal::Set("Icinga.DbCatEventHandler", DbCatEventHandler);
ScriptGlobal::Set("Icinga.DbCatExternalCommand", DbCatExternalCommand);
ScriptGlobal::Set("Icinga.DbCatFlapping", DbCatFlapping);
ScriptGlobal::Set("Icinga.DbCatCheck", DbCatCheck);
ScriptGlobal::Set("Icinga.DbCatLog", DbCatLog);
ScriptGlobal::Set("Icinga.DbCatNotification", DbCatNotification);
ScriptGlobal::Set("Icinga.DbCatProgramStatus", DbCatProgramStatus);
ScriptGlobal::Set("Icinga.DbCatRetention", DbCatRetention);
ScriptGlobal::Set("Icinga.DbCatStateHistory", DbCatStateHistory);
ScriptGlobal::Set("Icinga.DbCatEverything", DbCatEverything);
m_CategoryFilterMap["DbCatConfig"] = DbCatConfig;
m_CategoryFilterMap["DbCatState"] = DbCatState;
m_CategoryFilterMap["DbCatAcknowledgement"] = DbCatAcknowledgement;
m_CategoryFilterMap["DbCatComment"] = DbCatComment;
m_CategoryFilterMap["DbCatDowntime"] = DbCatDowntime;
m_CategoryFilterMap["DbCatEventHandler"] = DbCatEventHandler;
m_CategoryFilterMap["DbCatExternalCommand"] = DbCatExternalCommand;
m_CategoryFilterMap["DbCatFlapping"] = DbCatFlapping;
m_CategoryFilterMap["DbCatCheck"] = DbCatCheck;
m_CategoryFilterMap["DbCatLog"] = DbCatLog;
m_CategoryFilterMap["DbCatNotification"] = DbCatNotification;
m_CategoryFilterMap["DbCatProgramStatus"] = DbCatProgramStatus;
m_CategoryFilterMap["DbCatRetention"] = DbCatRetention;
m_CategoryFilterMap["DbCatStateHistory"] = DbCatStateHistory;
m_CategoryFilterMap["DbCatEverything"] = DbCatEverything;
}
const std::map<String, int>& DbQuery::GetCategoryFilterMap()
{
return m_CategoryFilterMap;
}