]> git.lyx.org Git - features.git/commitdiff
rename tostr.[Ch] to convert.[Ch]
authorLars Gullik Bjønnes <larsbj@gullik.org>
Thu, 6 Jan 2005 16:39:35 +0000 (16:39 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Thu, 6 Jan 2005 16:39:35 +0000 (16:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9448 a592a061-630c-0410-9148-cb99ea01b6c8

59 files changed:
src/BufferView_pimpl.C
src/ChangeLog
src/LaTeX.C
src/MenuBackend.C
src/Spacing.C
src/buffer.C
src/bufferparams.C
src/bufferview_funcs.C
src/counters.C
src/frontends/controllers/ControlExternal.C
src/frontends/controllers/ControlGraphics.C
src/frontends/controllers/ControlPrint.C
src/frontends/controllers/ControlSpellchecker.C
src/frontends/controllers/ControlTabularCreate.C
src/frontends/xforms/ColorHandler.C
src/frontends/xforms/FontInfo.C
src/frontends/xforms/FormBox.C
src/frontends/xforms/FormColorpicker.C
src/frontends/xforms/FormDocument.C
src/frontends/xforms/FormExternal.C
src/frontends/xforms/FormFiledialog.C
src/frontends/xforms/FormGraphics.C
src/frontends/xforms/FormParagraph.C
src/frontends/xforms/FormPrint.C
src/frontends/xforms/FormSpellchecker.C
src/frontends/xforms/FormVSpace.C
src/frontends/xforms/FormWrap.C
src/frontends/xforms/XFormsMenubar.C
src/frontends/xforms/xforms_helpers.C
src/graphics/GraphicsConverter.C
src/graphics/PreviewLoader.C
src/insets/ExternalTransforms.C
src/insets/insetbibitem.C
src/insets/insetexternal.C
src/insets/insetfloat.C
src/insets/insetinclude.C
src/insets/insetwrap.C
src/lyxfind.C
src/lyxfunc.C
src/lyxrc.C
src/output_docbook.C
src/paragraph.C
src/sgml.C
src/support/ChangeLog
src/support/Makefile.am
src/support/convert.C [new file with mode: 0644]
src/support/convert.h [new file with mode: 0644]
src/support/filetools.C
src/support/lstrings.C
src/support/tempname.C
src/support/tostr.C [deleted file]
src/support/tostr.h [deleted file]
src/tabular.C
src/tex-accent.C
src/tex2lyx/text.C
src/text.C
src/text2.C
src/text3.C
src/toc.C

index e76eaf3052af1385e0e7a23c6ba38dded5e9dde2..95fdf3ee14cbba2aab06bc1d6a98fc6530ba25ef 100644 (file)
@@ -68,7 +68,7 @@
 #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>
index 213d911a3ef774574f9a55a88452cbe0e62df22a..66fac148bdd0c9d1c8c65f4d3952f4176ed3f2eb 100644 (file)
@@ -1,7 +1,9 @@
 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
index 92ee3ac0ce78b8dc2e26167052383621268954af..4ccd0cb57c01dbdb9d2795e4744e7c678cf53e0b 100644 (file)
@@ -22,7 +22,7 @@
 #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"
index d57a1292a101483075c5cafa9afb59584e111643..50a0a9b00f31a31a21cdb83af792796c288cad10 100644 (file)
@@ -41,7 +41,7 @@
 
 #include "support/filetools.h"
 #include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include <boost/bind.hpp>
 
index c4fcdb1edddedee8902a7b9e2b3f0769b450e2d2..8846a742ea016f28fc4f3591b1af9ae95e0b92ed 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "Spacing.h"
 #include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include <sstream>
 #include <string>
index 4e58256a87bc50d981f51242280fff63556373a5..de6a46b06eebc4fb6a26562bb512fa3a3a662759 100644 (file)
@@ -70,7 +70,7 @@
 #include "support/os.h"
 #include "support/path.h"
 #include "support/textutils.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include <boost/bind.hpp>
 
index c8f659b6e1eedc9983402418f5cf89b08e1295bf..6789e114faca3eb5377d0543f5eca14ee42169c8 100644 (file)
@@ -38,7 +38,7 @@
 #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>
index d4dbfe353a9151bb0495da61d822b55da608c039..fb977c2dc56bdc1b2a6963b94ff415bf6b560a2a 100644 (file)
@@ -35,7 +35,7 @@
 
 #include "insets/insettext.h"
 
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include <sstream>
 
index 7f65d86af9452050f9387388f6111e718260821d..1411660facf68c86cb2bdb80b9d8658dfc33f4a0 100644 (file)
@@ -16,7 +16,7 @@
 #include "debug.h"
 
 #include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include <boost/assert.hpp>
 
index 6e64ea1d13978b84f78aca069db67b123791dd9d..30fee5b52c5941c8bee90fbbf4d709d7c845d749 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "support/filefilterlist.h"
 #include "support/filetools.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 using std::advance;
 using std::vector;
index a0cda6f91fc4fd3630de4b5dfdd24b0b1bd20cbe..8335e35713ade4feb487a656ce92329274b4cce7 100644 (file)
@@ -29,7 +29,7 @@
 #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;
index 53f3678efb51bd29b1fbd27669ac8d56ed08eee1..c9755e2242c87d691ffcd90717bd298901416278 100644 (file)
@@ -21,7 +21,7 @@
 #include "gettext.h"
 #include "PrinterParams.h"
 
-#include "support/tostr.h"
+#include "support/convert.h"
 #include "support/filefilterlist.h"
 #include "support/filetools.h"
 
index 6bbb8e51ea2e44fa0bfef623969eb8ee3acf3238..2ca46452592307835801792646ccd5438b6ff2d3 100644 (file)
@@ -33,7 +33,7 @@
 #endif
 
 #include "support/textutils.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include "frontends/Alert.h"
 
index f2d026e30ac4e65e1463fd9b67629503d3bbfad6..e13f491895a2b1fa3fe9fd1c000801d243081be0 100644 (file)
@@ -13,7 +13,7 @@
 #include "ControlTabularCreate.h"
 #include "funcrequest.h"
 
-#include "support/tostr.h"
+#include "support/convert.h"
 
 
 using std::string;
@@ -43,7 +43,7 @@ void ControlTabularCreate::clearParams()
 
 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));
 }
 
