Rename .h file extension to .hpp, and fix some include orderings

This commit is contained in:
Stefan Müller 2024-12-11 01:12:27 +01:00
parent f2126f6c7c
commit fa38fa695b
51 changed files with 73 additions and 71 deletions

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/Program.h> #include <aoc/Program.hpp>
int main() int main()
{ {

View File

@ -17,7 +17,7 @@
#include <vector> #include <vector>
#include "LinesSolver.h" #include <aoc/LinesSolver.hpp>
class CeresSearch : class CeresSearch :
public LinesSolver public LinesSolver

View File

@ -15,7 +15,7 @@
#pragma once #pragma once
#include "LinesSolver.h" #include <aoc/LinesSolver.hpp>
class GuardGallivant : class GuardGallivant :
public LinesSolver public LinesSolver

View File

@ -17,7 +17,7 @@
#include <set> #include <set>
#include <aoc/Solver.h> #include <aoc/Solver.hpp>
class HistorianHysteria class HistorianHysteria
: public Solver : public Solver

View File

@ -17,8 +17,8 @@
#include <vector> #include <vector>
#include "Solver.h" #include <aoc/Point2.hpp>
#include "Point2.h" #include <aoc/Solver.hpp>
class LinesSolver : class LinesSolver :
public Solver public Solver

View File

@ -15,7 +15,7 @@
#pragma once #pragma once
#include <aoc/StringState.h> #include <aoc/StringState.hpp>
class MullCharState class MullCharState
: public StringState : public StringState

View File

@ -15,8 +15,8 @@
#pragma once #pragma once
#include <aoc/MullData.h> #include <aoc/MullData.hpp>
#include <aoc/StringState.h> #include <aoc/StringState.hpp>
class MullDataState class MullDataState
: public StringState : public StringState

View File

@ -15,7 +15,7 @@
#pragma once #pragma once
#include <aoc/MullDataState.h> #include <aoc/MullDataState.hpp>
class MullDoOpenState class MullDoOpenState
: public MullDataState : public MullDataState

View File

@ -15,7 +15,7 @@
#pragma once #pragma once
#include <aoc/StringState.h> #include <aoc/StringState.hpp>
class MullEntryState class MullEntryState
: public StringState : public StringState

View File

@ -15,7 +15,7 @@
#pragma once #pragma once
#include <aoc/MullDataState.h> #include <aoc/MullDataState.hpp>
class MullFactorState class MullFactorState
: public MullDataState : public MullDataState

View File

@ -15,9 +15,9 @@
#pragma once #pragma once
#include <aoc/MullData.h> #include <aoc/MullData.hpp>
#include <aoc/MullStates.h> #include <aoc/MullStates.hpp>
#include <aoc/Solver.h> #include <aoc/Solver.hpp>
class MullItOver class MullItOver
: public Solver : public Solver

View File

@ -15,11 +15,11 @@
#pragma once #pragma once
#include <aoc/MullCharState.h> #include <aoc/MullCharState.hpp>
#include <aoc/MullDoOpenState.h> #include <aoc/MullDoOpenState.hpp>
#include <aoc/MullEntryState.h> #include <aoc/MullEntryState.hpp>
#include <aoc/MullFactorState.h> #include <aoc/MullFactorState.hpp>
#include <aoc/MullToggleCloseState.h> #include <aoc/MullToggleCloseState.hpp>
class MullStates class MullStates
{ {

View File

@ -15,7 +15,7 @@
#pragma once #pragma once
#include <aoc/MullDataState.h> #include <aoc/MullDataState.hpp>
class MullToggleCloseState class MullToggleCloseState
: public MullDataState : public MullDataState

View File

@ -15,7 +15,7 @@
#pragma once #pragma once
#include "Solver.h" #include <aoc/Solver.hpp>
class PrintQueue : class PrintQueue :
public Solver public Solver

View File

@ -17,7 +17,7 @@
#include<vector> #include<vector>
#include <aoc/Slope.h> #include <aoc/Slope.hpp>
class RedNosedReportData class RedNosedReportData
{ {

View File

@ -15,9 +15,9 @@
#pragma once #pragma once
#include <aoc/Slope.h> #include <aoc/RedNosedReportData.hpp>
#include <aoc/Solver.h> #include <aoc/Slope.hpp>
#include <aoc/RedNosedReportData.h> #include <aoc/Solver.hpp>
class RedNosedReports class RedNosedReports
: public Solver : public Solver

View File

@ -20,7 +20,7 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include <aoc/Solver.h> #include <aoc/Solver.hpp>
class SolverEngine class SolverEngine
{ {

View File

@ -17,7 +17,7 @@
#include <vector> #include <vector>
#include <aoc/StringStateMachine.h> #include <aoc/StringStateMachine.hpp>
class StringStateMachine; class StringStateMachine;

View File

@ -17,7 +17,7 @@
#include <string> #include <string>
#include <aoc/StringState.h> #include <aoc/StringState.hpp>
class StringState; class StringState;

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/CeresSearch.h> #include <aoc/CeresSearch.hpp>
std::string CeresSearch::getPuzzleName() const std::string CeresSearch::getPuzzleName() const
{ {

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/GuardGallivant.h> #include <aoc/GuardGallivant.hpp>
std::string GuardGallivant::getPuzzleName() const std::string GuardGallivant::getPuzzleName() const
{ {

View File

@ -15,7 +15,7 @@
#include <iostream> #include <iostream>
#include <aoc/HistorianHysteria.h> #include <aoc/HistorianHysteria.hpp>
std::string HistorianHysteria::getPuzzleName() const std::string HistorianHysteria::getPuzzleName() const
{ {

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/LinesSolver.h> #include <aoc/LinesSolver.hpp>
void LinesSolver::processDataLine(const std::string& line) void LinesSolver::processDataLine(const std::string& line)
{ {

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/MullCharState.h> #include <aoc/MullCharState.hpp>
MullCharState::MullCharState(const char expected) MullCharState::MullCharState(const char expected)
: expected_{ expected }, successState_{}, failState_{} {} : expected_{ expected }, successState_{}, failState_{} {}

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/MullData.h> #include <aoc/MullData.hpp>
MullData::MullData() MullData::MullData()
: isEnabled_{ true }, factor1_{ 0 }, factor2_{ 0 }, part1_{ 0 }, part2_{ 0 } {}; : isEnabled_{ true }, factor1_{ 0 }, factor2_{ 0 }, part1_{ 0 }, part2_{ 0 } {};

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/MullDataState.h> #include <aoc/MullDataState.hpp>
void MullDataState::setData(MullData& data) void MullDataState::setData(MullData& data)
{ {

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/MullDoOpenState.h> #include <aoc/MullDoOpenState.hpp>
void MullDoOpenState::next(StringStateMachine* stateMachine) void MullDoOpenState::next(StringStateMachine* stateMachine)
{ {

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/MullEntryState.h> #include <aoc/MullEntryState.hpp>
void MullEntryState::enter(StringStateMachine* stateMachine) void MullEntryState::enter(StringStateMachine* stateMachine)
{ {

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/MullFactorState.h> #include <aoc/MullFactorState.hpp>
MullFactorState::MullFactorState(const char expected, const int index) MullFactorState::MullFactorState(const char expected, const int index)
: expected_{ expected }, index_{ index }, successState_{}, failState_{} {} : expected_{ expected }, index_{ index }, successState_{}, failState_{} {}

View File

@ -13,8 +13,9 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/MullItOver.h> #include <aoc/MullItOver.hpp>
#include <aoc/StringStateMachine.h>
#include <aoc/StringStateMachine.hpp>
MullItOver::MullItOver() MullItOver::MullItOver()
: Solver{}, data_{}, states_ { : Solver{}, data_{}, states_ {

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/MullStates.h> #include <aoc/MullStates.hpp>
MullStates::MullStates(MullData& data) MullStates::MullStates(MullData& data)
{ {

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/MullToggleCloseState.h> #include <aoc/MullToggleCloseState.hpp>
MullToggleCloseState::MullToggleCloseState(const bool isEnabler) MullToggleCloseState::MullToggleCloseState(const bool isEnabler)
: isEnabler_{ isEnabler }, successState_{} {} : isEnabler_{ isEnabler }, successState_{} {}

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/Point2.h> #include <aoc/Point2.hpp>
const Point2 Point2::left{ -1, 0 }; const Point2 Point2::left{ -1, 0 };
const Point2 Point2::right{ 1, 0 }; const Point2 Point2::right{ 1, 0 };

View File

@ -13,12 +13,12 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/PrintQueue.hpp>
#include <algorithm> #include <algorithm>
#include <sstream> #include <sstream>
#include <vector> #include <vector>
#include <aoc/PrintQueue.h>
PrintQueue::PrintQueue() PrintQueue::PrintQueue()
: Solver{}, pageNoMapIndex_{ 0 }, isProcessingOrderingRules_{ true }, orderingRules_{} : Solver{}, pageNoMapIndex_{ 0 }, isProcessingOrderingRules_{ true }, orderingRules_{}
{ {

View File

@ -13,19 +13,20 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/Program.hpp>
#include <iostream> #include <iostream>
#include <memory> #include <memory>
#include <aoc/Program.h> #include <aoc/SolverEngine.hpp>
#include <aoc/SolverEngine.h>
// Solver implementations in day order. // Solver implementations in day order.
#include <aoc/HistorianHysteria.h> #include <aoc/HistorianHysteria.hpp>
#include <aoc/RedNosedReports.h> #include <aoc/RedNosedReports.hpp>
#include <aoc/MullItOver.h> #include <aoc/MullItOver.hpp>
#include <aoc/CeresSearch.h> #include <aoc/CeresSearch.hpp>
#include <aoc/PrintQueue.h> #include <aoc/PrintQueue.hpp>
#include <aoc/GuardGallivant.h> #include <aoc/GuardGallivant.hpp>
void Program::run() void Program::run()
{ {

View File

@ -13,12 +13,12 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/RedNosedReports.hpp>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include <vector> #include <vector>
#include <aoc/RedNosedReports.h>
std::string RedNosedReports::getPuzzleName() const std::string RedNosedReports::getPuzzleName() const
{ {
return "Day 2: Red-Nosed Reports"; return "Day 2: Red-Nosed Reports";

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/Solver.h> #include <aoc/Solver.hpp>
Solver::Solver() Solver::Solver()
: part1{ 0 }, part2{ 0 } {} : part1{ 0 }, part2{ 0 } {}

View File

@ -13,11 +13,11 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/SolverEngine.hpp>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include <aoc/SolverEngine.h>
SolverEngine::SolverEngine(const std::vector<std::string>& inputPaths) SolverEngine::SolverEngine(const std::vector<std::string>& inputPaths)
: inputPaths_{ inputPaths } {} : inputPaths_{ inputPaths } {}

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/StringStateMachine.h> #include <aoc/StringStateMachine.hpp>
StringStateMachine::StringStateMachine(const std::string& line, StringState& entryState) StringStateMachine::StringStateMachine(const std::string& line, StringState& entryState)
{ {

View File

@ -15,7 +15,7 @@
#pragma once #pragma once
#include <aocTests/TestContext.h> #include <aocTests/TestContext.hpp>
class Part1TestContext class Part1TestContext
: public TestContext : public TestContext

View File

@ -15,7 +15,7 @@
#pragma once #pragma once
#include <aocTests/TestContext.h> #include <aocTests/TestContext.hpp>
class Part2TestContext class Part2TestContext
: public TestContext : public TestContext

View File

@ -18,7 +18,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <aoc/Solver.h> #include <aoc/Solver.hpp>
class TestContext class TestContext
{ {

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aocTests/Part1TestContext.h> #include <aocTests/Part1TestContext.hpp>
Part1TestContext::Part1TestContext(std::vector<std::string> inputPaths) Part1TestContext::Part1TestContext(std::vector<std::string> inputPaths)
: TestContext{ inputPaths } {} : TestContext{ inputPaths } {}

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aocTests/Part2TestContext.h> #include <aocTests/Part2TestContext.hpp>
Part2TestContext::Part2TestContext(std::vector<std::string> inputPaths) Part2TestContext::Part2TestContext(std::vector<std::string> inputPaths)
: TestContext{ inputPaths } {} : TestContext{ inputPaths } {}

View File

@ -15,12 +15,12 @@
#include <catch2/catch_test_macros.hpp> #include <catch2/catch_test_macros.hpp>
#include <aoc/Solver.h> #include <aoc/Solver.hpp>
#include <aoc/SolverEngine.h> #include <aoc/SolverEngine.hpp>
#include <aoc/HistorianHysteria.h> #include <aoc/HistorianHysteria.hpp>
#include <aocTests/Part1TestContext.h> #include <aocTests/Part1TestContext.hpp>
#include <aocTests/Part2TestContext.h> #include <aocTests/Part2TestContext.hpp>
#define REQUIRE_MESSAGE(cond, msg) if (!(cond)) { INFO(msg); REQUIRE(cond); } #define REQUIRE_MESSAGE(cond, msg) if (!(cond)) { INFO(msg); REQUIRE(cond); }

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with // You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>. // this program. If not, see <http://www.gnu.org/licenses/>.
#include <aocTests/TestContext.h> #include <aocTests/TestContext.hpp>
TestContext::TestContext(std::vector<std::string> inputPaths) TestContext::TestContext(std::vector<std::string> inputPaths)
: inputPaths_{ inputPaths } {} : inputPaths_{ inputPaths } {}