You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
LIMITATIONS: 1) Re-instancing will only update UClass instance data. 2) Adding and removing properties should only be done towards the end of a class or structure and can not be followed by complex data types. 3) Adding and removing properties from a base class should not be done if a derived class contains complex data types. KNOWN ISSUES: 1) Changes to enumerations and structures will not be reflected in existing blueprints. However, adding new nodes to the blueprint will show the updated enumeration or structure. 2) If a class contains an enumeration or structure as a member, the class will not be re-instanced if enumeration or structure is changed. CHANGES: 1) LiveCodingServer 1a) Modified to always execute certain static instances during load. 1b) Modified to exclude the _Statics static structures to avoid patching to old copies. 2) Added support for LiveCoding reinstancing 2a) Refactored deferred registration system for UClass, UEnum, and UScriptStruct to use a common system that works for normal game, hot reload and live coding. 2b) Type specific version check data is possible (i.e. enum doesn't have a size) 2c) Single registration static for UClass 2d) Single registration class for all types that is just a blind forward to API. 2e) Static and dynamic registrations use different API entry points to avoid having overloaded argument lists that just apply to one or the other. 2f) Shims for older API 3) New common "Reload" system to avoid using HotReload code. 3a) Support common delegates regardless of who is reloading/reinstancing. 3b) Re-instancing code moved from HotReload to Kismet2 (where the bulk of the re-instance code already existed). 3c) Modified PyWrapper to use new helper class instead of depending on HotRelaod 3d) Added WITH_RELOAD which is defined if HotReload or LiveCoding is enabled. 3e) Modifed existing code to use new #define and delegates. Robert did the review on the changes covered by Part 2. Remaining changes are all straightforward. #rb robert.manuszewski #jira UE-74493 [CL 15736777 by Tim Smith in ue5-main branch]
111 lines
3.3 KiB
C++
111 lines
3.3 KiB
C++
// Copyright 2011-2020 Molecular Matters GmbH, all rights reserved.
|
|
|
|
#pragma once
|
|
|
|
// BEGIN EPIC MOD
|
|
#include "CoreTypes.h"
|
|
#include <string>
|
|
// END EPIC MOD
|
|
|
|
namespace string
|
|
{
|
|
std::wstring ToWideString(const char* utf8Str);
|
|
std::wstring ToWideString(const char* utf8Str, size_t count);
|
|
std::wstring ToWideString(const std::string& str);
|
|
|
|
std::string Replace(const std::string& str, const std::string& from, const std::string& to);
|
|
std::wstring Replace(const std::wstring& str, const std::wstring& from, const std::wstring& to);
|
|
std::string ReplaceAll(const std::string& str, const std::string& from, const std::string& to);
|
|
std::wstring ReplaceAll(const std::wstring& str, const std::wstring& from, const std::wstring& to);
|
|
|
|
std::string EraseAll(const std::string& str, const std::string& subString);
|
|
std::wstring EraseAll(const std::wstring& str, const std::wstring& subString);
|
|
|
|
char* Find(char* str, const char* subString);
|
|
wchar_t* Find(wchar_t* str, const wchar_t* subString);
|
|
|
|
const char* Find(const char* str, const char* subString);
|
|
const wchar_t* Find(const wchar_t* str, const wchar_t* subString);
|
|
const wchar_t* Find(const wchar_t* str, size_t strLength, const wchar_t* subString, size_t subStringLength);
|
|
|
|
bool Matches(const char* str1, const char* str2);
|
|
bool Matches(const wchar_t* str1, const wchar_t* str2);
|
|
|
|
bool Contains(const char* str, const char* subString);
|
|
bool Contains(const wchar_t* str, const wchar_t* subString);
|
|
|
|
bool StartsWith(const char* str, const char* subString);
|
|
bool StartsWith(const wchar_t* str, const wchar_t* subString);
|
|
|
|
// BEGIN EPIC MOD
|
|
const char* StartsWithEx(const char* str, const char* subString);
|
|
const wchar_t* StartsWithEx(const wchar_t* str, const wchar_t* subString);
|
|
|
|
bool MatchWildcard(const char* target, const char* wildcard);
|
|
bool MatchWildcard(const wchar_t* target, const wchar_t* wildcard);
|
|
// END EPIC MOD
|
|
|
|
inline char ToLower(char c)
|
|
{
|
|
return static_cast<char>(::tolower(c));
|
|
}
|
|
|
|
inline wchar_t ToLower(wchar_t c)
|
|
{
|
|
return static_cast<wchar_t>(::towlower(c));
|
|
}
|
|
|
|
inline char ToUpper(char c)
|
|
{
|
|
return static_cast<char>(::toupper(c));
|
|
}
|
|
|
|
inline wchar_t ToUpper(wchar_t c)
|
|
{
|
|
return static_cast<wchar_t>(::towupper(c));
|
|
}
|
|
|
|
|
|
std::string ToUpper(const char* str);
|
|
std::string ToUpper(const std::string& str);
|
|
std::wstring ToUpper(const wchar_t* str);
|
|
std::wstring ToUpper(const std::wstring& str);
|
|
|
|
std::wstring ToLower(const wchar_t* str);
|
|
std::wstring ToLower(const std::wstring& str);
|
|
|
|
// Turns invalid characters (\ / : * ? " < > | : ; , .) in file names, names for OS objects, etc. into underscores
|
|
std::wstring MakeSafeName(const std::wstring& name);
|
|
|
|
// Returns the length of the given string without null terminator
|
|
inline size_t GetLength(const char* str)
|
|
{
|
|
return strlen(str);
|
|
}
|
|
|
|
// Returns the length of the given string without null terminator
|
|
inline size_t GetLength(const wchar_t* str)
|
|
{
|
|
return wcslen(str);
|
|
}
|
|
|
|
// TODO: temporary fix for Orbis
|
|
#if _WIN32
|
|
template <typename T>
|
|
inline T StringToInt(const wchar_t* str)
|
|
{
|
|
return static_cast<T>(::_wtoi(str));
|
|
}
|
|
|
|
template <typename T>
|
|
inline std::wstring IntToString(T value)
|
|
{
|
|
// ensure that the largest 64-bit integers & sign & a null-terminator fit into the buffer
|
|
wchar_t result[22u] = {};
|
|
_itow_s(static_cast<int>(value), result, 10);
|
|
|
|
return std::wstring(result);
|
|
}
|
|
#endif
|
|
}
|