index a43bc9036f5cb3878ab4e3a1454403bbfa73f666..86392b89b4f1c3b8825d28a42883a7357320247a 100644 (file)
@@ -17,7 +17,7 @@
 #include "LColor.h"
 
 #include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include "lyx_forms.h"
 
index 6fae730671bd9f9eca05b0266c6a31f74e612625..bb30ae35429047a262b202127d270bb3ae12fab9 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include "lyx_forms.h"
 
index 2bf22abeebf1da219b10e98c6a2fbb7213349176..59fc25cf7134e5b90972e177b1daa0747621b254 100644 (file)
@@ -17,7 +17,7 @@
 #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"
index 90f93e9c5178af2cb7e139dd4bbdecfc1ab11d5b..c9e8d251205451015d2d49396c98a29050a66bdd 100644 (file)
@@ -20,7 +20,7 @@
 #include "lyxrc.h"
 
 #include "support/filetools.h" //  LibFileSearch
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include "lyx_forms.h"
 
index e84100896b4369c1b3df9101722685a92f38616d..033d12d7ebeb9cb075a1bbe8225da5632a15a3a9 100644 (file)
@@ -40,7 +40,7 @@
 #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
 
index b3b8070a299df6ca8e19649491a349e31eb5af74..c4cd302c7cd1a63ad1cba35f8a70ab1d22230236 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include "lyx_forms.h"
 
index d2e8bd601ae23f11f37834a26b9e2c4feb5bdb6a..7cea65f8f4fd59654c8d1ad8f6830bcc17e0abb0 100644 (file)
@@ -26,7 +26,7 @@
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
 #include "support/os.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include "lyx_forms.h"
 
index 77d17cb5b3ff9bd6a393bbc26f7bc5fad157690e..b25b931f1d41bd5a2bf88d5bf489f14f46cf3a48 100644 (file)
@@ -31,7 +31,7 @@
 #include "frontends/Alert.h"
 
 #include "support/lyxlib.h"  // for float_equal
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include "lyx_forms.h"
 
index 29fffa227a26c04ac03d4eb0d25f2850dc2672b3..c60199b87c54988b239aacfe799d726ecc4aa361 100644 (file)
@@ -28,7 +28,7 @@
 #include "Spacing.h"
 
 #include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include "lyx_forms.h"
 
index f67946fb4d0fceabd42028bd779f09fcf3c7ea4a..1d892878586b434293d0d74586cfafb4d5a1d3ca 100644 (file)
@@ -23,7 +23,7 @@
 #include "PrinterParams.h"
 
 #include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include "lyx_forms.h"
 
