ObjQt  Diff

Differences From Artifact [5b64399c2b]:

To Artifact [d6be9ba96e]:


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 * 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()];
}







|




|







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
 * 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)
+ (instancetype)stringWithQString: (const QString &)qString
{
	return [[[self alloc] initWithQString: qString] autorelease];
}

- (instancetype)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()];
}