mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 16:25:06 +00:00
Add sys$gethostname and /bin/hostname
This commit is contained in:
parent
3faaa3e04a
commit
53abfa7ea1
16 changed files with 77 additions and 40 deletions
|
@ -22,6 +22,18 @@ String String::empty()
|
|||
return StringImpl::theEmptyStringImpl();
|
||||
}
|
||||
|
||||
String String::isolatedCopy() const
|
||||
{
|
||||
if (!m_impl)
|
||||
return { };
|
||||
if (!m_impl->length())
|
||||
return empty();
|
||||
char* buffer;
|
||||
auto impl = StringImpl::createUninitialized(length(), buffer);
|
||||
memcpy(buffer, m_impl->characters(), m_impl->length());
|
||||
return String(move(*impl));
|
||||
}
|
||||
|
||||
String String::substring(size_t start, size_t length) const
|
||||
{
|
||||
ASSERT(m_impl);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue