summaryrefslogtreecommitdiffstats
path: root/src/rtf2html/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/rtf2html/common.h')
-rw-r--r--src/rtf2html/common.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/rtf2html/common.h b/src/rtf2html/common.h
new file mode 100644
index 0000000..01b1f5b
--- /dev/null
+++ b/src/rtf2html/common.h
@@ -0,0 +1,38 @@
+/* This is RTF to HTML converter, implemented as a text filter, generally.
+ Copyright (C) 2003 Valentin Lavrinenko, [email protected]
+
+ available at http://rtf2html.sf.net
+
+ Original available under the terms of the GNU LGPL2, and according
+ to those terms, relicensed under the GNU GPL2 for inclusion in Tellico */
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of version 2 of the GNU General Public License as *
+ * published by the Free Software Foundation; *
+ * *
+ ***************************************************************************/
+
+#ifndef __COMMON_H__
+#define __COMMON_H__
+
+#include <string>
+#include <sstream>
+#include <iomanip>
+
+inline std::string from_int(int value)
+{
+ std::ostringstream buf;
+ buf<<value;
+ return buf.str();
+}
+
+inline std::string hex(unsigned int value)
+{
+ std::ostringstream buf;
+ buf<<std::setw(2)<<std::setfill('0')<<std::hex<<value;
+ return buf.str();
+}
+
+#endif