StormByte C++ Library: Network module 0.0.9999
StormByte-Network is a StormByte library module for handling and create network connections
Loading...
Searching...
No Matches
rw.hxx
1#pragma once
2
3#include <StormByte/network/visibility.h>
4
5#include <string>
6
11namespace StormByte::Network::Connection {
16 namespace Read {
21 enum class STORMBYTE_NETWORK_PUBLIC Result {
22 Success,
23 WouldBlock,
24 Closed,
25 Failed,
26 Timeout
27 };
28 }
29
34 namespace Write {
39 enum class STORMBYTE_NETWORK_PUBLIC Result {
40 Success,
41 Failed
42 };
43 }
44
50 constexpr STORMBYTE_NETWORK_PUBLIC std::string ToString(const StormByte::Network::Connection::Read::Result& result) noexcept {
51 switch (result) {
52 case StormByte::Network::Connection::Read::Result::Success:
53 return "Success";
54 case StormByte::Network::Connection::Read::Result::WouldBlock:
55 return "WouldBlock";
56 case StormByte::Network::Connection::Read::Result::Failed:
57 return "Failed";
58 case StormByte::Network::Connection::Read::Result::Closed:
59 return "Closed";
60 default:
61 return "Unknown";
62 }
63 }
64
70 constexpr STORMBYTE_NETWORK_PUBLIC std::string ToString(const StormByte::Network::Connection::Write::Result& result) noexcept {
71 switch (result) {
72 case StormByte::Network::Connection::Write::Result::Success:
73 return "Success";
74 case StormByte::Network::Connection::Write::Result::Failed:
75 return "Failed";
76 default:
77 return "Unknown";
78 }
79 }
80}
The namespace containing read items.
The namespace containing write items.