UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UnixPlatformString.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
7
11struct FUnixPlatformString : public FGenericWidePlatformString
12{
13 template<typename CHAR>
14 static inline int32 Strlen(const CHAR* String)
15 {
16 if(!String)
17 return 0;
18
19 int Len = 0;
20 while(*String++)
21 {
22 ++Len;
23 }
24
25 return Len;
26 }
27};
28
30
31// Format specifiers to be able to print values of these types correctly, for example when using UE_LOG.
32// SIZE_T format specifier
33#define SIZE_T_FMT "zu"
34// SIZE_T format specifier for lowercase hexadecimal output
35#define SIZE_T_x_FMT "zx"
36// SIZE_T format specifier for uppercase hexadecimal output
37#define SIZE_T_X_FMT "zX"
38
39#if PLATFORM_64BITS
40// SSIZE_T format specifier
41#define SSIZE_T_FMT "lld"
42// SSIZE_T format specifier for lowercase hexadecimal output
43#define SSIZE_T_x_FMT "llx"
44// SSIZE_T format specifier for uppercase hexadecimal output
45#define SSIZE_T_X_FMT "llX"
46
47// UPTRINT format specifier for decimal output
48#define UPTRINT_FMT "llu"
49// UPTRINT format specifier for lowercase hexadecimal output
50#define UPTRINT_x_FMT "llx"
51// UPTRINT format specifier for uppercase hexadecimal output
52#define UPTRINT_X_FMT "llX"
53#else
54// SSIZE_T format specifier
55#define SSIZE_T_FMT "d"
56// SSIZE_T format specifier for lowercase hexadecimal output
57#define SSIZE_T_x_FMT "x"
58// SSIZE_T format specifier for uppercase hexadecimal output
59#define SSIZE_T_X_FMT "X"
60
61// UPTRINT format specifier for decimal output
62#define UPTRINT_FMT "u"
63// UPTRINT format specifier for lowercase hexadecimal output
64#define UPTRINT_x_FMT "x"
65// UPTRINT format specifier for uppercase hexadecimal output
66#define UPTRINT_X_FMT "X"
67#endif
68
69// PTRINT format specifier for decimal output
70#define PTRINT_FMT SSIZE_T_FMT
71// PTRINT format specifier for lowercase hexadecimal output
72#define PTRINT_x_FMT SSIZE_T_x_FMT
73// PTRINT format specifier for uppercase hexadecimal output
74#define PTRINT_X_FMT SSIZE_T_X_FMT
75
76// int64 format specifier for decimal output
77#define INT64_FMT "lld"
78// int64 format specifier for lowercase hexadecimal output
79#define INT64_x_FMT "llx"
80// int64 format specifier for uppercase hexadecimal output
81#define INT64_X_FMT "llX"
82
83// uint64 format specifier for decimal output
84#define UINT64_FMT "llu"
85// uint64 format specifier for lowercase hexadecimal output
86#define UINT64_x_FMT "llx"
87// uint64 format specifier for uppercase hexadecimal output
88#define UINT64_X_FMT "llX"
89
90#if UE_ENABLE_INCLUDE_ORDER_DEPRECATED_IN_5_7
92#endif
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
FUnixPlatformString FPlatformString
Definition UnixPlatformString.h:29
Definition UnixPlatformString.h:12
static int32 Strlen(const CHAR *String)
Definition UnixPlatformString.h:14