Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
ParseLines.h
Go to the documentation of this file.
1
// Copyright Epic Games, Inc. All Rights Reserved.
2
3
#
pragma
once
4
5
#
include
"Containers/StringFwd.h"
6
#
include
"Containers/StringView.h"
7
#
include
"CoreTypes.h"
8
#
include
"Misc/EnumClassFlags.h"
9
#
include
"Templates/Function.h"
10
11
template
<
typename
FuncType>
class
TFunctionRef;
12
13
namespace
UE
::
String
14
{
15
16
enum
class
EParseLinesOptions
:
uint32
17
{
18
/** Use the default options when parsing lines. */
19
None
= 0,
20
/** Skip lines that are empty or, if trimming, only whitespace. */
21
SkipEmpty
= 1 << 0,
22
/** Trim whitespace from each parsed line. */
23
Trim
= 1 << 1,
24
};
25
26
ENUM_CLASS_FLAGS
(
EParseLinesOptions
);
27
28
/**
29
* Visit every line in the input string as terminated by any of CRLF, CR, LF.
30
*
31
* By default, empty lines are visited.
32
*
33
* @param View A view of the string to split into lines.
34
* @param Visitor A function that is called for each line.
35
* @param Options Flags to modify the default behavior.
36
*/
37
void
ParseLines
(
38
FStringView View,
39
TFunctionRef<
void
(FStringView)> Visitor,
40
EParseLinesOptions
Options =
EParseLinesOptions
::
None
);
41
42
/**
43
* Parse lines in the input string as terminated by any of CRLF, CR, LF.
44
*
45
* Output strings are sub-views of the input view and have the same lifetime as the input view.
46
* By default, empty lines are collected.
47
*
48
* @param View A view of the string to split into lines.
49
* @param Output The output to add parsed lines to by calling Output.Add(FStringView).
50
* @param Options Flags to modify the default behavior.
51
*/
52
template
<
typename
OutputType>
53
inline
void
ParseLines
(
54
const
FStringView View,
55
OutputType& Output,
56
const
EParseLinesOptions
Options =
EParseLinesOptions
::
None
)
57
{
58
ParseLines
(
View
, [&
Output
](
FStringView
Line
) {
Output
.
Add
(
Line
); },
Options
);
59
}
60
61
}
// UE::String
ENUM_CLASS_FLAGS
#define ENUM_CLASS_FLAGS(Enum)
Definition
EnumClassFlags.h:6
UE::String
Definition
Find.h:12
UE::String::ParseLines
void ParseLines(const FStringView View, OutputType &Output, const EParseLinesOptions Options=EParseLinesOptions::None)
Definition
ParseLines.h:53
UE::String::EParseLinesOptions
EParseLinesOptions
Definition
ParseLines.h:17
UE::String::EParseLinesOptions::Trim
@ Trim
UE::String::EParseLinesOptions::None
@ None
UE::String::EParseLinesOptions::SkipEmpty
@ SkipEmpty
UE::String::ParseLines
void ParseLines(FStringView View, TFunctionRef< void(FStringView)> Visitor, EParseLinesOptions Options=EParseLinesOptions::None)
UE
Definition
Vector.h:40
Downloads
ArkServerAPI_NEW
ASA
AsaApi
AsaApi
Core
Public
API
UE
String
ParseLines.h
Generated by
1.10.0