2020-12-15 09:27:44 -04:00
|
|
|
// Copyright 2011-2020 Molecular Matters GmbH, all rights reserved.
|
Integrating live coding feature (aka Live++) into UE4.
Allows fast iteration of C++ changes without restarting the application. To use, select the "Live Coding (Experimental)" mode from the drop down menu next to the editor's compile button, or type "LiveCoding" into the console for a monolithic build. Press Ctrl+Alt+F11 to find changes and compile.
Changes vs standalone Live++ version:
* UBT is used to execute builds. This allows standard UE4 adaptive unity mode, allows us to reuse object files when we do regular builds, supports using any build executor allowed by UBT (XGE, SNDBS, etc..).
* Adding new source files is supported.
* Custom visualizer for FNames is supported via a weakly linked symbol in a static library (Engine/Extras/NatvisHelpers).
* Settings are exposed in the editor's project settings dialog.
* Standalone application has been rewritten as a Slate app ("LiveCodingConsole"). There is an additional option to start the program as hidden, where it will not be visible until Ctrl+Alt+F11 is hit. Similarly, closing the window will hide it instead of closing the application.
* Does not require a standalone licensed version of Live++.
Known issues:
* Does not currently support class layout changes / object reinstancing
#rb none
[FYI] Marc.Audy, Stefan.Boberg, Nick.Penwarden
#jira
#ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/...
#ROBOMERGE-BOT: RELEASE (Release-4.22 -> Main)
[CL 5309051 by ben marsh in Main branch]
2019-03-05 18:49:25 -05:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2020-12-15 09:27:44 -04:00
|
|
|
// BEGIN EPIC MOD
|
Integrating live coding feature (aka Live++) into UE4.
Allows fast iteration of C++ changes without restarting the application. To use, select the "Live Coding (Experimental)" mode from the drop down menu next to the editor's compile button, or type "LiveCoding" into the console for a monolithic build. Press Ctrl+Alt+F11 to find changes and compile.
Changes vs standalone Live++ version:
* UBT is used to execute builds. This allows standard UE4 adaptive unity mode, allows us to reuse object files when we do regular builds, supports using any build executor allowed by UBT (XGE, SNDBS, etc..).
* Adding new source files is supported.
* Custom visualizer for FNames is supported via a weakly linked symbol in a static library (Engine/Extras/NatvisHelpers).
* Settings are exposed in the editor's project settings dialog.
* Standalone application has been rewritten as a Slate app ("LiveCodingConsole"). There is an additional option to start the program as hidden, where it will not be visible until Ctrl+Alt+F11 is hit. Similarly, closing the window will hide it instead of closing the application.
* Does not require a standalone licensed version of Live++.
Known issues:
* Does not currently support class layout changes / object reinstancing
#rb none
[FYI] Marc.Audy, Stefan.Boberg, Nick.Penwarden
#jira
#ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/...
#ROBOMERGE-BOT: RELEASE (Release-4.22 -> Main)
[CL 5309051 by ben marsh in Main branch]
2019-03-05 18:49:25 -05:00
|
|
|
#include "CoreTypes.h"
|
|
|
|
|
#include <string>
|
2020-12-15 09:27:44 -04:00
|
|
|
// END EPIC MOD
|
Integrating live coding feature (aka Live++) into UE4.
Allows fast iteration of C++ changes without restarting the application. To use, select the "Live Coding (Experimental)" mode from the drop down menu next to the editor's compile button, or type "LiveCoding" into the console for a monolithic build. Press Ctrl+Alt+F11 to find changes and compile.
Changes vs standalone Live++ version:
* UBT is used to execute builds. This allows standard UE4 adaptive unity mode, allows us to reuse object files when we do regular builds, supports using any build executor allowed by UBT (XGE, SNDBS, etc..).
* Adding new source files is supported.
* Custom visualizer for FNames is supported via a weakly linked symbol in a static library (Engine/Extras/NatvisHelpers).
* Settings are exposed in the editor's project settings dialog.
* Standalone application has been rewritten as a Slate app ("LiveCodingConsole"). There is an additional option to start the program as hidden, where it will not be visible until Ctrl+Alt+F11 is hit. Similarly, closing the window will hide it instead of closing the application.
* Does not require a standalone licensed version of Live++.
Known issues:
* Does not currently support class layout changes / object reinstancing
#rb none
[FYI] Marc.Audy, Stefan.Boberg, Nick.Penwarden
#jira
#ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/...
#ROBOMERGE-BOT: RELEASE (Release-4.22 -> Main)
[CL 5309051 by ben marsh in Main branch]
2019-03-05 18:49:25 -05:00
|
|
|
|
|
|
|
|
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);
|
2020-12-15 09:27:44 -04:00
|
|
|
std::string ReplaceAll(const std::string& str, const std::string& from, const std::string& to);
|
Integrating live coding feature (aka Live++) into UE4.
Allows fast iteration of C++ changes without restarting the application. To use, select the "Live Coding (Experimental)" mode from the drop down menu next to the editor's compile button, or type "LiveCoding" into the console for a monolithic build. Press Ctrl+Alt+F11 to find changes and compile.
Changes vs standalone Live++ version:
* UBT is used to execute builds. This allows standard UE4 adaptive unity mode, allows us to reuse object files when we do regular builds, supports using any build executor allowed by UBT (XGE, SNDBS, etc..).
* Adding new source files is supported.
* Custom visualizer for FNames is supported via a weakly linked symbol in a static library (Engine/Extras/NatvisHelpers).
* Settings are exposed in the editor's project settings dialog.
* Standalone application has been rewritten as a Slate app ("LiveCodingConsole"). There is an additional option to start the program as hidden, where it will not be visible until Ctrl+Alt+F11 is hit. Similarly, closing the window will hide it instead of closing the application.
* Does not require a standalone licensed version of Live++.
Known issues:
* Does not currently support class layout changes / object reinstancing
#rb none
[FYI] Marc.Audy, Stefan.Boberg, Nick.Penwarden
#jira
#ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/...
#ROBOMERGE-BOT: RELEASE (Release-4.22 -> Main)
[CL 5309051 by ben marsh in Main branch]
2019-03-05 18:49:25 -05:00
|
|
|
std::wstring ReplaceAll(const std::wstring& str, const std::wstring& from, const std::wstring& to);
|
2020-01-29 14:48:18 -05:00
|
|
|
|
|
|
|
|
std::string EraseAll(const std::string& str, const std::string& subString);
|
Integrating live coding feature (aka Live++) into UE4.
Allows fast iteration of C++ changes without restarting the application. To use, select the "Live Coding (Experimental)" mode from the drop down menu next to the editor's compile button, or type "LiveCoding" into the console for a monolithic build. Press Ctrl+Alt+F11 to find changes and compile.
Changes vs standalone Live++ version:
* UBT is used to execute builds. This allows standard UE4 adaptive unity mode, allows us to reuse object files when we do regular builds, supports using any build executor allowed by UBT (XGE, SNDBS, etc..).
* Adding new source files is supported.
* Custom visualizer for FNames is supported via a weakly linked symbol in a static library (Engine/Extras/NatvisHelpers).
* Settings are exposed in the editor's project settings dialog.
* Standalone application has been rewritten as a Slate app ("LiveCodingConsole"). There is an additional option to start the program as hidden, where it will not be visible until Ctrl+Alt+F11 is hit. Similarly, closing the window will hide it instead of closing the application.
* Does not require a standalone licensed version of Live++.
Known issues:
* Does not currently support class layout changes / object reinstancing
#rb none
[FYI] Marc.Audy, Stefan.Boberg, Nick.Penwarden
#jira
#ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/...
#ROBOMERGE-BOT: RELEASE (Release-4.22 -> Main)
[CL 5309051 by ben marsh in Main branch]
2019-03-05 18:49:25 -05:00
|
|
|
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);
|
2020-01-29 14:48:18 -05:00
|
|
|
const wchar_t* Find(const wchar_t* str, size_t strLength, const wchar_t* subString, size_t subStringLength);
|
Integrating live coding feature (aka Live++) into UE4.
Allows fast iteration of C++ changes without restarting the application. To use, select the "Live Coding (Experimental)" mode from the drop down menu next to the editor's compile button, or type "LiveCoding" into the console for a monolithic build. Press Ctrl+Alt+F11 to find changes and compile.
Changes vs standalone Live++ version:
* UBT is used to execute builds. This allows standard UE4 adaptive unity mode, allows us to reuse object files when we do regular builds, supports using any build executor allowed by UBT (XGE, SNDBS, etc..).
* Adding new source files is supported.
* Custom visualizer for FNames is supported via a weakly linked symbol in a static library (Engine/Extras/NatvisHelpers).
* Settings are exposed in the editor's project settings dialog.
* Standalone application has been rewritten as a Slate app ("LiveCodingConsole"). There is an additional option to start the program as hidden, where it will not be visible until Ctrl+Alt+F11 is hit. Similarly, closing the window will hide it instead of closing the application.
* Does not require a standalone licensed version of Live++.
Known issues:
* Does not currently support class layout changes / object reinstancing
#rb none
[FYI] Marc.Audy, Stefan.Boberg, Nick.Penwarden
#jira
#ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/...
#ROBOMERGE-BOT: RELEASE (Release-4.22 -> Main)
[CL 5309051 by ben marsh in Main branch]
2019-03-05 18:49:25 -05:00
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
2021-03-18 08:13:59 -04:00
|
|
|
// 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
|
|
|
|
|
|
2020-12-15 09:27:44 -04:00
|
|
|
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));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
Integrating live coding feature (aka Live++) into UE4.
Allows fast iteration of C++ changes without restarting the application. To use, select the "Live Coding (Experimental)" mode from the drop down menu next to the editor's compile button, or type "LiveCoding" into the console for a monolithic build. Press Ctrl+Alt+F11 to find changes and compile.
Changes vs standalone Live++ version:
* UBT is used to execute builds. This allows standard UE4 adaptive unity mode, allows us to reuse object files when we do regular builds, supports using any build executor allowed by UBT (XGE, SNDBS, etc..).
* Adding new source files is supported.
* Custom visualizer for FNames is supported via a weakly linked symbol in a static library (Engine/Extras/NatvisHelpers).
* Settings are exposed in the editor's project settings dialog.
* Standalone application has been rewritten as a Slate app ("LiveCodingConsole"). There is an additional option to start the program as hidden, where it will not be visible until Ctrl+Alt+F11 is hit. Similarly, closing the window will hide it instead of closing the application.
* Does not require a standalone licensed version of Live++.
Known issues:
* Does not currently support class layout changes / object reinstancing
#rb none
[FYI] Marc.Audy, Stefan.Boberg, Nick.Penwarden
#jira
#ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/...
#ROBOMERGE-BOT: RELEASE (Release-4.22 -> Main)
[CL 5309051 by ben marsh in Main branch]
2019-03-05 18:49:25 -05:00
|
|
|
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);
|
2020-01-29 14:48:18 -05:00
|
|
|
|
2020-12-15 09:27:44 -04:00
|
|
|
// 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
|
2020-01-29 14:48:18 -05:00
|
|
|
template <typename T>
|
|
|
|
|
inline T StringToInt(const wchar_t* str)
|
|
|
|
|
{
|
|
|
|
|
return static_cast<T>(::_wtoi(str));
|
|
|
|
|
}
|
2020-12-15 09:27:44 -04:00
|
|
|
|
|
|
|
|
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
|
Integrating live coding feature (aka Live++) into UE4.
Allows fast iteration of C++ changes without restarting the application. To use, select the "Live Coding (Experimental)" mode from the drop down menu next to the editor's compile button, or type "LiveCoding" into the console for a monolithic build. Press Ctrl+Alt+F11 to find changes and compile.
Changes vs standalone Live++ version:
* UBT is used to execute builds. This allows standard UE4 adaptive unity mode, allows us to reuse object files when we do regular builds, supports using any build executor allowed by UBT (XGE, SNDBS, etc..).
* Adding new source files is supported.
* Custom visualizer for FNames is supported via a weakly linked symbol in a static library (Engine/Extras/NatvisHelpers).
* Settings are exposed in the editor's project settings dialog.
* Standalone application has been rewritten as a Slate app ("LiveCodingConsole"). There is an additional option to start the program as hidden, where it will not be visible until Ctrl+Alt+F11 is hit. Similarly, closing the window will hide it instead of closing the application.
* Does not require a standalone licensed version of Live++.
Known issues:
* Does not currently support class layout changes / object reinstancing
#rb none
[FYI] Marc.Audy, Stefan.Boberg, Nick.Penwarden
#jira
#ROBOMERGE-SOURCE: CL 5304722 in //UE4/Release-4.22/...
#ROBOMERGE-BOT: RELEASE (Release-4.22 -> Main)
[CL 5309051 by ben marsh in Main branch]
2019-03-05 18:49:25 -05:00
|
|
|
}
|