1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:17:44 +00:00

AK+Everywhere: Turn bool keep_empty to an enum in split* functions

This commit is contained in:
demostanis 2022-10-22 15:38:21 +02:00 committed by Linus Groh
parent f485db2501
commit 3e8b5ac920
44 changed files with 96 additions and 81 deletions

View file

@ -8,6 +8,7 @@
#pragma once
#include <AK/Concepts.h>
#include <AK/EnumBits.h>
#include <AK/Forward.h>
namespace AK {
@ -38,6 +39,14 @@ enum class TrimWhitespace {
No,
};
enum class SplitBehavior : unsigned {
Nothing = 0,
// If two separators follow each other without any characters
// in between, keep a "" in the resulting vector.
KeepEmpty = 1,
};
AK_ENUM_BITWISE_OPERATORS(SplitBehavior);
struct MaskSpan {
size_t start;
size_t length;
@ -99,5 +108,6 @@ size_t count(StringView, StringView needle);
using AK::CaseSensitivity;
using AK::ReplaceMode;
using AK::SplitBehavior;
using AK::TrimMode;
using AK::TrimWhitespace;