-
Notifications
You must be signed in to change notification settings - Fork 461
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Vitalii Koshura <[email protected]> Co-authored-by: Vittorio Parrella <[email protected]> Signed-off-by: Vitalii Koshura <[email protected]>
- Loading branch information
Showing
198 changed files
with
23,028 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -250,3 +250,4 @@ parts/ | |
prime/ | ||
stage/ | ||
*.snap | ||
*.msi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,7 @@ | |
"default-features": false | ||
}, | ||
"gtest", | ||
"opencl" | ||
"opencl", | ||
"nlohmann-json" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
}, | ||
"gtest", | ||
"ftgl", | ||
"opencl" | ||
"opencl", | ||
"nlohmann-json" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// This file is part of BOINC. | ||
// https://boinc.berkeley.edu | ||
// Copyright (C) 2024 University of California | ||
// | ||
// BOINC is free software; you can redistribute it and/or modify it | ||
// under the terms of the GNU Lesser General Public License | ||
// as published by the Free Software Foundation, | ||
// either version 3 of the License, or (at your option) any later version. | ||
// | ||
// BOINC is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
// See the GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
#include <sstream> | ||
|
||
#include "Action.h" | ||
#include "MsiHelper.h" | ||
#include "JsonHelper.h" | ||
|
||
Action::Action(const nlohmann::json& json) { | ||
JsonHelper::get(json, "Action", action); | ||
JsonHelper::get(json, "Condition", condition); | ||
JsonHelper::get(json, "Sequence", sequence); | ||
} | ||
|
||
MSIHANDLE Action::getRecord() const { | ||
return MsiHelper::MsiRecordSet({ action, condition, sequence }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// This file is part of BOINC. | ||
// https://boinc.berkeley.edu | ||
// Copyright (C) 2024 University of California | ||
// | ||
// BOINC is free software; you can redistribute it and/or modify it | ||
// under the terms of the GNU Lesser General Public License | ||
// as published by the Free Software Foundation, | ||
// either version 3 of the License, or (at your option) any later version. | ||
// | ||
// BOINC is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
// See the GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
#pragma once | ||
|
||
#include <sstream> | ||
#include <nlohmann/json.hpp> | ||
|
||
#include "Record.h" | ||
|
||
class Action : public Record { | ||
public: | ||
explicit Action(const nlohmann::json& json); | ||
~Action() = default; | ||
MSIHANDLE getRecord() const override; | ||
private: | ||
std::string action{}; | ||
std::string condition{}; | ||
int sequence = 0; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// This file is part of BOINC. | ||
// https://boinc.berkeley.edu | ||
// Copyright (C) 2024 University of California | ||
// | ||
// BOINC is free software; you can redistribute it and/or modify it | ||
// under the terms of the GNU Lesser General Public License | ||
// as published by the Free Software Foundation, | ||
// either version 3 of the License, or (at your option) any later version. | ||
// | ||
// BOINC is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
// See the GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
#include <sstream> | ||
|
||
#include "ActionText.h" | ||
#include "MsiHelper.h" | ||
#include "JsonHelper.h" | ||
|
||
ActionText::ActionText(const nlohmann::json& json, | ||
const InstallerStrings& installerStrings) { | ||
JsonHelper::get(json, "Action", action); | ||
JsonHelper::get(json, "Description", description, installerStrings); | ||
JsonHelper::get(json, "Template", tmplt, installerStrings); | ||
} | ||
|
||
MSIHANDLE ActionText::getRecord() const { | ||
return MsiHelper::MsiRecordSet({ action, description, tmplt }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// This file is part of BOINC. | ||
// https://boinc.berkeley.edu | ||
// Copyright (C) 2024 University of California | ||
// | ||
// BOINC is free software; you can redistribute it and/or modify it | ||
// under the terms of the GNU Lesser General Public License | ||
// as published by the Free Software Foundation, | ||
// either version 3 of the License, or (at your option) any later version. | ||
// | ||
// BOINC is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
// See the GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
#pragma once | ||
|
||
#include <nlohmann/json.hpp> | ||
|
||
#include "Record.h" | ||
#include "InstallerStrings.h" | ||
|
||
class ActionText : public Record { | ||
public: | ||
explicit ActionText(const nlohmann::json& json, | ||
const InstallerStrings& installerStrings); | ||
~ActionText() = default; | ||
MSIHANDLE getRecord() const override; | ||
private: | ||
std::string action{}; | ||
std::string description{}; | ||
std::string tmplt{}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// This file is part of BOINC. | ||
// https://boinc.berkeley.edu | ||
// Copyright (C) 2024 University of California | ||
// | ||
// BOINC is free software; you can redistribute it and/or modify it | ||
// under the terms of the GNU Lesser General Public License | ||
// as published by the Free Software Foundation, | ||
// either version 3 of the License, or (at your option) any later version. | ||
// | ||
// BOINC is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
// See the GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
#include <iostream> | ||
|
||
#include "ActionTextTable.h" | ||
|
||
ActionTextTable::ActionTextTable(const nlohmann::json& json, | ||
const InstallerStrings& installerStrings) { | ||
std::cout << "Loading ActionTextTable..." << std::endl; | ||
for (const auto& item : json) { | ||
values.emplace_back(item, installerStrings); | ||
} | ||
} | ||
|
||
bool ActionTextTable::generate(MSIHANDLE hDatabase) { | ||
std::cout << "Generating ActionTextTable..." << std::endl; | ||
|
||
const auto sql_create = "CREATE TABLE `ActionText` " | ||
"(`Action` CHAR(72) NOT NULL, `Description` LONGCHAR LOCALIZABLE, " | ||
"`Template` LONGCHAR LOCALIZABLE PRIMARY KEY `Action`)"; | ||
const auto sql_insert = "INSERT INTO `ActionText` " | ||
"(`Action`, `Description`, `Template`) VALUES (?, ?, ?)"; | ||
|
||
return Generator::generate(hDatabase, sql_create, sql_insert, values); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// This file is part of BOINC. | ||
// https://boinc.berkeley.edu | ||
// Copyright (C) 2024 University of California | ||
// | ||
// BOINC is free software; you can redistribute it and/or modify it | ||
// under the terms of the GNU Lesser General Public License | ||
// as published by the Free Software Foundation, | ||
// either version 3 of the License, or (at your option) any later version. | ||
// | ||
// BOINC is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
// See the GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
#pragma once | ||
|
||
#include <nlohmann/json.hpp> | ||
|
||
#include "ActionText.h" | ||
#include "InstallerStrings.h" | ||
#include "Generator.h" | ||
|
||
class ActionTextTable : public Generator<ActionText>{ | ||
public: | ||
explicit ActionTextTable(const nlohmann::json& json, | ||
const InstallerStrings& installerStrings); | ||
~ActionTextTable() = default; | ||
bool generate(MSIHANDLE hDatabase) override; | ||
private: | ||
std::vector<ActionText> values{}; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// This file is part of BOINC. | ||
// https://boinc.berkeley.edu | ||
// Copyright (C) 2024 University of California | ||
// | ||
// BOINC is free software; you can redistribute it and/or modify it | ||
// under the terms of the GNU Lesser General Public License | ||
// as published by the Free Software Foundation, | ||
// either version 3 of the License, or (at your option) any later version. | ||
// | ||
// BOINC is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
// See the GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
#include "AdminExecuteSequenceTable.h" | ||
|
||
AdminExecuteSequenceTable::AdminExecuteSequenceTable( | ||
const nlohmann::json& json) { | ||
std::cout << "Loading AdminExecuteSequenceTable..." << std::endl; | ||
|
||
for (const auto& value : json) { | ||
actions.emplace_back(value); | ||
} | ||
} | ||
|
||
bool AdminExecuteSequenceTable::generate(MSIHANDLE hDatabase) { | ||
std::cout << "Generating AdminExecuteSequenceTable..." << std::endl; | ||
|
||
const auto sql_create = "CREATE TABLE `AdminExecuteSequence` " | ||
"(`Action` CHAR(72) NOT NULL, `Condition` CHAR(255), " | ||
"`Sequence` SHORT PRIMARY KEY `Action`)"; | ||
const auto sql_insert = "INSERT INTO `AdminExecuteSequence` " | ||
"(`Action`, `Condition`, `Sequence`) VALUES (?, ?, ?)"; | ||
|
||
return Generator::generate(hDatabase, sql_create, sql_insert, actions); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// This file is part of BOINC. | ||
// https://boinc.berkeley.edu | ||
// Copyright (C) 2024 University of California | ||
// | ||
// BOINC is free software; you can redistribute it and/or modify it | ||
// under the terms of the GNU Lesser General Public License | ||
// as published by the Free Software Foundation, | ||
// either version 3 of the License, or (at your option) any later version. | ||
// | ||
// BOINC is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
// See the GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
#pragma once | ||
|
||
#include <vector> | ||
#include <nlohmann/json.hpp> | ||
|
||
#include "Action.h" | ||
#include "Generator.h" | ||
|
||
class AdminExecuteSequenceTable : public Generator<Action>{ | ||
public: | ||
explicit AdminExecuteSequenceTable(const nlohmann::json& json); | ||
~AdminExecuteSequenceTable() = default; | ||
bool generate(MSIHANDLE hDatabase) override; | ||
private: | ||
std::vector<Action> actions{}; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// This file is part of BOINC. | ||
// https://boinc.berkeley.edu | ||
// Copyright (C) 2024 University of California | ||
// | ||
// BOINC is free software; you can redistribute it and/or modify it | ||
// under the terms of the GNU Lesser General Public License | ||
// as published by the Free Software Foundation, | ||
// either version 3 of the License, or (at your option) any later version. | ||
// | ||
// BOINC is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
// See the GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
#include "AdminUISequenceTable.h" | ||
|
||
AdminUISequenceTable::AdminUISequenceTable(const nlohmann::json& json) { | ||
std::cout << "Loading AdminUISequenceTable..." << std::endl; | ||
for (const auto& value : json) { | ||
actions.emplace_back(value); | ||
} | ||
} | ||
|
||
bool AdminUISequenceTable::generate(MSIHANDLE hDatabase) { | ||
std::cout << "Generating AdminUISequenceTable..." << std::endl; | ||
|
||
const auto sql_create = "CREATE TABLE `AdminUISequence` " | ||
"(`Action` CHAR(72) NOT NULL, `Condition` CHAR(255), " | ||
"`Sequence` SHORT PRIMARY KEY `Action`)"; | ||
const auto sql_insert = "INSERT INTO `AdminUISequence` " | ||
"(`Action`, `Condition`, `Sequence`) VALUES (?, ?, ?)"; | ||
|
||
return Generator::generate(hDatabase, sql_create, sql_insert, actions); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// This file is part of BOINC. | ||
// https://boinc.berkeley.edu | ||
// Copyright (C) 2024 University of California | ||
// | ||
// BOINC is free software; you can redistribute it and/or modify it | ||
// under the terms of the GNU Lesser General Public License | ||
// as published by the Free Software Foundation, | ||
// either version 3 of the License, or (at your option) any later version. | ||
// | ||
// BOINC is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
// See the GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with BOINC. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
#pragma once | ||
|
||
#include "Action.h" | ||
#include "Generator.h" | ||
|
||
class AdminUISequenceTable : public Generator<Action> { | ||
public: | ||
explicit AdminUISequenceTable(const nlohmann::json& json); | ||
~AdminUISequenceTable() = default; | ||
bool generate(MSIHANDLE hDatabase) override; | ||
private: | ||
std::vector<Action> actions{}; | ||
}; |
Oops, something went wrong.