#include "graphics/Previews.h"
#include "support/LAssert.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
#include "support/filetools.h"
#include <boost/bind.hpp>
+2003-05-13 André Pönitz <poenitz@gmx.net>
+
+ * BufferView_pimpl.C:
+ * buffer.C:
+ * bufferview_func.C:
+ * MenuBackend.C:
+ * lyxfunc.C:
+ * lyxrc.C:
+ * tex-accent.C:
+ * text3.C:
+ * toc.C:
+ * tabular_funcs.h: tostr() from its own header
+
2003-05-12 André Pönitz <poenitz@gmx.net>
* BufferView.C:
#include "funcrequest.h"
#include "support/filetools.h"
#include "support/FileInfo.h"
+#include "support/tostr.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
#include "support/systemcall.h"
#include <config.h>
-#include <algorithm>
#include "MenuBackend.h"
#include "lyxlex.h"
#include "LyXAction.h"
#include "support/filetools.h"
#include "support/lyxfunctional.h"
#include "support/lstrings.h"
+#include "support/tostr.h"
+
+#include <algorithm>
extern BufferList bufferlist;
extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
#include "support/filetools.h"
#include "support/path.h"
#include "support/os.h"
+#include "support/tostr.h"
#include "support/lyxlib.h"
#include "support/FileInfo.h"
#include "support/lyxmanip.h"
#include "frontends/Alert.h"
#include "mathed/math_cursor.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
#include "Lsstream.h"
#include "insets/updatableinset.h"
#include "support/filetools.h"
#include "support/lyxfunctional.h"
#include "support/path.h"
+#include "support/tostr.h"
#include "support/systemcall.h"
#include <cctype>
-2003-05-12 André Pönitz <poenitz@gmx.net>
+2003-05-13 André Pönitz <poenitz@gmx.net>
* ControlDocument.C:
* ControlPrint.C:
* ControlSpellchecker.C:
* biblio.C: boost::format -> bformat all over the place
+ * ControlForks.C:
+ * ControlGraphics.C:
+ * ControlPrint.C:
+ * ControlSearch.C:
+ * ControlSpellchecker.C:
+ * ControlTabularCreate.C: use tostr from new header
+
+
2003-05-08 Lars Gullik Bjønnes <larsbj@gullik.net>
* Makefile.am: better lib building
#include <config.h>
-
#include "ControlForks.h"
#include "ViewBase.h"
#include "funcrequest.h"
#include "support/forkedcontr.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
#include <boost/bind.hpp>
#include <config.h>
-
#include "ControlGraphics.h"
#include "helper_funcs.h"
#include "insets/insetgraphics.h"
#include "insets/insetgraphicsParams.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
#include "support/filetools.h"
#include "support/FileInfo.h"
#include <config.h>
-
#include "ControlPrint.h"
#include "ViewBase.h"
#include "frontends/Alert.h"
+#include "support/tostr.h"
#include "support/LAssert.h"
#include "support/filetools.h"
#include "support/path.h"
#include <config.h>
-
#include "ControlSearch.h"
#include "gettext.h"
#include "frontends/LyXView.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
ControlSearch::ControlSearch(LyXView & lv, Dialogs & d)
#endif
#endif
+#include "support/tostr.h"
+
#include "frontends/Alert.h"
using std::endl;
#include "ControlTabularCreate.h"
#include "funcrequest.h"
-#include "support/lstrings.h"
+
+#include "support/tostr.h"
ControlTabularCreate::ControlTabularCreate(Dialog & parent)
bool ControlTabularCreate::initialiseParams(string const &)
{
- params_.first = params_.second = 5;
+ params_.first = 5;
+ params_.second = 5;
return true;
}
void ControlTabularCreate::clearParams()
{
- params_.first = params_.second = 0;
+ params_.first = 0;
+ params_.second = 0;
}
+2003-05-13 André Pönitz <poenitz@gmx.net>
+
+ * FontInfo.C:
+ * FormDocument.C:
+ * FormFiledialog.C:
+ * FormForks.C:
+ * FormGraphics.C:
+ * FormMinipage.C:
+ * FormParagraph.C:
+ * FormPreferences.C:
+ * FormPrint.C:
+ * FormSpellchecker.C:
+ * FormWrap.C:
+ * Menubar_pimpl.C: tostr from new header
+
2003-05-12 André Pönitz <poenitz@gmx.net>
* FormDocument.C:
#include <config.h>
-
#include "FontInfo.h"
#include "debug.h"
#include "lyxrc.h" // lyxrc.use_scalable_fonts
+#include "support/tostr.h"
#include "support/lstrings.h"
#include "support/lyxlib.h"
+
#include "frontends/lyx_gui.h"
#include <cmath> // abs()
#include <config.h>
-
#include "ControlDocument.h"
#include "FormDocument.h"
#include "forms/form_document.h"
#include "controllers/frnt_lang.h"
#include "controllers/helper_funcs.h"
+#include "support/tostr.h"
#include "support/lstrings.h" // contains_functor, getStringFromVector
#include "support/filetools.h" // LibFileSearch
#include "support/BoostFormat.h"
using std::max;
using std::sort;
-#include "frontends/Alert.h"
+#include "gettext.h"
+#include "forms_gettext.h"
+#include "xforms_helpers.h"
+
#include "support/FileInfo.h"
#include "support/lyxlib.h"
#include "support/lstrings.h"
-#include "gettext.h"
+#include "support/tostr.h"
+#include "support/filetools.h"
+
+#include "frontends/Alert.h"
#include "frontends/Dialogs.h"
-#include "forms_gettext.h"
-#include "xforms_helpers.h"
#include <boost/bind.hpp>
#endif
-#include "support/filetools.h"
#include "FormFiledialog.h"
#include "forms/form_filedialog.h"
#include FORMS_H_LOCATION
#include <config.h>
-
#include "xformsBC.h"
#include "ButtonController.h"
#include "FormForks.h"
#include "xforms_helpers.h"
#include "gettext.h"
#include "support/lstrings.h"
+#include "support/tostr.h"
#include FORMS_H_LOCATION
using std::vector;
#include <config.h>
-
#include "xformsBC.h"
#include "ControlGraphics.h"
#include "FormGraphics.h"
#include "frontends/Alert.h"
-#include "support/lstrings.h" // for strToDbl & tostr
+#include "support/tostr.h"
+#include "support/lstrings.h" // for strToDbl
#include "support/lyxlib.h" // for float_equal
#include "support/filetools.h" // for MakeAbsPath etc
#include <config.h>
-
#include "xformsBC.h"
#include "ControlMinipage.h"
#include "FormMinipage.h"
#include "forms/form_minipage.h"
#include "support/lstrings.h"
+#include "support/tostr.h"
#include "helper_funcs.h"
#include "debug.h"
#include "xforms_helpers.h"
#include <config.h>
-
#include "ControlParagraph.h"
#include "FormParagraph.h"
#include "forms/form_paragraph.h"
#include "layout.h" // LyXAlignment
#include "support/lstrings.h"
+#include "support/tostr.h"
#include "support/LAssert.h"
#include FORMS_H_LOCATION
#include <config.h>
-
#include "ControlPrefs.h"
#include "FormPreferences.h"
#include "forms/form_preferences.h"
#include "support/lyxfunctional.h"
#include "support/lyxmanip.h"
+#include "support/tostr.h"
#include "support/filetools.h"
#include "support/LAssert.h"
int const s = int(100.0 * sat);
int const v = int(100.0 * val);
- string const label = tostr(h) + string(", ") + tostr(s) + string(", ") +
- tostr(v);
+ string const label = tostr(h) + ", " + tostr(s) + ", " + tostr(v);
fl_set_object_label(dialog_->text_color_values, label.c_str());
RGBColor col = HSVColor(hue, sat, val);
#include <config.h>
-
#include "xformsBC.h"
#include "ControlPrint.h"
#include "FormPrint.h"
#include "input_validators.h"
#include "xforms_helpers.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
#include FORMS_H_LOCATION
#include <config.h>
-
#include "xformsBC.h"
#include "FormSpellchecker.h"
#include "ControlSpellchecker.h"
#include "forms_gettext.h"
#include "Tooltips.h"
#include "xforms_helpers.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
#include FORMS_H_LOCATION
#include "insets/insetwrap.h"
#include "support/lstrings.h"
+#include "support/tostr.h"
#include FORMS_H_LOCATION
typedef FormController<ControlWrap, FormView<FD_wrap> > base_class;
#include "XFormsView.h"
#include "lyxfunc.h"
#include "support/lstrings.h"
+#include "support/tostr.h"
#include "support/LAssert.h"
#include "gettext.h"
#include "debug.h"
+2003-05-13 André Pönitz <poenitz@gmx.net>
+
+ * GraphicsConverter.C:
+ * PreviewLoader.C: use tostr from own header
+
2003-05-12 André Pönitz <poenitz@gmx.net>
* PreviewLoader.C: boost::format -> bformat
#include "support/filetools.h"
#include "support/forkedcall.h"
#include "support/forkedcallqueue.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
#include "support/lyxlib.h"
#include <boost/bind.hpp>
#include "support/filetools.h"
#include "support/forkedcall.h"
#include "support/forkedcontr.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
#include "support/lyxlib.h"
#include <boost/bind.hpp>
+2003-05-13 André Pönitz <poenitz@gmx.net>
+
+ * insetbibitem.C:
+ * insetcollapsable.C:
+ * insetert.C:
+ * insetfloat.C:
+ * insetinclude.C:
+ * insetwrap.C: tostr from own header
+
2003-05-12 André Pönitz <poenitz@gmx.net>
* insetcaption.C:
#include "frontends/font_metrics.h"
+#include "support/tostr.h"
#include "support/lstrings.h"
#include <config.h>
-
#include "insetcollapsable.h"
#include "insettext.h"
#include "support/LAssert.h"
#include "support/LOstream.h"
-#include "support/lstrings.h"
using std::vector;
using std::ostream;
void InsetCollapsable::write(Buffer const * buf, ostream & os) const
{
- os << "collapsed " << tostr(collapsed_) << "\n";
+ os << "collapsed " << (collapsed_ ? "true" : "false") << "\n";
inset.writeParagraphData(buf, os);
}
#include "support/LOstream.h"
#include "support/LAssert.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
using std::ostream;
#include "support/LOstream.h"
#include "support/lstrings.h"
+#include "support/tostr.h"
#include "frontends/LyXView.h"
#include "frontends/Dialogs.h"
#include "support/filetools.h"
#include "support/FileInfo.h"
#include "support/FileMonitor.h"
-#include "support/lstrings.h"
+#include "support/lstrings.h" // contains
+#include "support/tostr.h"
#include "graphics/PreviewedInset.h"
#include "graphics/PreviewImage.h"
#include "frontends/Dialogs.h"
#include "support/LOstream.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
using std::ostream;
using std::endl;
#include "support/FileInfo.h"
#include "support/forkedcontr.h"
#include "support/lstrings.h"
+#include "support/tostr.h"
#include "support/path.h"
#include "support/lyxfunctional.h"
#include <iostream>
#include <boost/scoped_ptr.hpp>
-#include "debug.h"
-
#include "lyxrc.h"
+
+#include "debug.h"
#include "kbmap.h"
#include "LyXAction.h"
#include "intl.h"
-#include "support/path.h"
-#include "support/filetools.h"
-#include "support/LAssert.h"
-#include "support/userinfo.h"
#include "converter.h"
#include "format.h"
#include "gettext.h"
#include "lyxlex.h"
+#include "support/path.h"
+#include "support/tostr.h"
+#include "support/filetools.h"
+#include "support/LAssert.h"
+#include "support/userinfo.h"
+
using std::ostream;
using std::ofstream;
using std::cout;
sstream.h \
systemcall.C \
systemcall.h \
- userinfo.C \
- userinfo.h \
tempname.C \
textutils.h \
+ tostr.h \
+ tostr.C \
translator.h \
types.h \
+ userinfo.C \
+ userinfo.h \
unlink.C
#include <config.h>
#include "debug.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
#include "support/systemcall.h"
#include "support/LAssert.h"
#include <vector>
-#include "Lsstream.h"
-
#include "LString.h"
///
///
string const uppercase(string const &);
-/// convert \a T to string
-template<typename T>
-inline
-string const tostr(T const & t)
-{
- ostringstream ostr;
- ostr << t;
- return STRCONV(ostr.str());
- // We need to use the .c_str since we sometimes are using
- // our own string class and that is not compatible with
- // basic_string<char>. (of course we don't want this later)
-}
-
-
-///
-template<>
-inline
-string const tostr(bool const & b)
-{
- return (b ? "true" : "false");
-}
-
-///
-template<>
-inline
-string const tostr(string const & s)
-{
- return s;
-}
-
/// Does the string start with this prefix?
bool prefixIs(string const &, char const *);
#include "LString.h"
#include "support/lyxlib.h"
#include "support/filetools.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
#include "debug.h"
#include "os.h"
--- /dev/null
+#include <config.h>
+
+#include "Lsstream.h"
+#include "LString.h"
+
+
+string const tostr(bool b)
+{
+ return (b ? "true" : "false");
+}
+
+
+string const tostr(unsigned int i)
+{
+ ostringstream os;
+ os << i;
+ return STRCONV(os.str());
+}
+
+
+string const tostr(double d)
+{
+ ostringstream os;
+ os << d;
+ return STRCONV(os.str());
+}
+
+
+string const tostr(int i)
+{
+ ostringstream os;
+ os << i;
+ return STRCONV(os.str());
+}
+
+
+string const tostr(string const & s)
+{
+ return s;
+}
+
--- /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
+ *
+ * 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 "LString.h"
+
+// When trying to convert this to a template using std::stringstream,
+// note that this will pull in the whole of <string> in more than 150
+// files, even when configuring --with-included-strings !
+
+/// convert things to strings
+string const tostr(bool b);
+///
+string const tostr(int);
+///
+string const tostr(unsigned int);
+///
+string const tostr(double);
+///
+string const tostr(string const & s);
+
+#endif
#include "tabular_funcs.h"
#include "support/LIstream.h"
+#include "support/lstrings.h"
#ifndef CXX_GLOBAL_CSTD
using std::strlen;
#ifndef TABULAR_FUNCS_H
#define TABULAR_FUNCS_H
-#include "LString.h"
#include "tabular.h"
-#include "support/lstrings.h" // for tostr
+#include "support/tostr.h"
#include <iosfwd>
#include <cstdlib>
#include "tex-accent.h"
#include "lfuns.h"
-#include "LString.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
/* the names used by TeX and XWindows for deadkeys/accents are not the same
so here follows a table to clearify the differences. Please correct this
#include "intl.h"
#include "box.h"
#include "language.h"
-#include "support/lstrings.h"
+#include "support/tostr.h"
#include "frontends/LyXView.h"
#include "frontends/screen.h"
#include "frontends/Dialogs.h"
#include <config.h>
-#include "support/lstrings.h"
#include "toc.h"
#include "buffer.h"
-#include "frontends/LyXView.h"
#include "LyXAction.h"
#include "paragraph.h"
-#include "insets/insetfloat.h"
-#include "insets/insetwrap.h"
#include "debug.h"
#include "iterators.h"
+#include "insets/insetfloat.h"
+#include "insets/insetwrap.h"
+
+#include "support/tostr.h"
+
+#include "frontends/LyXView.h"
+
using std::vector;
using std::max;
using std::endl;