mirror of
https://github.com/RGBCube/serenity
synced 2025-09-14 20:56:18 +00:00
Ladybird/AppKit: Implement the <input type=file> UI
This commit is contained in:
parent
834f76ef24
commit
a346f14fb4
3 changed files with 45 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/ByteString.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <LibGfx/Color.h>
|
||||
|
@ -18,6 +19,7 @@
|
|||
namespace Ladybird {
|
||||
|
||||
String ns_string_to_string(NSString*);
|
||||
ByteString ns_string_to_byte_string(NSString*);
|
||||
NSString* string_to_ns_string(StringView);
|
||||
|
||||
NSData* string_to_ns_data(StringView);
|
||||
|
|
|
@ -14,6 +14,12 @@ String ns_string_to_string(NSString* string)
|
|||
return MUST(String::from_utf8({ utf8, strlen(utf8) }));
|
||||
}
|
||||
|
||||
ByteString ns_string_to_byte_string(NSString* string)
|
||||
{
|
||||
auto const* utf8 = [string UTF8String];
|
||||
return ByteString(utf8, strlen(utf8));
|
||||
}
|
||||
|
||||
NSString* string_to_ns_string(StringView string)
|
||||
{
|
||||
return [[NSString alloc] initWithData:string_to_ns_data(string) encoding:NSUTF8StringEncoding];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue