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
// this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/Program.h>
#include <aoc/Program.hpp>
int main()
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -15,7 +15,7 @@
#include <iostream>
#include <aoc/HistorianHysteria.h>
#include <aoc/HistorianHysteria.hpp>
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
// 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)
{

View File

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

View File

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

View File

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

View File

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

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with
// 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::right{ 1, 0 };

View File

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

View File

@ -13,12 +13,12 @@
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/RedNosedReports.hpp>
#include <iostream>
#include <sstream>
#include <vector>
#include <aoc/RedNosedReports.h>
std::string RedNosedReports::getPuzzleName() const
{
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
// this program. If not, see <http://www.gnu.org/licenses/>.
#include <aoc/Solver.h>
#include <aoc/Solver.hpp>
Solver::Solver()
: part1{ 0 }, part2{ 0 } {}

View File

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

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with
// 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)
{

View File

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

View File

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

View File

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

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with
// 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)
: TestContext{ inputPaths } {}

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License along with
// 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)
: TestContext{ inputPaths } {}

View File

@ -15,12 +15,12 @@
#include <catch2/catch_test_macros.hpp>
#include <aoc/Solver.h>
#include <aoc/SolverEngine.h>
#include <aoc/HistorianHysteria.h>
#include <aoc/Solver.hpp>
#include <aoc/SolverEngine.hpp>
#include <aoc/HistorianHysteria.hpp>
#include <aocTests/Part1TestContext.h>
#include <aocTests/Part2TestContext.h>
#include <aocTests/Part1TestContext.hpp>
#include <aocTests/Part2TestContext.hpp>
#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
// 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)
: inputPaths_{ inputPaths } {}