File: CharsetConverter.h

package info (click to toggle)
htmlcxx 0.87-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,412 kB
  • sloc: sh: 4,380; cpp: 4,355; yacc: 526; ansic: 205; lex: 159; makefile: 47; perl: 27
file content (30 lines) | stat: -rw-r--r-- 532 bytes parent folder | download | duplicates (2)
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
#ifndef __CHARSET_CONVERTER_H__
#define __CHARSET_CONVERTER_H__

#include <iconv.h>
#include <string>
#include <stdexcept>

namespace htmlcxx
{
	class CharsetConverter
	{
		public:
			class Exception : public std::runtime_error
			{
				public:
					Exception(const std::string &arg)
						: std::runtime_error(arg) {}
			};
			
			CharsetConverter(const std::string &from, const std::string &to);
			~CharsetConverter();
			
			std::string convert(const std::string &input);

		private:
			iconv_t mIconvDescriptor;;
	};
}

#endif