Added vcpkg and fixed Windows build.

This commit is contained in:
2024-02-05 21:06:48 -08:00
parent 6b2f3e7247
commit 94ce3146c5
19 changed files with 93 additions and 50 deletions

View File

@@ -13,7 +13,7 @@ namespace ehs
public:
Keyboard();
Keyboard(Str_8 name, const UInt_64 id);
Keyboard(Str_8 name, UInt_64 id);
Keyboard(Keyboard&& hid) noexcept = default;
@@ -114,8 +114,8 @@ namespace ehs
static const Button Up;
static const Button Down;
static Button TranslateScanCode(const UInt_32 code);
static Button TranslateScanCode(UInt_32 code);
static Char_8 TranslateToEnglish_8(const bool shifted, const Button& button);
static Char_8 TranslateToEnglish_8(bool shifted, const Button& button);
};
}

View File

@@ -22,7 +22,7 @@ namespace ehs
/// Default members initialization.
TCP();
TCP(const AddrType addrType);
TCP(AddrType addrType);
TCP(TCP&& tcp) noexcept;

View File

@@ -41,7 +41,7 @@ namespace ehs
/// @param [in] address The local IPv4 or IPv6 address to bind to. Resolves domain names. The given address can be empty, "127.0.0.1", or "localhost" to automatically find the appropriate device.
/// @param [in] port The port to bind to.
/// @note Requires the port given to be forwarded if this is called.
void Bind(const Str_8& address, const UInt_16 port) override;
void Bind(AddrType type, const Str_8& address, UInt_16 port) override;
/// Sends data using a C-style byte array.
/// @param [in] addr The remote Ipv4 or Ipv6 address to send to. Resolves domain names. The given address can be empty, "127.0.0.1", or "localhost" to automatically find the appropriate device.
@@ -49,7 +49,7 @@ namespace ehs
/// @param [in] data The C-style byte array to send.
/// @param [in] size The size of the C-style byte array.
/// @note The size of data to be sent cannot exceed "UDP::maxPayloadIpv4" or "UDP::maxPayloadIpv6".
UInt_64 Send(const Str_8& addr, const UInt_16 port, const Byte* const data, const UInt_64 size) override;
UInt_64 Send(AddrType type, const Str_8& addr, UInt_16 port, const Byte* data, UInt_64 size) override;
/// Receives data using the packet helper class.
/// @param [out] addr The Ipv4 or Ipv6 address of the sender.
@@ -58,11 +58,11 @@ namespace ehs
/// @param [in] size The size of the pre-allocated C-style byte array.
/// @returns The size of the data received.
/// @warning The provided C-style byte array must be freed when finished using.
UInt_64 Receive(Str_8* const addr, UInt_16* const port, Byte* const data, const UInt_64 size) override;
UInt_64 Receive(AddrType* type, Str_8* addr, UInt_16* port, Byte* data, UInt_64 size) override;
/// Sets whether or not receiving data blocks the next task.
/// @param [in] blocking Whether or not to block.
void SetBlocking(const bool blocking) override;
void SetBlocking(bool blocking) override;
/// Retrieves whether or not this socket will block when receiving data.
/// @returns The result.
@@ -71,12 +71,12 @@ namespace ehs
bool IsValid() const override;
private:
void Bind_v6(const Str_8& address, const UInt_16 port);
void Bind_v6(const Str_8& address, UInt_16 port);
void Bind_v4(const Str_8& address, const UInt_16 port);
void Bind_v4(const Str_8& address, UInt_16 port);
UInt_64 Send_v6(const Str_8& addr, const UInt_16 port, const Byte* const data, const UInt_64 size);
UInt_64 Send_v6(const Str_8& addr, UInt_16 port, const Byte* data, UInt_64 size);
UInt_64 Send_v4(const Str_8& addr, const UInt_16 port, const Byte* const data, const UInt_64 size);
UInt_64 Send_v4(const Str_8& addr, UInt_16 port, const Byte* data, UInt_64 size);
};
}