OSDN Git Service

a2移行前のバックアップ。
[wordring-tm/wordring-tm.git] / html / htmlstring.h
1 #ifndef HTMLSTRING_H
2 #define HTMLSTRING_H
3
4 #include <QString>
5
6 template <typename T>
7 class string_cast
8 {
9 public:
10         string_cast(QString const &t) : m_t(t) { }
11         string_cast(int n) : m_t(QString::number(n)) { }
12         operator T const& () { return m_t; }
13 private:
14         T m_t;
15 };
16
17 template <typename T>
18 class value_cast
19 {
20 public:
21         value_cast(QChar const &ch) : m_t(ch.unicode()) { }
22         operator T const& () { return m_t; }
23 private:
24         T m_t;
25 };
26
27 QString encode_entities(QString const &from_);
28
29 /*
30 bool set_string(QString &to_, QString const &from_);
31 bool append_string(QString &to_, QString const &from_);
32 bool encode_entities(QString &to_, QString const &from_);
33 */
34
35
36 #endif // HTMLSTRING_H