UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IPv4SubnetMask.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6#include "CoreMinimal.h"
7#include "HAL/Platform.h"
10#include "Templates/TypeHash.h"
11
13{
17 enum Type
18 {
21
24
27
29 ClassC
30 };
31}
32
33
38{
39 union
40 {
42 struct
43 {
44#if PLATFORM_LITTLE_ENDIAN
45 #ifdef _MSC_VER
46 uint8 D, C, B, A;
47 #else
48 uint8 D GCC_ALIGN(4);
49 uint8 C, B, A;
50 #endif
51#else
52 uint8 A, B, C, D;
53#endif
54 };
55
58 };
59
60public:
61
64
76#if PLATFORM_LITTLE_ENDIAN
77 : D(InD)
78 , C(InC)
79 , B(InB)
80 , A(InA)
81#else
82 : A(InA)
83 , B(InB)
84 , C(InC)
85 , D(InD)
86#endif // PLATFORM_LITTLE_ENDIAN
87 { }
88
97
98public:
99
107 {
108 return (Value == Other.Value);
109 }
110
118 {
119 return (Value != Other.Value);
120 }
121
128 {
129 return FIPv4SubnetMask(~Value);
130 }
131
140 {
141 return Ar << SubnetMask.Value;
142 }
143
144public:
145
152 {
153 if (A == 255)
154 {
155 if (B == 255)
156 {
157 if (C == 255)
158 {
160 }
161
163 }
164
166 }
167
169 }
170
177 NETWORKING_API FString ToString() const;
178
185 FText ToText() const
186 {
187 return FText::FromString(ToString());
188 }
189
190public:
191
199 {
200 return GetTypeHash(SubnetMask.Value);
201 }
202
203public:
204
213 static NETWORKING_API bool Parse(const FString& MaskString, FIPv4SubnetMask& OutMask);
214};
#define GCC_ALIGN(n)
Definition AndroidPlatform.h:163
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Archive.h:1208
Definition Text.h:385
static CORE_API FText FromString(const ANSICHAR *String)
Definition Text.cpp:1081
Definition IPv4SubnetMask.h:13
Type
Definition IPv4SubnetMask.h:18
@ ClassA
Definition IPv4SubnetMask.h:23
@ Invalid
Definition IPv4SubnetMask.h:20
@ ClassB
Definition IPv4SubnetMask.h:26
@ ClassC
Definition IPv4SubnetMask.h:29
Definition IPv4SubnetMask.h:38
friend FArchive & operator<<(FArchive &Ar, FIPv4SubnetMask &SubnetMask)
Definition IPv4SubnetMask.h:139
NETWORKING_API FString ToString() const
Definition IPv4SubnetMask.cpp:9
FText ToText() const
Definition IPv4SubnetMask.h:185
uint8 D
Definition IPv4SubnetMask.h:52
FIPv4SubnetMask(uint32 InValue)
Definition IPv4SubnetMask.h:94
EIPv4SubnetClasses::Type GetClass() const
Definition IPv4SubnetMask.h:151
bool operator==(const FIPv4SubnetMask &Other) const
Definition IPv4SubnetMask.h:106
int32 Value
Definition IPv4SubnetMask.h:57
friend uint32 GetTypeHash(const FIPv4SubnetMask &SubnetMask)
Definition IPv4SubnetMask.h:198
FIPv4SubnetMask(uint8 InA, uint8 InB, uint8 InC, uint8 InD)
Definition IPv4SubnetMask.h:75
uint8 B
Definition IPv4SubnetMask.h:52
FIPv4SubnetMask()
Definition IPv4SubnetMask.h:63
uint8 A
Definition IPv4SubnetMask.h:52
bool operator!=(const FIPv4SubnetMask &Other) const
Definition IPv4SubnetMask.h:117
FIPv4SubnetMask operator~() const
Definition IPv4SubnetMask.h:127
uint8 C
Definition IPv4SubnetMask.h:52
static NETWORKING_API bool Parse(const FString &MaskString, FIPv4SubnetMask &OutMask)
Definition IPv4SubnetMask.cpp:18