![]() |
MCRO
C++23 utilities for Unreal Engine.
|
Namespaces | |
namespace | Detail |
Data Structures | |
struct | FExtendedIteratorPolicy |
Extra settings for TExtendedIterator wrapper. More... | |
struct | FRangeStringFormatOptions |
struct | FTempStringIterator |
Allows range-v3 and std::ranges to iterate over temporary string objects and keep the string alive during view and action operators. More... | |
class | OutputTo |
Render a range to an already existing container. More... | |
class | OutputToMap |
Output a range of tuples or range of ranges with at least 2 elements to an already existing TMap. More... | |
class | RenderAs |
Render a range as the given container. More... | |
class | RenderAsMap |
Render a range of tuples or range of ranges with at least 2 elements as a TMap. More... | |
struct | TExtendedIterator |
Unreal's own iterators are not STL compliant (they are only compatible with range-for loops) so they cannot be used with more advanced STL algorithms or other third-party libraries which may expect the full iterator interface compatibility. For that TExtendedIterator fills in the missing components and wraps Unreal iterators to be fully STL iterator compliant. More... | |
struct | TIteratorCompare_Struct |
struct | TIteratorCompare_Struct< T > |
struct | TIteratorComputeDistance_Struct |
struct | TIteratorComputeDistance_Struct< T > |
struct | TIteratorDifference_Struct |
struct | TIteratorDifference_Struct< T > |
struct | TIteratorJumpBackward_Struct |
struct | TIteratorJumpBackward_Struct< T > |
struct | TIteratorJumpForward_Struct |
struct | TIteratorJumpForward_Struct< T > |
Concepts | |
concept | CHasEquals |
concept | CHasNotEquals |
concept | CBasicForwardIteratorBase |
The most basic minimal iterator which can only proceed forward one element at a time. | |
concept | CBasicForwardIterator |
concept | CHasMemberAccessOperator |
concept | CBasicBidirectionalIterator |
Basic minimal iterator which can only proceed forward or backward one element at a time. | |
concept | CJumpForwardIterator |
An iterator type which can natively proceed forward in arbitrarily large steps. | |
concept | CJumpForwardPlusIterator |
An iterator type which can natively proceed forward in arbitrarily large steps and exposes a + operator. | |
concept | CRandomAccessIterator |
An iterator type which can natively seek its associated content in arbitrarily large steps. | |
concept | CRandomAccessPlusMinusIterator |
An iterator type which can natively seek its associated content in arbitrarily large steps and exposes +- operators. | |
concept | CIsIteratorStep |
Constraint given iterator to its best stepping capability. | |
concept | CIsIteratorDirection |
Constraint given iterator to its best directional capability. | |
concept | CIteratorFeature |
Constraint given iterator to its best capabilies both in stepping and in direction. | |
concept | CUnrealRange |
concept | CStdDistanceCompatible |
concept | CHasGetIndex |
concept | CHasElementIndex |
concept | CIteratorComparable |
concept | CCountableRange |
Typedefs | |
template<typename T > | |
using | TIteratorCategory |
Assume an STL iterator category from input iterator. | |
template<CBasicForwardIterator T> | |
using | TIteratorElementType = std::decay_t<decltype(*DeclVal<T>())> |
return the iterator's associated content type when they're dereferenced. | |
template<CRangeMember T> | |
using | TRangeElementType = TIteratorElementType<decltype(DeclVal<T>().begin())> |
return a range's associated content type determined by dereferencing their iterator. | |
template<typename T > | |
using | TIteratorDifference = typename TIteratorDifference_Struct<T>::Type |
return a difference type for given iterator. | |
Enumerations | |
enum class | EIteratorDirection { NotIterator , Forward , Bidirectional } |
enum class | EIteratorStep { NotIterator , Single , Jump , JumpBinaryOperators } |
Functions | |
template<typename L , typename R > | |
bool | IteratorEquals (L const &l, R const &r) |
FORCEINLINE auto | Separator (FString const &separator) |
Specify a separator sequence for a range when converting it to a string. | |
FORCEINLINE auto | Enclosure (FString const &start, FString const &end) |
Specify a start and an end sequence enclosing this range when converting it to a string. | |
FORCEINLINE auto | NoSeparator () |
Don't use a separator when this range is rendered to a string. | |
FORCEINLINE auto | NoEnclosure () |
Don't enclose this range in anything when it's rendered to a string. | |
FORCEINLINE auto | NoDecorators () |
Don't insert anything else than the contents of the input range when that is rendered as a string just append each item one after the other. | |
template<CRangeMember Range> | |
FString | RenderAsString (Range &&range) |
Render an input range as a string. | |
FORCEINLINE auto | RenderAsString () |
template<typename T > | |
decltype(auto) | Literal (std::initializer_list< T > &&input) |
Make an initializer list compatible with range API's. | |
template<CRangeMember... Ranges> | |
auto | Zip (Ranges &&...right) |
pipeable version of ranges::views::zip | |
template<CRangeMember... Ranges> | |
auto | Concat (Ranges &&...right) |
pipeable version of ranges::views::concat | |
template<CRangeMember Input> | |
bool | IsEmpty (Input &&range) |
Check if range is empty. | |
FORCEINLINE auto | IsEmpty () |
Check if range is empty. | |
template<CRangeMember Input, typename Value = TRangeElementType<Input>> | |
decltype(auto) | First (Input &&range, Value &&def) |
Get's the first element of a range or return a provided default value. Same as *r.begin() but safer. | |
FORCEINLINE auto | First (auto &&def) |
Get's the first element of a range or return a provided default value. Same as *r.begin() but safer. | |
template<CRangeMember Input, typename Value = TRangeElementType<Input>> | |
decltype(auto) | FirstOrDefault (Input &&range) |
Get's the first element of a range or return the default value for the element type. Same as *r.begin() but safer. | |
FORCEINLINE auto | FirstOrDefault () |
Get's the first element of a range or return the default value for the element type. Same as *r.begin() but safer. | |
template<CRangeMember Left, CRangeMember Right> requires CConvertibleToDecayed<TRangeElementType<Right>, TRangeElementType<Left>> | |
bool | MatchOrdered (Left &&left, Right &&right, bool matchOnlyBeginning=false) |
Return true if input ranges match their values and their order. | |
template<CRangeMember Left, typename Value > requires CConvertibleToDecayed<Value, TRangeElementType<Left>> | |
bool | MatchOrdered (Left &&left, std::initializer_list< Value > &&right, bool matchOnlyBeginning=false) |
template<CRangeMember Right> | |
auto | MatchOrdered (Right &&right, bool matchOnlyBeginning=false) |
Return true if input ranges match their values and their order. | |
template<typename Value > | |
auto | MatchOrdered (std::initializer_list< Value > &&right, bool matchOnlyBeginning=false) |
template<CFunctionLike Predicate> | |
auto | AllOf (Predicate &&pred) |
template<CFunctionLike Predicate> | |
auto | AnyOf (Predicate &&pred) |
FORCEINLINE auto | FilterValid () |
Variables | |
template<typename T > | |
constexpr EIteratorDirection | TIteratorDirection |
Get the direction given iterator is capable of. | |
template<typename T > | |
constexpr EIteratorStep | TIteratorStep |
Get the maximum steps the given iterator can be seeking with. | |
template<typename T > | |
constexpr TIteratorJumpForward_Struct< T > | TIteratorJumpForward |
template<typename T > | |
constexpr TIteratorJumpBackward_Struct< T > | TIteratorJumpBackward |
template<typename T > | |
constexpr TIteratorCompare_Struct< T > | TIteratorCompare |
template<typename T > | |
constexpr TIteratorComputeDistance_Struct< T > | TIteratorComputeDistance |
using Mcro::Range::TIteratorCategory |
Assume an STL iterator category from input iterator.
Definition at line 121 of file Concepts.h.
using Mcro::Range::TIteratorDifference = typename TIteratorDifference_Struct<T>::Type |
return a difference type for given iterator.
Definition at line 141 of file Iterators.h.
using Mcro::Range::TIteratorElementType = std::decay_t<decltype(*DeclVal<T>())> |
return the iterator's associated content type when they're dereferenced.
Definition at line 159 of file Concepts.h.
using Mcro::Range::TRangeElementType = TIteratorElementType<decltype(DeclVal<T>().begin())> |
return a range's associated content type determined by dereferencing their iterator.
Definition at line 163 of file Concepts.h.
|
strong |
Enumerator | |
---|---|
NotIterator | |
Forward | |
Bidirectional |
Definition at line 26 of file Concepts.h.
|
strong |
Enumerator | |
---|---|
NotIterator | |
Single | |
Jump | |
JumpBinaryOperators |
Definition at line 32 of file Concepts.h.
auto Mcro::Range::AllOf | ( | Predicate && | pred | ) |
auto Mcro::Range::AnyOf | ( | Predicate && | pred | ) |
auto Mcro::Range::Concat | ( | Ranges &&... | right | ) |
FORCEINLINE auto Mcro::Range::Enclosure | ( | FString const & | start, |
FString const & | end ) |
Specify a start and an end sequence enclosing this range when converting it to a string.
Definition at line 75 of file Conversion.h.
FORCEINLINE auto Mcro::Range::First | ( | auto && | def | ) |
decltype(auto) Mcro::Range::First | ( | Input && | range, |
Value && | def ) |
FORCEINLINE auto Mcro::Range::FirstOrDefault | ( | ) |
decltype(auto) Mcro::Range::FirstOrDefault | ( | Input && | range | ) |
FORCEINLINE auto Mcro::Range::IsEmpty | ( | ) |
bool Mcro::Range::IsEmpty | ( | Input && | range | ) |
bool Mcro::Range::IteratorEquals | ( | L const & | l, |
R const & | r ) |
Definition at line 47 of file Concepts.h.
decltype(auto) Mcro::Range::Literal | ( | std::initializer_list< T > && | input | ) |
bool Mcro::Range::MatchOrdered | ( | Left && | left, |
Right && | right, | ||
bool | matchOnlyBeginning = false ) |
Return true if input ranges match their values and their order.
This runs in O(N) time when result is true, unless both input ranges are CCountableRange
, matchOnlyBeginning
is false and the two input ranges have different size.
left | Input range |
right | Range to compare with |
matchOnlyBeginning | By default MatchOrdered returns false for ranges with different lengths |
bool Mcro::Range::MatchOrdered | ( | Left && | left, |
std::initializer_list< Value > && | right, | ||
bool | matchOnlyBeginning = false ) |
auto Mcro::Range::MatchOrdered | ( | Right && | right, |
bool | matchOnlyBeginning = false ) |
Return true if input ranges match their values and their order.
This runs in O(N) time when result is true, unless both input ranges are CCountableRange
, matchOnlyBeginning
is false and the two input ranges have different size.
right | Range to compare with |
matchOnlyBeginning | By default MatchOrdered returns false for ranges with different lengths |
auto Mcro::Range::MatchOrdered | ( | std::initializer_list< Value > && | right, |
bool | matchOnlyBeginning = false ) |
FORCEINLINE auto Mcro::Range::NoDecorators | ( | ) |
Don't insert anything else than the contents of the input range when that is rendered as a string just append each item one after the other.
Definition at line 123 of file Conversion.h.
FORCEINLINE auto Mcro::Range::NoEnclosure | ( | ) |
Don't enclose this range in anything when it's rendered to a string.
Definition at line 104 of file Conversion.h.
FORCEINLINE auto Mcro::Range::NoSeparator | ( | ) |
Don't use a separator when this range is rendered to a string.
Definition at line 90 of file Conversion.h.
FORCEINLINE auto Mcro::Range::RenderAsString | ( | ) |
Definition at line 245 of file Conversion.h.
FString Mcro::Range::RenderAsString | ( | Range && | range | ) |
Render an input range as a string.
For ranges of any char type, the output is an uninterrupted string of them. Other char types than TCHAR will be converted to the encoding of the current TCHAR.
For ranges of strings and string-views individual items will be directly copy-appended to the output separated by ,
(unless another separator sequence is set via Separator
)
For anything else, Mcro::Text::AsString
is used. In fact this function serves as the basis for AsString
for any range type. Like for strings, any other type is separated by ,
(unless another separator sequence is set via Separator
). For convenience a piped version is also provided of this function.
Definition at line 179 of file Conversion.h.
FORCEINLINE auto Mcro::Range::Separator | ( | FString const & | separator | ) |
Specify a separator sequence for a range when converting it to a string.
Definition at line 61 of file Conversion.h.
auto Mcro::Range::Zip | ( | Ranges &&... | right | ) |
|
constexpr |
Definition at line 177 of file Iterators.h.
|
constexpr |
Definition at line 253 of file Iterators.h.
|
constexpr |
Get the direction given iterator is capable of.
Definition at line 99 of file Concepts.h.
|
constexpr |
Definition at line 105 of file Iterators.h.
|
constexpr |
Definition at line 72 of file Iterators.h.
|
constexpr |
Get the maximum steps the given iterator can be seeking with.
Definition at line 109 of file Concepts.h.