This commit is contained in:
scientiist
2023-04-22 13:15:24 -05:00
parent 5c37003cbf
commit 7e6601fd7e
5 changed files with 48 additions and 1 deletions

View File

@@ -5,7 +5,7 @@ project(Sockets)
file(GLOB SOURCES src/*.cpp)
include_directories(include)
add_library(${PROJECT_NAME} SHARED ${SOURCES} )
add_library(${PROJECT_NAME} SHARED ${SOURCES} include/HttpClient.hpp)
set(CMAKE_CXX_FLAGS "-pedantic -Wall -Wextra")

8
include/HttpHeaders.hpp Normal file
View File

@@ -0,0 +1,8 @@
//
// Created by josh on 4/20/23.
//
#ifndef SOCKETS_HTTPHEADERS_HPP
#define SOCKETS_HTTPHEADERS_HPP
#endif //SOCKETS_HTTPHEADERS_HPP

1
include/HttpRequest.hpp Normal file
View File

@@ -0,0 +1 @@
#pragma once

38
include/Uri.hpp Normal file
View File

@@ -0,0 +1,38 @@
#pragma once
#include <string>
namespace Socket
{
class Auth
{
public:
Auth(std::string const& user, std::string const& host, uint16_t port);
Auth();
std::string const& GetUser() const { return user_;}
std::string const& GetHost() const { return host_;}
uint16_t GetPort() const { return port_;}
private:
std::string user_;
std::string host_;
uint16_t port_;
};
class Uri
{
public:
Uri(const char* value);
Uri(std::string const& value);
Uri();
std::string const& GetScheme() const { return scheme_;}
Auth const& GetAuthority() const { return authority_;}
std::string const& GetPath() const { return path_;}
std::string const& GetHost() const { return authority_.GetHost();}
uint16_t GetPort() const { return authority_.GetPort();}
void SchemeIs(std::string const& scheme);
void AuthorityIs(std::string const& authority);
};
}

0
tests/TcpTests.cpp Normal file
View File