index 1eba6cf52e0b637b8b3f276cd10a7b32b1d7f971..27c2868d9c48876f9e324cb946ace50e56761b1f 100644 (file)
@@ -19,7 +19,7 @@
 #include "xforms_helpers.h"
 #include "xformsBC.h"
 
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include "lyx_forms.h"
 
index 0df4171318a063df41e775ab37d651e06c756cde..9cf600e20ad9f7f047834f290b86a2fcd266bb8e 100644 (file)
@@ -29,7 +29,7 @@
 #include "vspace.h"
 
 #include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include "lyx_forms.h"
 
index 85ea19a6b12954518ba3e6b37c8368090116c618..6bcd65723f1e2a7222d81b8d705495bb8a98441a 100644 (file)
@@ -23,7 +23,7 @@
 #include "insets/insetwrap.h"
 #include "support/lstrings.h"
 #include "lyx_forms.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 using std::string;
 
index c6ea81a5ce1246973720794298f30691ce6409a0..4d0a3c988c820fa127ba1c113b4fc1faaf25e04f 100644 (file)
@@ -21,7 +21,7 @@
 #include "MenuBackend.h"
 
 #include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include <boost/bind.hpp>
 
index f5a4e19a0e4373a23dc590e65c0ba663fb922abe..a4b8b8c93a2cb1635468c787f73d66ef00591f0f 100644 (file)
@@ -21,7 +21,7 @@
 #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"
index cc013e773aeb037b69c2bf2990240307b480ce1b..2a4bf09c0eccc0bf135b88b38b38ecf7b867a5c5 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "support/filetools.h"
 #include "support/forkedcallqueue.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
 
index 04d63ea334268cfa72b88e0e85cd3c323a14c987..55e2935d659c8b2977d26e389574b8fce9e59087 100644 (file)
@@ -33,7 +33,7 @@
 #include "support/forkedcontr.h"
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include <boost/bind.hpp>
 
index 19670f087f33bf92c599f5b2e47531739e5b16ef..ffc66cfb12ccb733d2df30918465a5a438690953 100644 (file)
@@ -16,7 +16,7 @@
 
 #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>
index 74e3f29fae19ed49178b392b6388e6ed4cb44d3f..97dca124735548691da66068e1779ee02183e6f8 100644 (file)
@@ -25,7 +25,7 @@
 
 #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;
index 6fc0e5e05c5d55a0890a0f6c32ff97e7379d0523..3bbf20e91badb8b03b0141e152534dcf5f2e1dfa 100644 (file)
@@ -41,7 +41,7 @@
 #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>
index aaa87eca6a11e2033222d1d1a6c3c6234ecb8f3e..b43c4a121c35f32eb467d4b19e6dfc137bf874cc 100644 (file)
@@ -31,7 +31,7 @@
 #include "pariterator.h"
 
 #include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include <sstream>
 
index a887ba9f4efd8b2238fbe43719777474da53eefc..490f8b3553379afb94f05f0d1f3fe66bb3edd923 100644 (file)
@@ -44,7 +44,7 @@
 #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>
 
index 486f933f2c05fe14092b499c869e71623d3a01d7..c9b958f8d4aa449f3efafe66eab5e1100fc37273 100644 (file)
@@ -28,7 +28,7 @@
 #include "outputparams.h"
 #include "paragraph.h"
 
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include <sstream>
 
index 5d23c8297699b6a5983c9a25921a547fd223653c..1bcf3c398af04cf0f7db3eda4e728b225eb421b3 100644 (file)
@@ -30,7 +30,7 @@
 #include "frontends/Alert.h"
 #include "frontends/LyXView.h"
 
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include <sstream>
 
index e5eb20d52ad12c1c2b4f4e0cb783556905571003..7188aa577471bc271e3668e83b6801bc0b2c9aa0 100644 (file)
@@ -86,7 +86,7 @@
 #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>
index 9ff530103082b6cc3522cf2b0177053518bfcfbd..18ab6b005260eafd4d204c90da7fb44250ac3876 100644 (file)
@@ -35,7 +35,7 @@
 
 #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;
index 825914f77990be20a42e6a6271532d94350c0df3..8c1d0dba60c634453687aa88c07aa2bd2224b24d 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 #include "support/types.h"
 
 #ifdef HAVE_LOCALE
index b1a9a60f826163e2e79ad46ffe1829df46fb10fb..ce8b9967d8f6d0af1f825423e8ac15f71dd2b26b 100644 (file)
@@ -42,7 +42,7 @@
 
 #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>
index c10e8d81f77a393429096aaaa58ae4603b46cdc3..5045025cdce159cac055ecf09bc6ce53d98be388 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "support/lstrings.h"
 #include "support/std_ostream.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include <boost/tuple/tuple.hpp>
 
