File indexing completed on 2025-01-26 04:44:01

0001 /*  This is RTF to HTML converter, implemented as a text filter, generally.
0002     Copyright (C) 2003 Valentin Lavrinenko, vlavrinenko@users.sourceforge.net
0003 
0004     available at http://rtf2html.sf.net
0005 
0006     Original available under the terms of the GNU LGPL2, and according
0007     to those terms, relicensed under the GNU GPL2 for inclusion in Tellico */
0008 
0009 /***************************************************************************
0010  *                                                                         *
0011  *   This program is free software; you can redistribute it and/or         *
0012  *   modify it under the terms of the GNU General Public License as        *
0013  *   published by the Free Software Foundation; either version 2 of        *
0014  *   the License or (at your option) version 3 or any later version        *
0015  *   accepted by the membership of KDE e.V. (or its successor approved     *
0016  *   by the membership of KDE e.V.), which shall act as a proxy            *
0017  *   defined in Section 14 of version 3 of the license.                    *
0018  *                                                                         *
0019  *   This program is distributed in the hope that it will be useful,       *
0020  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0021  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0022  *   GNU General Public License for more details.                          *
0023  *                                                                         *
0024  *   You should have received a copy of the GNU General Public License     *
0025  *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
0026  *                                                                         *
0027  ***************************************************************************/
0028 
0029 #ifndef __COMMON_H__
0030 #define __COMMON_H__
0031 
0032 #include <string>
0033 #include <sstream>
0034 #include <iomanip>
0035 
0036 inline std::string from_int(int value)
0037 {
0038    std::ostringstream buf;
0039    buf<<value;
0040    return buf.str();
0041 }
0042 
0043 inline std::string hex(unsigned int value)
0044 {
0045    std::ostringstream buf;
0046    buf<<std::setw(2)<<std::setfill('0')<<std::hex<<value;
0047    return buf.str();
0048 }
0049 
0050 #endif