#include "support/filetools.h"
#include "support/forkedcontr.h"
#include "support/path_defines.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "support/types.h"
#include <boost/bind.hpp>
2005-01-06 Lars Gullik Bjonnes <larsbj@gullik.net>
+ * everywhere: change support/tostr.h -> support/convert.h
+
* tabular.C: make all write_attributes templates, tostr -> convert
-
+
* paragraph.C (simpleLinuxDocOnePar): fix type for ret from getChar
(emptyTag): and -> &&, and fix type for ret from getChar
(getFirstWord): fix type for ret from getChar
#include "DepTable.h"
#include "support/filetools.h"
#include "support/FileInfo.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
#include "support/systemcall.h"
#include "support/filetools.h"
#include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <boost/bind.hpp>
#include "Spacing.h"
#include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <sstream>
#include <string>
#include "support/os.h"
#include "support/path.h"
#include "support/textutils.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <boost/bind.hpp>
#include "frontends/Alert.h"
#include "support/lyxalgo.h" // for lyx::count
-#include "support/tostr.h"
+#include "support/convert.h"
#include "support/translator.h"
#include <boost/array.hpp>
#include "insets/insettext.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <sstream>
#include "debug.h"
#include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <boost/assert.hpp>
#include "support/filefilterlist.h"
#include "support/filetools.h"
-#include "support/tostr.h"
+#include "support/convert.h"
using std::advance;
using std::vector;
#include "support/filefilterlist.h"
#include "support/filetools.h"
#include "support/path_defines.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "support/types.h"
using std::make_pair;
#include "gettext.h"
#include "PrinterParams.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "support/filefilterlist.h"
#include "support/filetools.h"
#endif
#include "support/textutils.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "frontends/Alert.h"
#include "ControlTabularCreate.h"
#include "funcrequest.h"
-#include "support/tostr.h"
+#include "support/convert.h"
using std::string;
void ControlTabularCreate::dispatchParams()
{
- string data = convert<string>(params().first) + ' ' + convert<string>(params().second);
+ string const data = convert<string>(params().first) + ' ' + convert<string>(params().second);
kernel().dispatch(FuncRequest(LFUN_TABULAR_INSERT, data));
}
#include "LColor.h"
#include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "lyx_forms.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "lyx_forms.h"
#include "controllers/ButtonPolicies.h"
#include "controllers/helper_funcs.h"
#include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "Tooltips.h"
#include "xforms_helpers.h"
#include "lyxrc.h"
#include "support/filetools.h" // LibFileSearch
-#include "support/tostr.h"
+#include "support/convert.h"
#include "lyx_forms.h"
#include "tex-strings.h"
#include "vspace.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "support/lstrings.h" // contains, getStringFromVector
#include "support/filetools.h" // LibFileSearch
#include "support/lstrings.h"
#include "support/lyxlib.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "lyx_forms.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
#include "support/os.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "lyx_forms.h"
#include "frontends/Alert.h"
#include "support/lyxlib.h" // for float_equal
-#include "support/tostr.h"
+#include "support/convert.h"
#include "lyx_forms.h"
#include "Spacing.h"
#include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "lyx_forms.h"
#include "PrinterParams.h"
#include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "lyx_forms.h"
#include "xforms_helpers.h"
#include "xformsBC.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "lyx_forms.h"
#include "vspace.h"
#include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "lyx_forms.h"
#include "insets/insetwrap.h"
#include "support/lstrings.h"
#include "lyx_forms.h"
-#include "support/tostr.h"
+#include "support/convert.h"
using std::string;
#include "MenuBackend.h"
#include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <boost/bind.hpp>
#include "support/FileInfo.h"
#include "support/filetools.h"
#include "support/lstrings.h" // frontStrip, strip
-#include "support/tostr.h"
+#include "support/convert.h"
#include "lyx_forms.h"
#include "combox.h"
#include "support/filetools.h"
#include "support/forkedcallqueue.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
#include "support/forkedcontr.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <boost/bind.hpp>
#include "support/lstrings.h"
#include "support/lyxlib.h" // float_equal
-#include "support/tostr.h"
+#include "support/convert.h"
#include "support/translator.h"
#include <boost/regex.hpp>
#include "support/lstrings.h"
#include "support/std_ostream.h"
-#include "support/tostr.h"
+#include "support/convert.h"
using lyx::support::prefixIs;
using lyx::support::strToInt;
#include "support/filetools.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "support/translator.h"
#include <boost/bind.hpp>
#include "pariterator.h"
#include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <sstream>
#include "support/filetools.h"
#include "support/lstrings.h" // contains
#include "support/lyxlib.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <boost/bind.hpp>
#include "outputparams.h"
#include "paragraph.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <sstream>
#include "frontends/Alert.h"
#include "frontends/LyXView.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <sstream>
#include "support/path.h"
#include "support/path_defines.h"
#include "support/systemcall.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "support/os.h"
#include <sstream>
#include "support/filetools.h"
#include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "support/userinfo.h"
using lyx::support::ascii_lowercase;
#include "support/lstrings.h"
#include "support/lyxlib.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "support/types.h"
#ifdef HAVE_LOCALE
#include "support/lstrings.h"
#include "support/textutils.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <boost/tuple/tuple.hpp>
#include <boost/bind.hpp>
#include "support/lstrings.h"
#include "support/std_ostream.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <boost/tuple/tuple.hpp>
+2005-01-06 Lars Gullik Bjonnes <larsbj@gullik.net>
+
+ * tostr.[Ch]: renamed to convert[ch]
+
2005-01-06 Lars Gullik Bjonnes <larsbj@gullik.net>
* lstrings.[Ch]: change bformat to be a template
-
+
* tostr.[Ch]: tostr -> convert, convert is a template
-
+
* tempname.C:
* filetools.C (createBufferTmpDir): tostr -> convert
abort.C \
atoi.C \
chdir.C \
+ convert.C \
+ convert.h \
copy.C \
copied_ptr.h \
cow_ptr.h \
systemcall.h \
tempname.C \
textutils.h \
- tostr.h \
- tostr.C \
translator.h \
types.h \
userinfo.C \
--- /dev/null
+/**
+ * \file tostr.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ * \author Lars Gullik Bjønnes
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#include <config.h>
+
+#include "convert.h"
+
+#include <boost/lexical_cast.hpp>
+
+using boost::lexical_cast;
+
+using std::string;
+
+
+template<>
+string convert<string>(bool b)
+{
+ return (b ? "true" : "false");
+}
+
+
+template<>
+string convert<string>(char c)
+{
+ return string(1, c);
+}
+
+
+template<>
+string convert<string>(short unsigned int sui)
+{
+ return lexical_cast<string>(sui);
+}
+
+
+template<>
+string convert<string>(int i)
+{
+ return lexical_cast<string>(i);
+}
+
+
+template<>
+string convert<string>(unsigned int ui)
+{
+ return lexical_cast<string>(ui);
+}
+
+
+template<>
+string convert<string>(float f)
+{
+ return lexical_cast<string>(f);
+}
+
+
+template<>
+string convert<string>(double d)
+{
+ return lexical_cast<string>(d);
+}
--- /dev/null
+// -*- C++ -*-
+/**
+ * \file tostr.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author André Pönitz
+ * \author Lars Gullik Bjønnes
+ *
+ * Full author contact details are available in file CREDITS.
+ *
+ * A collection of string helper functions that works with string.
+ * Some of these would certainly benefit from a rewrite/optimization.
+ */
+
+#ifndef TOSTR_H
+#define TOSTR_H
+
+#include <boost/static_assert.hpp>
+
+#include <string>
+
+
+#if 0
+// Commented out since BOOST_STATIC_ASSERT does not work with gcc 4.0
+template <class Target, class Source>
+Target convert(Source arg)
+{
+ // We use a static assert here since we want all instances of
+ // this template to be specializations.
+ BOOST_STATIC_ASSERT(sizeof(bool) == 0);
+ return Target();
+}
+#else
+template <class Target, class Source>
+Target convert(Source arg);
+#endif
+
+
+template<>
+std::string convert<std::string>(bool);
+
+template<>
+std::string convert<std::string>(char);
+
+template<>
+std::string convert<std::string>(unsigned short);
+
+template<>
+std::string convert<std::string>(int);
+
+template<>
+std::string convert<std::string>(unsigned int);
+
+template<>
+std::string convert<std::string>(float);
+
+template<>
+std::string convert<std::string>(double);
+
+template<>
+std::string convert<std::string>(std::string);
+
+#endif
#include <config.h>
-#include "support/tostr.h"
+#include "support/convert.h"
#include "support/systemcall.h"
#include "support/filetools.h"
#include "support/lstrings.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "debug.h"
#include "support/lyxlib.h"
#include "support/filetools.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "support/os.h"
#include "debug.h"
+++ /dev/null
-/**
- * \file tostr.C
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author André Pönitz
- * \author Lars Gullik Bjønnes
- *
- * Full author contact details are available in file CREDITS.
- */
-
-#include <config.h>
-
-#include "tostr.h"
-
-#include <boost/lexical_cast.hpp>
-
-using boost::lexical_cast;
-
-using std::string;
-
-
-template<>
-string convert<string>(bool b)
-{
- return (b ? "true" : "false");
-}
-
-
-template<>
-string convert<string>(char c)
-{
- return string(1, c);
-}
-
-
-template<>
-string convert<string>(short unsigned int sui)
-{
- return lexical_cast<string>(sui);
-}
-
-
-template<>
-string convert<string>(int i)
-{
- return lexical_cast<string>(i);
-}
-
-
-template<>
-string convert<string>(unsigned int ui)
-{
- return lexical_cast<string>(ui);
-}
-
-
-template<>
-string convert<string>(float f)
-{
- return lexical_cast<string>(f);
-}
-
-
-template<>
-string convert<string>(double d)
-{
- return lexical_cast<string>(d);
-}
+++ /dev/null
-// -*- C++ -*-
-/**
- * \file tostr.h
- * This file is part of LyX, the document processor.
- * Licence details can be found in the file COPYING.
- *
- * \author André Pönitz
- * \author Lars Gullik Bjønnes
- *
- * Full author contact details are available in file CREDITS.
- *
- * A collection of string helper functions that works with string.
- * Some of these would certainly benefit from a rewrite/optimization.
- */
-
-#ifndef TOSTR_H
-#define TOSTR_H
-
-#include <boost/static_assert.hpp>
-
-#include <string>
-
-
-#if 0
-// Commented out since BOOST_STATIC_ASSERT does not work with gcc 4.0
-template <class Target, class Source>
-Target convert(Source arg)
-{
- // We use a static assert here since we want all instances of
- // this template to be specializations.
- BOOST_STATIC_ASSERT(sizeof(bool) == 0);
- return Target();
-}
-#else
-template <class Target, class Source>
-Target convert(Source arg);
-#endif
-
-
-template<>
-std::string convert<std::string>(bool);
-
-template<>
-std::string convert<std::string>(char);
-
-template<>
-std::string convert<std::string>(unsigned short);
-
-template<>
-std::string convert<std::string>(int);
-
-template<>
-std::string convert<std::string>(unsigned int);
-
-template<>
-std::string convert<std::string>(float);
-
-template<>
-std::string convert<std::string>(double);
-
-template<>
-std::string convert<std::string>(std::string);
-
-#endif
#include "insets/insettabular.h"
#include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <sstream>
#include <config.h>
#include "tex-accent.h"
-#include "support/tostr.h"
+#include "support/convert.h"
using std::string;
#include "lengthcommon.h"
#include "support/FileInfo.h"
#include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "support/filetools.h"
#include <boost/tuple/tuple.hpp>
#include "support/lstrings.h"
#include "support/textutils.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <sstream>
#include "support/lstrings.h"
#include "support/textutils.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include <sstream>
#include "support/lstrings.h"
#include "support/lyxlib.h"
-#include "support/tostr.h"
+#include "support/convert.h"
#include "mathed/math_hullinset.h"
#include "mathed/math_macrotemplate.h"
#include "insets/insetfloat.h"
#include "insets/insetwrap.h"
-#include "support/tostr.h"
+#include "support/convert.h"
using std::vector;
using std::max;