index db6f478951d6a311a33e6027c9d748ff0477743b..cadf806b9a4e19acae8b6c174406892d8e32c4b3 100644 (file)
@@ -1,9 +1,13 @@
+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
 
index 2193c1cd8a3b4d17319f6f05750c2fbcf83eae9a..ad8291ee347c36d5c74d0948437ff7d0e7f189ff 100644 (file)
@@ -22,6 +22,8 @@ libsupport_la_SOURCES = \
        abort.C \
        atoi.C \
        chdir.C \
+       convert.C \
+       convert.h \
        copy.C \
        copied_ptr.h \
        cow_ptr.h \
@@ -71,8 +73,6 @@ libsupport_la_SOURCES = \
        systemcall.h \
        tempname.C \
        textutils.h \
-       tostr.h \
-       tostr.C \
        translator.h \
        types.h \
        userinfo.C \
diff --git a/src/support/convert.C b/src/support/convert.C
new file mode 100644 (file)
index 0000000..b0eaa99
--- /dev/null
@@ -0,0 +1,69 @@
+/**
+ * \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);
+}
diff --git a/src/support/convert.h b/src/support/convert.h
new file mode 100644 (file)
index 0000000..ead674b
--- /dev/null
@@ -0,0 +1,64 @@
+// -*- 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
index 4b29034661b3e84e5c6df4810061214b1299bf4c..2f220470e22950bedcf4a367e68820e56f256312 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <config.h>
 
-#include "support/tostr.h"
+#include "support/convert.h"
 #include "support/systemcall.h"
 #include "support/filetools.h"
 #include "support/lstrings.h"
index 1c60dd4c8f701357024d29aca84113a49a2f6dea..65c238ecfc6596eec8f7f3d03b46bd20d702e06c 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include "debug.h"
 
index 420231207684d55a86b45bdfcedc35d75f799e26..18826367c2a70d5cfa532bfe93c9a86441eed249 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "support/lyxlib.h"
 #include "support/filetools.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 #include "support/os.h"
 
 #include "debug.h"
diff --git a/src/support/tostr.C b/src/support/tostr.C
deleted file mode 100644 (file)
index c137dbb..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * \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);
-}
diff --git a/src/support/tostr.h b/src/support/tostr.h
deleted file mode 100644 (file)
index ead674b..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-// -*- 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
index 02ddbd7e4645ff6487d2c68c62931177f40f1dde..d43d6b58925a0aa26add94e890ed183b5e5d4e4f 100644 (file)
@@ -30,7 +30,7 @@
 #include "insets/insettabular.h"
 
 #include "support/lstrings.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include <sstream>
 
index 8b7f74067289c45f62eb25ad7939f02effb45179..e2f1a8319b8e002a2be59ce00acc09447002d4e6 100644 (file)
@@ -12,7 +12,7 @@
 #include <config.h>
 
 #include "tex-accent.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 using std::string;
 
index d1bd74209f8af934fefbd92c041fd315f2ad0234..2f9b001cf15c216a7294d6d2872a6282fa99ee7a 100644 (file)
@@ -19,7 +19,7 @@
 #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>
index dc94664fe5ef81e5b1d0e57c58d60299217ab794..1547bc6c52199feffb0b3e1f6b709fc7aa74300c 100644 (file)
@@ -67,7 +67,7 @@
 
 #include "support/lstrings.h"
 #include "support/textutils.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include <sstream>
 
index 0ffd04c0f6bdb9a77efd5f85dc9a75220fa5c189..324d3cbef4d63f0f27407680b2870c52789bfb85 100644 (file)
@@ -58,7 +58,7 @@
 
 #include "support/lstrings.h"
 #include "support/textutils.h"
-#include "support/tostr.h"
+#include "support/convert.h"
 
 #include <sstream>
 
index d65d24bf45419004436274a5bd87877bdde20b43..e46b83972155339d13ccfa9cb4015d2e309f6f76 100644 (file)
@@ -54,7 +54,7 @@
 
 #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"
index 42141c3dc2f29c027069fc88b3467a7aec7cf861..603912ab55343b142dda1381799b8edd38116356 100644 (file)
--- a/src/toc.C
+++ b/src/toc.C
@@ -25,7 +25,7 @@
 #include "insets/insetfloat.h"
 #include "insets/insetwrap.h"
 
-#include "support/tostr.h"
+#include "support/convert.h"
 
 using std::vector;
 using std::max;