]>
Commit | Line | Data |
---|---|---|
f6bcfd97 BP |
1 | % |
2 | % automatically generated by HelpGen from | |
3 | % ../include/wx/strconv.h at 25/Mar/00 10:20:56 | |
4 | % | |
5 | ||
6 | \section{\class{wxMBConvFile}}\label{wxmbconvfile} | |
7 | ||
802fa226 | 8 | This class used to define the class instance |
a7d34a61 RR |
9 | {\bf wxConvFileName}, but nowadays {\bf wxConvFileName} is |
10 | either of type wxConvLibc (on most platforms) or wxConvUTF8 | |
11 | (on MacOS X). {\bf wxConvFileName} converts filenames between | |
12 | filesystem multibyte encoding and Unicode. {\bf wxConvFileName} | |
13 | can also be set to a something else at run-time which is used | |
14 | e.g. by wxGTK to use a class which checks the environment | |
15 | variable {\bf G_FILESYSTEM_ENCODING} indicating that filenames | |
16 | should not be interpreted as UTF8 and also for converting | |
17 | invalid UTF8 characters (e.g. if there is a filename in iso8859_1) | |
18 | to strings with octal values. | |
19 | ||
802fa226 JS |
20 | Since some platforms (such as Win32) use Unicode in the filenames, |
21 | and others (such as Unix) use multibyte encodings, this class should only | |
f6bcfd97 | 22 | be used directly if wxMBFILES is defined to 1. A convenience macro, |
a7d34a61 RR |
23 | wxFNCONV, is defined to wxConvFileName->cWX2MB in this case. You could |
24 | use it like this: | |
f6bcfd97 BP |
25 | |
26 | \begin{verbatim} | |
27 | wxChar *name = wxT("rawfile.doc"); | |
28 | FILE *fil = fopen(wxFNCONV(name), "r"); | |
29 | \end{verbatim} | |
30 | ||
31 | (although it would be better to use wxFopen(name, wxT("r")) in this case.) | |
32 | ||
33 | \wxheading{Derived from} | |
34 | ||
35 | \helpref{wxMBConv}{wxmbconv} | |
36 | ||
37 | \wxheading{Include files} | |
38 | ||
39 | <wx/strconv.h> | |
40 | ||
41 | \wxheading{See also} | |
42 | ||
43 | \helpref{wxMBConv classes overview}{mbconvclasses} | |
44 | ||
45 | \latexignore{\rtfignore{\wxheading{Members}}} | |
46 | ||
47 | ||
48 | \membersection{wxMBConvFile::MB2WC}\label{wxmbconvfilemb2wc} | |
49 | ||
50 | \constfunc{size\_t}{MB2WC}{\param{wchar\_t* }{buf}, \param{const char* }{psz}, \param{size\_t }{n}} | |
51 | ||
52 | Converts from multibyte filename encoding to Unicode. Returns the size of the destination buffer. | |
53 | ||
54 | \membersection{wxMBConvFile::WC2MB}\label{wxmbconvfilewc2mb} | |
55 | ||
56 | \constfunc{size\_t}{WC2MB}{\param{char* }{buf}, \param{const wchar\_t* }{psz}, \param{size\_t }{n}} | |
57 | ||
58 | Converts from Unicode to multibyte filename encoding. Returns the size of the destination buffer. | |
59 |