]> git.lyx.org Git - lyx.git/blobdiff - src/support/lstrings.h
Replace the text class shared ptr by good old index-into-global-list.
[lyx.git] / src / support / lstrings.h
index d7a6a799e6313e1e9d264e9ef665706ff7918b19..381e818f763336286fa3d1836ad3980a90b9d0e7 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "support/docstring.h"
 
+#include <string>
 #include <vector>
 
 
@@ -34,28 +35,6 @@ int compare_ascii_no_case(std::string const & s, std::string const & s2);
 /// Compare \p s and \p s2, ignoring the case of ASCII characters only.
 int compare_ascii_no_case(docstring const & s, docstring const & s2);
 
-///
-inline
-int compare(char const * a, char const * b)
-{
-#ifndef CXX_GLOBAL_CSTD
-       return std::strcmp(a, b);
-#else
-       return strcmp(a, b);
-#endif
-}
-
-///
-inline
-int compare(char const * a, char const * b, unsigned int len)
-{
-#ifndef CXX_GLOBAL_CSTD
-       return std::strncmp(a, b, len);
-#else
-       return strncmp(a, b, len);
-#endif
-}
-
 ///
 bool isStrInt(std::string const & str);
 
@@ -65,9 +44,9 @@ bool isStrUnsignedInt(std::string const & str);
 ///
 bool isStrDbl(std::string const & str);
 
-bool isHex(lyx::docstring const & str);
+bool isHex(docstring const & str);
 
-int hexToInt(lyx::docstring const & str);
+int hexToInt(docstring const & str);
 
 /// is \p str pure ascii?
 bool isAscii(docstring const & str);
@@ -265,39 +244,6 @@ docstring const externalLineEnding(docstring const & str);
 docstring const internalLineEnding(docstring const & str);
 
 
-#ifdef I_AM_NOT_AFRAID_OF_HEADER_LIBRARIES
-
-#include <boost/format.hpp>
-
-template<class Arg1>
-docstring bformat(docstring const & fmt, Arg1 arg1)
-{
-       return (boost::basic_format<char_type>(fmt) % arg1).str();
-}
-
-
-template<class Arg1, class Arg2>
-docstring bformat(docstring const & fmt, Arg1 arg1, Arg2 arg2)
-{
-       return (boost::basic_format<char_type>(fmt) % arg1 % arg2).str();
-}
-
-
-template<class Arg1, class Arg2, class Arg3>
-docstring bformat(docstring const & fmt, Arg1 arg1, Arg2 arg2, Arg3 arg3)
-{
-       return (boost::basic_format<char_type>(fmt) % arg1 % arg2 % arg3).str();
-}
-
-
-template<class Arg1, class Arg2, class Arg3, class Arg4>
-docstring bformat(docstring const & fmt, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4)
-{
-       return (boost::basic_format<char_type>(fmt) % arg1 % arg2 % arg3 % arg4).str();
-}
-
-#else
-
 template <class Arg1>
 docstring bformat(docstring const & fmt, Arg1);
 
@@ -310,7 +256,18 @@ docstring bformat(docstring const & fmt, Arg1, Arg2, Arg3);
 template <class Arg1, class Arg2, class Arg3, class Arg4>
 docstring bformat(docstring const & fmt, Arg1, Arg2, Arg3, Arg4);
 
-#endif
+
+template<> docstring bformat(docstring const & fmt, int arg1);
+template<> docstring bformat(docstring const & fmt, long arg1);
+template<> docstring bformat(docstring const & fmt, unsigned int arg1);
+template<> docstring bformat(docstring const & fmt, docstring arg1);
+template<> docstring bformat(docstring const & fmt, char * arg1);
+template<> docstring bformat(docstring const & fmt, docstring arg1, docstring arg2);
+template<> docstring bformat(docstring const & fmt, char const * arg1, docstring arg2);
+template<> docstring bformat(docstring const & fmt, int arg1, int arg2);
+template<> docstring bformat(docstring const & fmt, docstring arg1, docstring arg2, docstring arg3);
+template<> docstring bformat(docstring const & fmt, docstring arg1, docstring arg2, docstring arg3, docstring arg4);
+
 
 } // namespace support
 } // namespace lyx