Test functionality from string_func.
More...
#include "../stdafx.h"
#include "../3rdparty/catch2/catch.hpp"
#include "../string_func.h"
#include "../strings_func.h"
#include "../core/string_builder.hpp"
#include "../core/string_consumer.hpp"
#include "../table/control_codes.h"
#include "table/strings.h"
#include "../safeguards.h"
Go to the source code of this file.
Test functionality from string_func.
Definition in file string_func.cpp.
◆ Compose()
template<typename... Args>
| std::string Compose |
( |
Args &&... | args | ) |
|
|
static |
◆ ComposePart() [1/2]
◆ ComposePart() [2/2]
| void ComposePart |
( |
StringBuilder & | builder, |
|
|
const std::string & | value ) |
|
static |
◆ FixSCCEncoded()
| void FixSCCEncoded |
( |
std::string & | str, |
|
|
bool | fix_code ) |
|
extern |
◆ FixSCCEncodedNegative()
| void FixSCCEncodedNegative |
( |
std::string & | str | ) |
|
|
extern |
Scan the string for SCC_ENCODED_NUMERIC with negative values, and reencode them as uint64_t.
- Parameters
-
Definition at line 1001 of file saveload.cpp.
References StringConsumer::AnyBytesLeft(), BaseStringBuilder::Put(), BaseStringBuilder::PutIntegerBase(), BaseStringBuilder::PutUtf8(), StringConsumer::READ_ONE_SEPARATOR, StringConsumer::ReadIntegerBase(), StringConsumer::ReadUntilUtf8(), StringConsumer::ReadUtf8If(), SCC_ENCODED, SCC_ENCODED_NUMERIC, and StringConsumer::TryReadIntegerBase().
Referenced by SlStdString().
◆ FixSCCEncodedNegativeWrapper()
| std::string FixSCCEncodedNegativeWrapper |
( |
const std::string & | str | ) |
|
|
static |
◆ FixSCCEncodedWrapper()
| std::string FixSCCEncodedWrapper |
( |
const std::string & | str, |
|
|
bool | fix_code ) |
|
static |
◆ TEST_CASE() [1/16]
| TEST_CASE |
( |
"ConvertHexToBytes" | | ) |
|
◆ TEST_CASE() [2/16]
| TEST_CASE |
( |
"EncodedString::ReplaceParam - negative" | | ) |
|
◆ TEST_CASE() [3/16]
| TEST_CASE |
( |
"EncodedString::ReplaceParam - positive" | | ) |
|
◆ TEST_CASE() [4/16]
| TEST_CASE |
( |
"FixSCCEncoded" | | ) |
|
◆ TEST_CASE() [5/16]
| TEST_CASE |
( |
"FixSCCEncodedNegative" | | ) |
|
◆ TEST_CASE() [6/16]
| TEST_CASE |
( |
"FormatArrayAsHex" | | ) |
|
◆ TEST_CASE() [7/16]
| TEST_CASE |
( |
"StrCompareIgnoreCase - std::string" | | ) |
|
◆ TEST_CASE() [8/16]
| TEST_CASE |
( |
"StrCompareIgnoreCase - std::string_view" | | ) |
|
◆ TEST_CASE() [9/16]
| TEST_CASE |
( |
"StrEndsWithIgnoreCase - std::string" | | ) |
|
◆ TEST_CASE() [10/16]
| TEST_CASE |
( |
"StrEndsWithIgnoreCase - std::string_view" | | ) |
|
◆ TEST_CASE() [11/16]
| TEST_CASE |
( |
"StrEqualsIgnoreCase - std::string" | | ) |
|
◆ TEST_CASE() [12/16]
| TEST_CASE |
( |
"StrEqualsIgnoreCase - std::string_view" | | ) |
|
◆ TEST_CASE() [13/16]
| TEST_CASE |
( |
"StrStartsWithIgnoreCase - std::string" | | ) |
|
◆ TEST_CASE() [14/16]
| TEST_CASE |
( |
"StrStartsWithIgnoreCase - std::string_view" | | ) |
|
◆ TEST_CASE() [15/16]
| TEST_CASE |
( |
"StrTrimInPlace" | | ) |
|
◆ TEST_CASE() [16/16]
| TEST_CASE |
( |
"StrTrimView" | | ) |
|
◆ _str_trim_testcases
| const std::vector<std::pair<std::string, std::string> > _str_trim_testcases |
|
static |
Initial value: = {
{"a", "a"},
{" a", "a"},
{"a ", "a"},
{" a ", "a"},
{" a b c ", "a b c"},
{" ", ""},
{" \r\f\t ", ""},
}
Definition at line 304 of file string_func.cpp.