Reformat code with clang format

This commit is contained in:
Clang Format
2023-11-19 15:28:38 +01:00
committed by Jan
parent 22e17272fd
commit 6b4f5d94a8
1099 changed files with 16763 additions and 18076 deletions

View File

@ -1,12 +1,12 @@
#include "RawTemplater.h"
#include <fstream>
#include <iostream>
#include <filesystem>
#include "RawTemplaterArguments.h"
#include "Templating/Templater.h"
#include <filesystem>
#include <fstream>
#include <iostream>
namespace fs = std::filesystem;
class RawTemplater::Impl

View File

@ -3,24 +3,18 @@
#include "Utils/Arguments/CommandLineOption.h"
#include "Utils/Arguments/UsageInformation.h"
const CommandLineOption* const OPTION_HELP = CommandLineOption::Builder::Create()
.WithShortName("?")
.WithLongName("help")
.WithDescription("Displays usage information.")
.Build();
const CommandLineOption* const OPTION_HELP =
CommandLineOption::Builder::Create().WithShortName("?").WithLongName("help").WithDescription("Displays usage information.").Build();
const CommandLineOption* const OPTION_VERBOSE = CommandLineOption::Builder::Create()
.WithShortName("v")
.WithLongName("verbose")
.WithDescription("Outputs a lot more and more detailed messages.")
.Build();
const CommandLineOption* const OPTION_VERBOSE =
CommandLineOption::Builder::Create().WithShortName("v").WithLongName("verbose").WithDescription("Outputs a lot more and more detailed messages.").Build();
const CommandLineOption* const OPTION_OUTPUT_FOLDER = CommandLineOption::Builder::Create()
.WithShortName("o")
.WithLongName("output")
.WithDescription("Specify the folder to save the generated files. Defaults to the current directory.")
.WithParameter("outputPath")
.Build();
.WithShortName("o")
.WithLongName("output")
.WithDescription("Specify the folder to save the generated files. Defaults to the current directory.")
.WithParameter("outputPath")
.Build();
const CommandLineOption* const OPTION_BUILD_LOG = CommandLineOption::Builder::Create()
.WithLongName("build-log")
@ -29,21 +23,14 @@ const CommandLineOption* const OPTION_BUILD_LOG = CommandLineOption::Builder::Cr
.Build();
const CommandLineOption* const OPTION_DEFINE = CommandLineOption::Builder::Create()
.WithShortName("d")
.WithLongName("define")
.WithDescription("Adds a define for the templating process. Can be of format define or define=value.")
.WithParameter("defineValue")
.Reusable()
.Build();
.WithShortName("d")
.WithLongName("define")
.WithDescription("Adds a define for the templating process. Can be of format define or define=value.")
.WithParameter("defineValue")
.Reusable()
.Build();
const CommandLineOption* const COMMAND_LINE_OPTIONS[]
{
OPTION_HELP,
OPTION_VERBOSE,
OPTION_OUTPUT_FOLDER,
OPTION_BUILD_LOG,
OPTION_DEFINE
};
const CommandLineOption* const COMMAND_LINE_OPTIONS[]{OPTION_HELP, OPTION_VERBOSE, OPTION_OUTPUT_FOLDER, OPTION_BUILD_LOG, OPTION_DEFINE};
RawTemplaterArguments::RawTemplaterArguments()
: m_argument_parser(COMMAND_LINE_OPTIONS, std::extent_v<decltype(COMMAND_LINE_OPTIONS)>),

View File

@ -1,11 +1,11 @@
#pragma once
#include "Utils/Arguments/ArgumentParser.h"
#include <string>
#include <utility>
#include <vector>
#include "Utils/Arguments/ArgumentParser.h"
class RawTemplaterArguments
{
ArgumentParser m_argument_parser;
@ -28,4 +28,4 @@ public:
RawTemplaterArguments();
bool Parse(int argc, const char** argv);
};
};

