File: utf8_utils.h

package info (click to toggle)
btanks 0.9.8083-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 43,616 kB
  • sloc: cpp: 46,425; ansic: 12,005; xml: 4,262; python: 313; sh: 13; makefile: 13
file content (40 lines) | stat: -rw-r--r-- 1,520 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef MRT_UTF8_UTILS_H__
#define MRT_UTF8_UTILS_H__

/* M-runtime for c++
 * Copyright (C) 2005-2008 Vladimir Menshakov
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/


#include "export_mrt.h"
#include <string>

namespace mrt {
	const std::string::size_type MRTAPI utf8_length(const std::string &str);
	void MRTAPI utf8_add_wchar(std::string &str, unsigned wchar);
	const size_t MRTAPI utf8_backspace(std::string &str, size_t pos);
	const size_t MRTAPI utf8_left(const std::string &str, const size_t pos);
	const size_t MRTAPI utf8_right(const std::string &str, const size_t pos);
	void MRTAPI utf8_resize(std::string &str, const size_t max);

	unsigned MRTAPI utf8_iterate(const std::string &str, size_t &start); //0 = end
	unsigned MRTAPI wchar2lower(unsigned ch);
	unsigned MRTAPI wchar2upper(unsigned ch);
}

#endif