/usr/include/libelemental/misc/ucompose.tcc is in libelemental-dev 1.2.0-9.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 | /*
* This file is part of libmisc, an assortment of code for reuse.
* Modified from compose version 1.0.4.
*
* Copyright (c) 2006-2007 Kevin Daughtridge <kevin@kdau.com>
* Copyright (c) 2002-2004 Ole Laursen <olau@hardworking.dk>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBMISC__UCOMPOSE_TCC
#define LIBMISC__UCOMPOSE_TCC
#ifndef LIBMISC__UCOMPOSE_HH
#error "ucompose.tcc must be included from ucompose.hh."
#endif
namespace compose {
//******************************************************************************
// class UComposition
template<typename T>
inline UComposition&
UComposition::arg (const T &obj)
{
do_arg (stringify (obj));
return *this;
}
template<typename T>
inline string
UComposition::stringify (T obj)
{
os << obj;
return do_stringify (os.str ());
}
#ifndef DOXYGEN_SHOULD_SKIP_THIS
template<>
inline string
UComposition::stringify<string> (string obj)
{
return obj;
}
template<>
inline string
UComposition::stringify<ustring> (ustring obj)
{
return obj;
}
template<>
inline string
UComposition::stringify<const char *> (const char *obj)
{
return obj;
}
template<>
inline string
UComposition::stringify<char *> (char *obj)
{
return obj;
}
#endif // DOXYGEN_SHOULD_SKIP_THIS
//******************************************************************************
//! \name UTF-8 Composition Functions
//@{
template<typename T1>
inline ustring
ucompose (const ustring &fmt,
const T1 &o1)
{
UComposition c (fmt);
c.arg (o1);
return c.str ();
}
template<typename T1, typename T2>
inline ustring
ucompose (const ustring &fmt,
const T1 &o1, const T2 &o2)
{
UComposition c (fmt);
c.arg (o1).arg (o2);
return c.str ();
}
template<typename T1, typename T2, typename T3>
inline ustring
ucompose (const ustring &fmt,
const T1 &o1, const T2 &o2, const T3 &o3)
{
UComposition c (fmt);
c.arg (o1).arg (o2).arg (o3);
return c.str ();
}
template<typename T1, typename T2, typename T3, typename T4>
inline ustring
ucompose (const ustring &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4)
{
UComposition c (fmt);
c.arg (o1).arg (o2).arg (o3).arg (o4);
return c.str ();
}
template<typename T1, typename T2, typename T3, typename T4, typename T5>
inline ustring
ucompose (const ustring &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4,
const T5 &o5)
{
UComposition c (fmt);
c.arg (o1).arg (o2).arg (o3).arg (o4).arg (o5);
return c.str ();
}
template<typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6>
inline ustring
ucompose (const ustring &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4,
const T5 &o5, const T6 &o6)
{
UComposition c (fmt);
c.arg (o1).arg (o2).arg (o3).arg (o4).arg (o5).arg (o6);
return c.str ();
}
template<typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7>
inline ustring
ucompose (const ustring &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4,
const T5 &o5, const T6 &o6, const T7 &o7)
{
UComposition c (fmt);
c.arg (o1).arg (o2).arg (o3).arg (o4).arg (o5).arg (o6).arg (o7);
return c.str ();
}
template<typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8>
inline ustring
ucompose (const ustring &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4,
const T5 &o5, const T6 &o6, const T7 &o7, const T8 &o8)
{
UComposition c (fmt);
c.arg (o1).arg (o2).arg (o3).arg (o4).arg (o5).arg (o6).arg (o7).arg (o8);
return c.str ();
}
template<typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9>
inline ustring
ucompose (const ustring &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4,
const T5 &o5, const T6 &o6, const T7 &o7, const T8 &o8,
const T9 &o9)
{
UComposition c (fmt);
c.arg (o1).arg (o2).arg (o3).arg (o4).arg (o5).arg (o6).arg (o7).arg (o8).arg (o9);
return c.str ();
}
template<typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10>
inline ustring
ucompose (const ustring &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4,
const T5 &o5, const T6 &o6, const T7 &o7, const T8 &o8,
const T9 &o9, const T10 &o10)
{
UComposition c (fmt);
c.arg (o1).arg (o2).arg (o3).arg (o4).arg (o5).arg (o6).arg (o7).arg (o8).arg (o9)
.arg (o10);
return c.str ();
}
template<typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10,
typename T11>
inline ustring
ucompose (const ustring &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4,
const T5 &o5, const T6 &o6, const T7 &o7, const T8 &o8,
const T9 &o9, const T10 &o10, const T11 &o11)
{
UComposition c (fmt);
c.arg (o1).arg (o2).arg (o3).arg (o4).arg (o5).arg (o6).arg (o7).arg (o8).arg (o9)
.arg (o10).arg (o11);
return c.str ();
}
template<typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10,
typename T11, typename T12>
inline ustring
ucompose (const ustring &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4,
const T5 &o5, const T6 &o6, const T7 &o7, const T8 &o8,
const T9 &o9, const T10 &o10, const T11 &o11, const T12 &o12)
{
UComposition c (fmt);
c.arg (o1).arg (o2).arg (o3).arg (o4).arg (o5).arg (o6).arg (o7).arg (o8).arg (o9)
.arg (o10).arg (o11).arg (o12);
return c.str ();
}
template<typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10,
typename T11, typename T12, typename T13>
inline ustring
ucompose (const ustring &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4,
const T5 &o5, const T6 &o6, const T7 &o7, const T8 &o8,
const T9 &o9, const T10 &o10, const T11 &o11, const T12 &o12,
const T13 &o13)
{
UComposition c (fmt);
c.arg (o1).arg (o2).arg (o3).arg (o4).arg (o5).arg (o6).arg (o7).arg (o8).arg (o9)
.arg (o10).arg (o11).arg (o12).arg (o13);
return c.str ();
}
template<typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10,
typename T11, typename T12, typename T13, typename T14>
inline ustring
ucompose (const ustring &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4,
const T5 &o5, const T6 &o6, const T7 &o7, const T8 &o8,
const T9 &o9, const T10 &o10, const T11 &o11, const T12 &o12,
const T13 &o13, const T14 &o14)
{
UComposition c (fmt);
c.arg (o1).arg (o2).arg (o3).arg (o4).arg (o5).arg (o6).arg (o7).arg (o8).arg (o9)
.arg (o10).arg (o11).arg (o12).arg (o13).arg (o14);
return c.str ();
}
template<typename T1, typename T2, typename T3, typename T4, typename T5,
typename T6, typename T7, typename T8, typename T9, typename T10,
typename T11, typename T12, typename T13, typename T14, typename T15>
inline ustring
ucompose (const ustring &fmt,
const T1 &o1, const T2 &o2, const T3 &o3, const T4 &o4,
const T5 &o5, const T6 &o6, const T7 &o7, const T8 &o8,
const T9 &o9, const T10 &o10, const T11 &o11, const T12 &o12,
const T13 &o13, const T14 &o14, const T15 &o15)
{
UComposition c (fmt);
c.arg (o1).arg (o2).arg (o3).arg (o4).arg (o5).arg (o6).arg (o7).arg (o8).arg (o9)
.arg (o10).arg (o11).arg (o12).arg (o13).arg (o14).arg (o15);
return c.str ();
}
//@}
} // namespace compose
#endif // LIBMISC__UCOMPOSE_TCC
|