mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-28 10:02:14 +00:00
ADD: StringToNSString function
This commit is contained in:
parent
209eed8857
commit
5a2156abfa
1 changed files with 10 additions and 2 deletions
|
|
@ -30,13 +30,21 @@ interface
|
|||
uses
|
||||
Classes, SysUtils, MacOSAll, CocoaAll;
|
||||
|
||||
function StringToNSString(const S: String): NSString;
|
||||
function StringToCFStringRef(const S: String): CFStringRef;
|
||||
|
||||
function GetFileDescription(const FileName: String): String;
|
||||
|
||||
implementation
|
||||
|
||||
function StringToCFStringRef(const Value: String): CFStringRef;
|
||||
function StringToNSString(const S: String): NSString;
|
||||
begin
|
||||
Result:= CFStringCreateWithCString(nil, PAnsiChar(Value), kCFStringEncodingUTF8)
|
||||
Result:= NSString(NSString.stringWithUTF8String(PAnsiChar(S)));
|
||||
end;
|
||||
|
||||
function StringToCFStringRef(const S: String): CFStringRef;
|
||||
begin
|
||||
Result:= CFStringCreateWithCString(nil, PAnsiChar(S), kCFStringEncodingUTF8);
|
||||
end;
|
||||
|
||||
function GetFileDescription(const FileName: String): String;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue