Start working on build system.

This commit is contained in:
jmsgrogan 2023-12-20 16:58:22 +00:00
parent 4b308f6c32
commit 521486be62
88 changed files with 1065 additions and 349 deletions

View file

@ -0,0 +1,43 @@
#include "HttpParser.h"
#include "StringUtils.h"
bool HttpParser::parsePreamble(const std::string& line, HttpPreamble& preamble)
{
bool inPath{ false };
bool inMethod{ true };
bool inProtocol{ false };
for (const auto c : line)
{
if (inPath)
{
if (StringUtils::isSpace(c))
{
inPath = false;
inMethod = true;
}
else
{
preamble.mPath.push_back(c);
}
}
else if (inMethod)
{
if (StringUtils::isSpace(c))
{
inMethod = false;
inProtocol = true;
}
else
{
preamble.mMethod.push_back(c);
}
}
else if (inProtocol)
{
preamble.mVersion.push_back(c);
}
}
return true;
}