42 #include <private/qcore_mac_p.h> 52 CFIndex length = CFStringGetLength(str);
57 CFStringGetCharacters(str, CFRangeMake(0, length), reinterpret_cast<UniChar *>(const_cast<QChar *>(
string.unicode())));
71 return CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar *>(
string.unicode()),
78 if (
string.
d->data !=
string.d->array)
79 const_cast<QCFString*
>(
this)->
string.realloc();
81 CFStringCreateWithCharactersNoCopy(0,
82 reinterpret_cast<const UniChar *>(
string.unicode()),
90 #if !defined(Q_OS_IOS) 97 mapping.unicodeEncoding = CreateTextEncoding(kTextEncodingUnicodeDefault,
98 kTextEncodingDefaultVariant,
100 mapping.otherEncoding = (encoding ? encoding : );
101 mapping.mappingVersion = kUnicodeUseLatestMapping;
103 UnicodeToTextInfo
info;
104 OSStatus err = CreateUnicodeToTextInfo(&mapping, &info);
106 qDebug(
"Qt: internal: Unable to create pascal string '%s'::%d [%ld]",
107 s.
left(len).latin1(), (int)encoding, err);
110 const int unilen = len * 2;
111 const UniChar *unibuf = (UniChar *)s.
unicode();
112 ConvertFromUnicodeToPString(info, unilen, unibuf, str);
113 DisposeUnicodeToTextInfo(&info);
116 CFStringGetPascalString(
QCFString(s), str, 256, CFStringGetSystemEncoding());
122 return QCFString(CFStringCreateWithPascalString(0, pstr, CFStringGetSystemEncoding()));
127 return FSPathMakeRef(reinterpret_cast<const UInt8 *>(file.
toUtf8().
constData()), fsref, 0);
136 ret = FSGetCatalogInfo(&fsref, kFSCatInfoNone, 0, 0, spec, 0);
139 #endif // !defined(Q_OS_IOS)
const struct __CFString * CFStringRef
OSErr qt_mac_create_fsspec(const QString &file, FSSpec *spec)
static mach_timebase_info_data_t info
#define QT_END_NAMESPACE
This macro expands to.
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
int length() const
Returns the number of characters in this string.
static CFStringRef toCFStringRef(const QString &str)
static QString toQString(CFStringRef cfstr)
The QString class provides a Unicode character string.
OSErr qt_mac_create_fsref(const QString &file, FSRef *fsref)
Q_CORE_EXPORT void qDebug(const char *,...)
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool isEmpty(const char *str)
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
const QChar * unicode() const
Returns a '\0'-terminated Unicode representation of the string.
QCFString(const QString &str)
const char * constData() const
Returns a pointer to the data stored in the byte array.
static QMap< QByteArray, int > mapping
QString qt_mac_from_pascal_string(const Str255 pstr)
void qt_mac_to_pascal_string(const QString &s, Str255 str, TextEncoding encoding, int len)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...