View File

@ -17,4 +17,4 @@ namespace templating
private:
IParserLineStream* const m_stream;
};
}
} // namespace templating

View File

@ -1,8 +1,8 @@
#pragma once
#include "Utils/ClassUtils.h"
#include "Parsing/Impl/AbstractDirectiveStreamProxy.h"
#include "Parsing/Impl/DefinesStreamProxy.h"
#include "Utils/ClassUtils.h"
namespace templating
{
@ -28,4 +28,4 @@ namespace templating
IParserLineStream* const m_stream;
DefinesStreamProxy* m_defines_proxy;
};
}
} // namespace templating

View File

@ -1,19 +1,19 @@
#include "Templater.h"
#include <unordered_map>
#include <vector>
#include <filesystem>
#include <fstream>
#include <iostream>
#include "Utils/ClassUtils.h"
#include "DirectiveEscapeStreamProxy.h"
#include "SetDefineStreamProxy.h"
#include "TemplatingStreamProxy.h"
#include "Parsing/ParsingException.h"
#include "Parsing/Impl/DefinesStreamProxy.h"
#include "Parsing/Impl/ParserSingleInputStream.h"
#include "Parsing/Impl/SkipUntilFirstNonEmptyProxy.h"
#include "Parsing/ParsingException.h"
#include "SetDefineStreamProxy.h"
#include "TemplatingStreamProxy.h"
#include "Utils/ClassUtils.h"
#include <filesystem>
#include <fstream>
#include <iostream>
#include <unordered_map>
#include <vector>
using namespace templating;
namespace fs = std::filesystem;
@ -378,7 +378,7 @@ namespace templating
std::ofstream m_output_stream;
std::ostringstream m_output_cache;
};
}
} // namespace templating
Templater::Templater(std::istream& stream, std::string fileName)
: m_stream(stream),

View File

@ -1,8 +1,8 @@
#pragma once
#include <string>
#include "Utils/ClassUtils.h"
#include "Parsing/IParserLineStream.h"
#include "Utils/ClassUtils.h"
#include <string>
namespace templating
{
@ -19,4 +19,4 @@ namespace templating
std::ostream* m_build_log;
std::string m_file_name;
};
}
} // namespace templating

View File

@ -1,9 +1,9 @@
#include "TemplatingStreamProxy.h"
#include <iostream>
#include "Parsing/ParsingException.h"
#include <iostream>
using namespace templating;
TemplatingStreamProxy::TemplatingStreamProxy(IParserLineStream* stream, ITemplaterControl* templaterControl)
@ -153,10 +153,8 @@ bool TemplatingStreamProxy::MatchDirectives(const ParserLine& line) const
directiveStartPos++;
return MatchSwitchDirective(line, directiveStartPos, directiveEndPos)
|| MatchOptionsDirective(line, directiveStartPos, directiveEndPos)
|| MatchFilenameDirective(line, directiveStartPos, directiveEndPos)
|| MatchSkipDirective(line, directiveStartPos, directiveEndPos);
return MatchSwitchDirective(line, directiveStartPos, directiveEndPos) || MatchOptionsDirective(line, directiveStartPos, directiveEndPos)
|| MatchFilenameDirective(line, directiveStartPos, directiveEndPos) || MatchSkipDirective(line, directiveStartPos, directiveEndPos);
}
ParserLine TemplatingStreamProxy::NextLine()

View File

@ -1,8 +1,8 @@
#pragma once
#include "Utils/ClassUtils.h"
#include "Parsing/Impl/AbstractDirectiveStreamProxy.h"
#include "Parsing/Impl/DefinesStreamProxy.h"
#include "Utils/ClassUtils.h"
namespace templating
{
@ -53,4 +53,4 @@ namespace templating
ITemplaterControl* const m_templater_control;
DefinesStreamProxy* m_defines_proxy;
};
}
} // namespace templating