Qt 4.8
Public Functions | Static Public Functions | Properties | List of all members
QCFString Class Reference

#include <qcore_mac_p.h>

Inheritance diagram for QCFString:
QCFType< CFStringRef >

Public Functions

 operator CFStringRef () const
 
 operator QString () const
 
 QCFString (const QString &str)
 
 QCFString (const CFStringRef cfstr=0)
 
 QCFString (const QCFType< CFStringRef > &other)
 
- Public Functions inherited from QCFType< CFStringRef >
as () const
 
 operator CFStringRef ()
 
CFStringRefoperator& ()
 
QCFType operator= (const QCFType &helper)
 
 QCFType (const CFStringRef &t=0)
 
 QCFType (const QCFType &helper)
 
 ~QCFType ()
 

Static Public Functions

static CFStringRef toCFStringRef (const QString &str)
 
static QString toQString (CFStringRef cfstr)
 
- Static Public Functions inherited from QCFType< CFStringRef >
static QCFType constructFromGet (const CFStringRef &t)
 

Properties

QString string
 

Additional Inherited Members

- Protected Variables inherited from QCFType< CFStringRef >
CFStringRef type
 

Detailed Description

Definition at line 138 of file qcore_mac_p.h.

Constructors and Destructors

◆ QCFString() [1/3]

QCFString::QCFString ( const QString str)
inline

Definition at line 141 of file qcore_mac_p.h.

Referenced by qt_mac_from_pascal_string(), and qt_mac_to_pascal_string().

141 : QCFType<CFStringRef>(0), string(str) {}

◆ QCFString() [2/3]

QCFString::QCFString ( const CFStringRef  cfstr = 0)
inline

Definition at line 142 of file qcore_mac_p.h.

◆ QCFString() [3/3]

QCFString::QCFString ( const QCFType< CFStringRef > &  other)
inline

Definition at line 143 of file qcore_mac_p.h.

Functions

◆ operator CFStringRef()

QCFString::operator CFStringRef ( ) const

Definition at line 75 of file qcore_mac.cpp.

76 {
77  if (!type) {
78  if (string.d->data != string.d->array)
79  const_cast<QCFString*>(this)->string.realloc(); // ### Qt5: do we really need this stupid user protection?
80  const_cast<QCFString*>(this)->type =
81  CFStringCreateWithCharactersNoCopy(0,
82  reinterpret_cast<const UniChar *>(string.unicode()),
83  string.length(),
84  kCFAllocatorNull);
85  }
86  return type;
87 }
double d
Definition: qnumeric_p.h:62

◆ operator QString()

QCFString::operator QString ( ) const

Definition at line 62 of file qcore_mac.cpp.

63 {
64  if (string.isEmpty() && type)
65  const_cast<QCFString*>(this)->string = toQString(type);
66  return string;
67 }
static QString toQString(CFStringRef cfstr)
Definition: qcore_mac.cpp:47
static bool isEmpty(const char *str)
QString string
Definition: qcore_mac_p.h:149

◆ toCFStringRef()

CFStringRef QCFString::toCFStringRef ( const QString str)
static

◆ toQString()

QString QCFString::toQString ( CFStringRef  cfstr)
static

Definition at line 47 of file qcore_mac.cpp.

Referenced by QPrinterInfo::availablePrinters(), QFileSystemEngine::bundleName(), QFileSystemEngine::canonicalName(), QCoreWlanEngine::connectToId(), QMacPasteboardMimeVCard::convertFromMime(), QCoreWlanEngine::doRequestUpdate(), QDragManager::drag(), familyNameFromPostScriptName(), QMacSettingsPrivate::fileName(), flipYCoordinate(), QMacPasteboard::formats(), QFSEventsFileSystemWatcherEngine::fseventsCallback(), get_device_info(), getCFLocaleValue(), QFileSystemEngine::getLinkTarget(), getMacDateFormat(), getMacLocaleName(), getMacTimeFormat(), QScanThread::getUserConfigurations(), QMacPasteboard::hasFormat(), isHostExcluded(), macCurrencySymbol(), macDayName(), macFormatCurrency(), macMeasurementSystem(), macMonthName(), macQueryInternal(), macQuoteString(), networkChangeCallback(), operator QString(), performNamedAction(), QCoreTextFontDatabase::populateFontDatabase(), QMacPasteboard::promiseKeeper(), QMacPrintEngine::property(), proxyFromDictionary(), qfontForCocoaFont(), QMacPasteboard::QMacPasteboard(), qt_init(), QFileDialogPrivate::qt_mac_filedialog_event_proc(), qtKey(), qtKey2CocoaKey(), qtValue(), QMacPasteboard::retrieveData(), QScanThread::run(), QFileDialogPrivate::selectedFiles_sys(), setNamedAttribute(), QMacPrintEngine::setProperty(), QCoreWlanEngine::startTime(), and QKeyMapperPrivate::~QKeyMapperPrivate().

48 {
49  if (!str)
50  return QString();
51 
52  CFIndex length = CFStringGetLength(str);
53  if (length == 0)
54  return QString();
55 
57  CFStringGetCharacters(str, CFRangeMake(0, length), reinterpret_cast<UniChar *>(const_cast<QChar *>(string.unicode())));
58 
59  return string;
60 }
The QString class provides a Unicode character string.
Definition: qstring.h:83
QString string
Definition: qcore_mac_p.h:149

Properties

◆ string

QString QCFString::string
private

Definition at line 149 of file qcore_mac_p.h.

Referenced by operator QString(), and toQString().


The documentation for this class was generated from the following files: