]> git.lyx.org Git - lyx.git/blob - src/support/convert.h
Provide proper fallback if a bibliography processor is not found
[lyx.git] / src / support / convert.h
1 // -*- C++ -*-
2 /**
3  * \file convert.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author André Pönitz
8  * \author Lars Gullik Bjønnes
9  *
10  * Full author contact details are available in file CREDITS.
11  *
12  * A collection of string helper functions that works with string.
13  * Some of these would certainly benefit from a rewrite/optimization.
14  */
15
16 #ifndef CONVERT_H
17 #define CONVERT_H
18
19 #include "support/strfwd.h"
20
21 namespace lyx {
22
23 template <class Target, class Source>
24 Target convert(Source arg);
25
26
27 template<> std::string convert<std::string>(bool b);
28 template<> std::string convert<std::string>(char c);
29 template<> std::string convert<std::string>(short unsigned int sui);
30 template<> std::string convert<std::string>(int i);
31 template<> docstring convert<docstring>(int i);
32 template<> std::string convert<std::string>(unsigned int ui);
33 template<> docstring convert<docstring>(unsigned int ui);
34 template<> std::string convert<std::string>(unsigned long ul);
35 template<> docstring convert<docstring>(unsigned long ul);
36 #ifdef LYX_USE_LONG_LONG
37 template<> std::string convert<std::string>(unsigned long long ull);
38 template<> docstring convert<docstring>(unsigned long long ull);
39 #endif
40 template<> std::string convert<std::string>(long l);
41 template<> docstring convert<docstring>(long l);
42 #ifdef LYX_USE_LONG_LONG
43 template<> std::string convert<std::string>(long long ll);
44 template<> docstring convert<docstring>(long long ll);
45 #endif
46 template<> std::string convert<std::string>(float f);
47 template<> std::string convert<std::string>(double d);
48 template<> int convert<int>(std::string const & s);
49 template<> int convert<int>(docstring const & s);
50 template<> unsigned int convert<unsigned int>(std::string const & s);
51 template<> unsigned long convert<unsigned long>(std::string const & s);
52 template<> double convert<double>(std::string const & s);
53 template<> int convert<int>(char const * cptr);
54 template<> double convert<double>(char const * cptr);
55
56 } // namespace lyx
57
58 #endif