RetroShare/libretroshare/src/dbase
leander-256 b30056e17f This patch allows Windows users to share files and folders with "exotic" characters.
The problem was that libretroshare handles files in UTF-8 but Windows's ANSI/POSIX C functions automatically assume that the char* parameters are encoded with the system's code page. There is no way to set that code page as UTF-8. So now under Windows the code translates the file name to UTF-16 before feeding it to one of the Unicode functions (they are usually prefixed or suffixed by 'w'). Please note that it is not very efficient.

Furthermore, Windows does not provide a Unicode version of opendir/readdir/closedir, so it was necessary to use FindFirstFileW/FindNextFileW/FindClose which has a different behaviour as well as different structures. The FolderIterator class was created in order to mimic the Unix way of traversing folders contents. Hence the algorithm is unchanged and the systems differences masked.

As it was necessary to use some functions from the Windows API, <windows.h> had to be included in a few files were it didn't appear before, creating macros and #define conflicts. In order to solve them, util/rswin.h must be included first in a file (if necessary). Otherwise the preprocessor will fail on purpose to avoid the code being compiled with different _WIN32_WINNT values.

As another side-effect, rstlvutil.h and rstlvutil.cc have been removed from libretroshare.pro file. They are only used by testing units and include util/utest.h which defines a macro FAILED that already exists in <windows.h>. I don't know if unit tests are still in use and I don't plan on coding often on Windows, so I'll leave that as an exercise (hot potato?) to a motivated fellow Windows programmer.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2924 b45a01b8-16f6-495d-af2f-9b41ad6348cc
2010-05-16 23:26:45 +00:00
..
cachestrapper.cc improved peer name info in cachestrapper, gence improving dir names in file lists 2010-01-23 21:38:38 +00:00
cachestrapper.h finished status service 2010-04-15 10:47:48 +00:00
cachetest.h Added Cache's to retroshare configuration. 2008-02-09 12:47:45 +00:00
ficachetest.cc Added Cache's to retroshare configuration. 2008-02-09 12:47:45 +00:00
fimonitor.cc This patch allows Windows users to share files and folders with "exotic" characters. 2010-05-16 23:26:45 +00:00
fimonitor.h cleaned the code in fimonitor, modified the order of file hashing, and put a more explicit progress message while hashing. 2010-02-26 23:05:07 +00:00
fimontest.cc Added a display for file hashing activity using notifyQt class. This time it works nicely. 2009-01-22 21:06:54 +00:00
findex.cc ported branch v0.5.0 commits 2623, 2624, 2626, 2633, 2634, 2643, 2644, 2646, 2651 and 2654 to trunk 2010-03-28 20:46:45 +00:00
findex.h made the age indicator functional, by recursively changing color of directory/files 2010-02-08 22:32:00 +00:00
fisavetest.cc - Removed old file indexing code. 2007-12-12 01:08:31 +00:00
fistore.cc added security check 2010-02-09 13:13:50 +00:00
fistore.h -add support for searching and display directories 2009-08-25 20:49:50 +00:00
fitest2.cc Created V0.3.x branch and moved the head into the trunk directory. 2007-11-15 03:18:48 +00:00
Makefile Added Cache's to retroshare configuration. 2008-02-09 12:47:45 +00:00
rsexpr.cc added regexp search to turtle router 2009-08-25 12:04:43 +00:00
searchtest.cc Created V0.3.x branch and moved the head into the trunk directory. 2007-11-15 03:18:48 +00:00