author | llornkcor <llornkcor> | 2002-12-20 01:35:01 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-12-20 01:35:01 (UTC) |
commit | 876e1a4724a7bd75dc642e295de354241096e028 (patch) (side-by-side diff) | |
tree | a37c5dcc9d78e04bb6b859ab89d8cf81e6745087 /noncore/apps/opie-reader/ustring.h | |
parent | 5fd6636ba3d94b48dd543887316c47c5388a43c2 (diff) | |
download | opie-876e1a4724a7bd75dc642e295de354241096e028.zip opie-876e1a4724a7bd75dc642e295de354241096e028.tar.gz opie-876e1a4724a7bd75dc642e295de354241096e028.tar.bz2 |
update - sorry it took so long. hope this works correctly
Diffstat (limited to 'noncore/apps/opie-reader/ustring.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/ustring.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/ustring.h b/noncore/apps/opie-reader/ustring.h index a4dc048..a3ef8df 100644 --- a/noncore/apps/opie-reader/ustring.h +++ b/noncore/apps/opie-reader/ustring.h @@ -54,18 +54,30 @@ inline QString toQString(tchar *_p) return ret; } inline QString toQString(tchar *_p, unsigned int len) { if (_p == NULL) return 0; unsigned int i = 0; tchar *p = _p; QString ret; while (*p != 0 && i < len) ret[i++] = *(p++); return ret; } + +inline tchar* fromQString(const QString& qs) +{ + int len = qs.length(); + tchar* ret = new tchar[len+1]; + for (int i = 0; i < len; i++) + { + ret[i] = qs[i].unicode(); + } + ret[len] = 0; + return ret; +} #else inline size_t ustrlen(const tchar* _p) { return strlen(_p); } inline int ustrcmp(const tchar* _p1, const tchar* _p2) { return strcmp(_p1, _p2); } #endif |