ASPiK SDK
macutilities.h
1 // This file is part of VSTGUI. It is subject to the license terms
2 // in the LICENSE file found in the top-level directory of this
3 // distribution and at http://github.com/steinbergmedia/vstgui/LICENSE
4 
5 #pragma once
6 
7 #import "../../../../lib/platform/mac/macstring.h"
8 
9 #import <Foundation/Foundation.h>
10 
11 //------------------------------------------------------------------------
12 inline NSString* stringFromUTF8String (const VSTGUI::UTF8String& str)
13 {
14  auto macStr = dynamic_cast<VSTGUI::MacString*> (str.getPlatformString ());
15  if (macStr && macStr->getCFString ())
16  {
17  return (__bridge NSString*)macStr->getCFString ();
18  }
19  return [NSString stringWithUTF8String:str.data ()];
20 }
holds an UTF8 encoded string and a platform representation of it
Definition: cstring.h:56