]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Str: Add wchar_t support
authorAidan Van Dyk <aidan@highrise.ca>
Wed, 23 Dec 2009 20:27:10 +0000 (15:27 -0500)
committerAidan Van Dyk <aidan@ifax.com>
Wed, 27 Jun 2012 02:50:11 +0000 (22:50 -0400)
Some uses of our HylaFAX Clients user wchar_t strings

libhylafax/Str.c++
libhylafax/Str.h

index 3e60c51fe59206d4e2fdd833e20b3afc77fa7dcc..1122a8035abc140a2119d7a31762b6570fa76993 100644 (file)
@@ -452,6 +452,14 @@ void fxStr::operator=(const char *s)
     memcpy(data,s,slength);
 }
 
+void fxStr::operator=(const wchar_t *s)
+{
+    int nl = wcstombs(NULL, s, 0);
+    resizeInternal(nl);
+    slength = nl+1;
+    wcstombs(data, s, slength);
+}
+
 void fxStr::append(const char * s, u_int l)
 {
     if (!l) l = strlen(s);
index f839857139ac70af434888ae0fbf88ac11b5f1d9..916f2f454cd75ecf2de319a7a128b199f203b521 100644 (file)
@@ -112,6 +112,7 @@ public:
     void operator=(const fxTempStr& s);
     void operator=(fxStr const& s);
     void operator=(char const *s);
+    void operator=(wchar_t const *s);
 
     /////////////////////////////////////////////////////
     // Comparison