Differences From Artifact [0c44cda950]:
- File common/OFString+QString.mm — part of check-in [01e4161d3e] at 2017-04-12 09:17:10 on branch trunk — Add a license (user: js, size: 1828) [annotate] [blame] [check-ins using]
- File
src/common/OFString+QString.mm
— part of check-in
[baf52ea3b1]
at
2017-04-17 23:25:45
on branch trunk
— Add a proper build system
Also lowers the minimum required Qt version to 5.5. (user: js, size: 1828) [annotate] [blame] [check-ins using]
To Artifact [5b64399c2b]:
- File src/common/OFString+QString.mm — part of check-in [860515ac5a] at 2017-05-08 00:11:18 on branch trunk — Update to recent ObjFW changes (user: js, size: 1817) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
19 20 21 22 23 24 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "OFString+QString.h" @implementation OFString (QString) | | | | | | | | | | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ #import "OFString+QString.h" @implementation OFString (QString) + stringWithQString: (const QString &)qString { return [[[self alloc] initWithQString: qString] autorelease]; } - initWithQString: (const QString &)qString { static_assert(sizeof(QChar) == sizeof(char16_t), "QChar and char16_t have a different size!"); return [self initWithUTF16String: (char16_t *)qString.data() length: qString.length()]; } - (QString)qString { static_assert(sizeof(char16_t) == sizeof(QChar), "char16_t and QChar have a different size!"); void *pool = objc_autoreleasePoolPush(); QString ret = QString((QChar *)[self UTF16String]); objc_autoreleasePoolPop(pool); return ret; } @end |