monotone

monotone Mtn Source Tree

Root/charset.hh

1#ifndef __CHARSET_HH__
2#define __CHARSET_HH__
3
4// Copyright (C) 2002 Graydon Hoare <graydon@pobox.com>
5//
6// This program is made available under the GNU GPL version 2.0 or
7// greater. See the accompanying file COPYING for details.
8//
9// This program is distributed WITHOUT ANY WARRANTY; without even the
10// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11// PURPOSE.
12
13#include "vocab.hh"
14
15// Charset conversions.
16
17void charset_convert(std::string const & src_charset,
18 std::string const & dst_charset,
19 std::string const & src,
20 std::string & dst,
21 bool best_effort);
22void system_to_utf8(external const & system, utf8 & utf);
23void utf8_to_system_strict(utf8 const & utf, external & system);
24void utf8_to_system_strict(utf8 const & utf, std::string & system);
25void utf8_to_system_best_effort(utf8 const & utf, external & system);
26void utf8_to_system_best_effort(utf8 const & utf, std::string & system);
27bool utf8_validate(utf8 const & utf);
28
29// Returns length in characters (not bytes).
30// Is not aware of combining and invisible characters.
31size_t display_width(utf8 const & utf);
32
33// Specific internal / external conversions for various vocab terms.
34void internalize_cert_name(utf8 const & utf, cert_name & c);
35void internalize_cert_name(external const & ext, cert_name & c);
36void externalize_cert_name(cert_name const & c, utf8 & utf);
37void externalize_cert_name(cert_name const & c, external & ext);
38void internalize_rsa_keypair_id(utf8 const & utf, rsa_keypair_id & key);
39void internalize_rsa_keypair_id(external const & ext, rsa_keypair_id & key);
40void externalize_rsa_keypair_id(rsa_keypair_id const & key, utf8 & utf);
41void externalize_rsa_keypair_id(rsa_keypair_id const & key, external & ext);
42void internalize_var_domain(utf8 const & utf, var_domain & d);
43void internalize_var_domain(external const & ext, var_domain & d);
44void externalize_var_domain(var_domain const & d, utf8 & utf);
45void externalize_var_domain(var_domain const & d, external & ext);
46
47// Local Variables:
48// mode: C++
49// fill-column: 76
50// c-file-style: "gnu"
51// indent-tabs-mode: nil
52// End:
53// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:
54
55#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status