author | llornkcor <llornkcor> | 2002-12-20 01:35:01 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-12-20 01:35:01 (UTC) |
commit | 876e1a4724a7bd75dc642e295de354241096e028 (patch) (unidiff) | |
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 | |||
@@ -60,12 +60,24 @@ inline QString toQString(tchar *_p, unsigned int len) | |||
60 | unsigned int i = 0; | 60 | unsigned int i = 0; |
61 | tchar *p = _p; | 61 | tchar *p = _p; |
62 | QString ret; | 62 | QString ret; |
63 | while (*p != 0 && i < len) ret[i++] = *(p++); | 63 | while (*p != 0 && i < len) ret[i++] = *(p++); |
64 | return ret; | 64 | return ret; |
65 | } | 65 | } |
66 | |||
67 | inline tchar* fromQString(const QString& qs) | ||
68 | { | ||
69 | int len = qs.length(); | ||
70 | tchar* ret = new tchar[len+1]; | ||
71 | for (int i = 0; i < len; i++) | ||
72 | { | ||
73 | ret[i] = qs[i].unicode(); | ||
74 | } | ||
75 | ret[len] = 0; | ||
76 | return ret; | ||
77 | } | ||
66 | #else | 78 | #else |
67 | 79 | ||
68 | inline size_t ustrlen(const tchar* _p) { return strlen(_p); } | 80 | inline size_t ustrlen(const tchar* _p) { return strlen(_p); } |
69 | inline int ustrcmp(const tchar* _p1, const tchar* _p2) { return strcmp(_p1, _p2); } | 81 | inline int ustrcmp(const tchar* _p1, const tchar* _p2) { return strcmp(_p1, _p2); } |
70 | 82 | ||
71 | #endif | 83 | #endif |