repos
/
qt.core
/ annotate_shade
summary
|
shortlog
|
log
|
tree
|
commit
|
commitdiff
|
headdiff
|
annotate
|
headblob
|
headfilediff
|
filehistory
normal
|
plain
|
shade
|
zebra
initial import
Annotate for file src/lib/qstring.cpp
2009-04-05 tobias
1
#include <QString>
17:56:16 '
2
#include <QtDebug>
'
3
'
4
/** @file
'
5
* @brief QString conversion. */
'
6
'
7
extern "C" {
'
8
'
9
/** Converts a QString to a QByteArray.
'
10
* @param qstring Pointer to a QString
'
11
*
'
12
* @return a pointer to a newly allocated char array.
'
13
*/
'
14
void*
'
15
qt_smoke_qstring_to_byte_array(const void* qstring)
'
16
{
'
17
Q_ASSERT(qstring);
'
18
const QString* string = static_cast<const QString*>(qstring);
'
19
'
20
return new QByteArray(string->toLocal8Bit());
'
21
}
'
22
'
23
/** Frees an QString.
'
24
* @param qstring the QString to free
'
25
*/
'
26
void
'
27
qt_smoke_free_qstring(void* qstring)
'
28
{
'
29
delete static_cast<QString*>(qstring);
'
30
}
'
31
'
32
/** Converts a string to a QString.
'
33
* @param data a char array
'
34
* @param length the length of @a data
'
35
*
'
36
* @return a newly allocated QString
'
37
*/
'
38
void*
'
39
qt_smoke_string_to_qstring(const char* data, int length)
'
40
{
'
41
return new QString(QString::fromLocal8Bit(data, length));
'
42
}
'
43
'
44
} // extern "C"