]> git.lyx.org Git - lyx.git/blob - src/support/unicode.h
977ded6fd8d0377cc1c91cf5ce28541d2f72662c
[lyx.git] / src / support / unicode.h
1 /**
2  * \file unicode.h
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  *
8  * Full author contact details are available in file CREDITS.
9  *
10  * A collection of unicode conversion functions, using iconv.
11  */
12
13 #ifndef LYX_SUPPORT_UNICODE_H
14 #define LYX_SUPPORT_UNICODE_H
15
16 #include <boost/cstdint.hpp>
17 #include <vector>
18
19 // utf8_to_ucs4
20
21 // A single codepoint conversion for utf8_to_ucs4 does not make
22 // sense, so that function is left out.
23
24 std::vector<boost::uint32_t>
25 utf8_to_ucs4(std::vector<char> const & utf8str);
26
27 std::vector<boost::uint32_t>
28 utf8_to_ucs4(char const * utf8str, size_t ls);
29
30 // ucs2_to_ucs4
31
32 boost::uint32_t
33 ucs2_to_ucs4(unsigned short c);
34
35 std::vector<boost::uint32_t>
36 ucs2_to_ucs4(std::vector<unsigned short> const & ucs2str);
37
38 std::vector<boost::uint32_t>
39 ucs2_to_ucs4(unsigned short const * ucs2str, size_t ls);
40
41 // ucs4_to_ucs2
42
43 unsigned short
44 ucs4_to_ucs2(boost::uint32_t c);
45
46 std::vector<unsigned short>
47 ucs4_to_ucs2(std::vector<boost::uint32_t> const & ucs4str);
48
49 std::vector<unsigned short>
50 ucs4_to_ucs2(boost::uint32_t const * s, size_t ls);
51
52 // ucs4_to_utf8
53
54 std::vector<char>
55 ucs4_to_utf8(boost::uint32_t c);
56
57 std::vector<char>
58 ucs4_to_utf8(std::vector<boost::uint32_t> const & ucs4str);
59
60 std::vector<char>
61 ucs4_to_utf8(boost::uint32_t const * ucs4str, size_t ls);
62
63 #endif