mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:37:45 +00:00
AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
This commit is contained in:
parent
f74251606d
commit
6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions
|
@ -5,7 +5,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <LibCore/File.h>
|
||||
#include <LibTest/TestCase.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -23,7 +23,7 @@ TEST_CASE(test_mktemp_unique_filename)
|
|||
|
||||
if (fork() == 0) {
|
||||
char path[] = "/tmp/test.mktemp.XXXXXX";
|
||||
auto temp_path = String::formatted("{}", mktemp(path));
|
||||
auto temp_path = DeprecatedString::formatted("{}", mktemp(path));
|
||||
EXPECT(temp_path.characters());
|
||||
unlink(path);
|
||||
|
||||
|
@ -33,10 +33,10 @@ TEST_CASE(test_mktemp_unique_filename)
|
|||
} else {
|
||||
wait(NULL);
|
||||
|
||||
auto path1 = String::formatted("{}", reinterpret_cast<char const*>(ptr));
|
||||
auto path1 = DeprecatedString::formatted("{}", reinterpret_cast<char const*>(ptr));
|
||||
|
||||
char path[] = "/tmp/test.mktemp.XXXXXX";
|
||||
auto path2 = String::formatted("{}", mktemp(path));
|
||||
auto path2 = DeprecatedString::formatted("{}", mktemp(path));
|
||||
EXPECT(path2.characters());
|
||||
unlink(path);
|
||||
|
||||
|
@ -53,7 +53,7 @@ TEST_CASE(test_mkdtemp_unique_filename)
|
|||
|
||||
if (fork() == 0) {
|
||||
char path[] = "/tmp/test.mkdtemp.XXXXXX";
|
||||
auto temp_path = String::formatted("{}", mkdtemp(path));
|
||||
auto temp_path = DeprecatedString::formatted("{}", mkdtemp(path));
|
||||
EXPECT(temp_path.characters());
|
||||
rmdir(path);
|
||||
|
||||
|
@ -63,10 +63,10 @@ TEST_CASE(test_mkdtemp_unique_filename)
|
|||
} else {
|
||||
wait(NULL);
|
||||
|
||||
auto path1 = String::formatted("{}", reinterpret_cast<char const*>(ptr));
|
||||
auto path1 = DeprecatedString::formatted("{}", reinterpret_cast<char const*>(ptr));
|
||||
|
||||
char path[] = "/tmp/test.mkdtemp.XXXXXX";
|
||||
auto path2 = String::formatted("{}", mkdtemp(path));
|
||||
auto path2 = DeprecatedString::formatted("{}", mkdtemp(path));
|
||||
EXPECT(path2.characters());
|
||||
rmdir(path);
|
||||
|
||||
|
@ -86,7 +86,7 @@ TEST_CASE(test_mkstemp_unique_filename)
|
|||
auto fd = mkstemp(path);
|
||||
EXPECT_NE(fd, -1);
|
||||
|
||||
auto temp_path_or_error = Core::File::read_link(String::formatted("/proc/{}/fd/{}", getpid(), fd));
|
||||
auto temp_path_or_error = Core::File::read_link(DeprecatedString::formatted("/proc/{}/fd/{}", getpid(), fd));
|
||||
EXPECT(!temp_path_or_error.is_error());
|
||||
|
||||
auto temp_path = temp_path_or_error.release_value();
|
||||
|
@ -101,13 +101,13 @@ TEST_CASE(test_mkstemp_unique_filename)
|
|||
} else {
|
||||
wait(NULL);
|
||||
|
||||
auto path1 = String::formatted("{}", reinterpret_cast<char const*>(ptr));
|
||||
auto path1 = DeprecatedString::formatted("{}", reinterpret_cast<char const*>(ptr));
|
||||
|
||||
char path[] = "/tmp/test.mkstemp.XXXXXX";
|
||||
auto fd = mkstemp(path);
|
||||
EXPECT(fd != -1);
|
||||
|
||||
auto path2_or_error = Core::File::read_link(String::formatted("/proc/{}/fd/{}", getpid(), fd));
|
||||
auto path2_or_error = Core::File::read_link(DeprecatedString::formatted("/proc/{}/fd/{}", getpid(), fd));
|
||||
EXPECT(!path2_or_error.is_error());
|
||||
|
||||
auto path2 = path2_or_error.release_value();
|
||||
|
@ -132,7 +132,7 @@ TEST_CASE(test_mkstemps_unique_filename)
|
|||
auto fd = mkstemps(path, 6);
|
||||
EXPECT_NE(fd, -1);
|
||||
|
||||
auto temp_path_or_error = Core::File::read_link(String::formatted("/proc/{}/fd/{}", getpid(), fd));
|
||||
auto temp_path_or_error = Core::File::read_link(DeprecatedString::formatted("/proc/{}/fd/{}", getpid(), fd));
|
||||
EXPECT(!temp_path_or_error.is_error());
|
||||
|
||||
auto temp_path = temp_path_or_error.release_value();
|
||||
|
@ -151,13 +151,13 @@ TEST_CASE(test_mkstemps_unique_filename)
|
|||
} else {
|
||||
wait(NULL);
|
||||
|
||||
auto path1 = String::formatted("{}", reinterpret_cast<char const*>(ptr));
|
||||
auto path1 = DeprecatedString::formatted("{}", reinterpret_cast<char const*>(ptr));
|
||||
|
||||
char path[] = "/tmp/test.mkstemps.prefixXXXXXXsuffix";
|
||||
auto fd = mkstemps(path, 6);
|
||||
EXPECT(fd != -1);
|
||||
|
||||
auto path2_or_error = Core::File::read_link(String::formatted("/proc/{}/fd/{}", getpid(), fd));
|
||||
auto path2_or_error = Core::File::read_link(DeprecatedString::formatted("/proc/{}/fd/{}", getpid(), fd));
|
||||
EXPECT(!path2_or_error.is_error());
|
||||
|
||||
auto path2 = path2_or_error.release_value();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue