]> git.lyx.org Git - lyx.git/blobdiff - src/support/docstring.cpp
there is no trunk/src/intl folder
[lyx.git] / src / support / docstring.cpp
index 8a59d40d4f78e7957ee6275b59f6b327ef646e0f..168cbc2757090a096a94a8d267fb46cb0104be51 100644 (file)
 
 #include <locale>
 #include <iostream>
+#include <typeinfo>
 
 #include <QFile>
 
-#include <boost/assert.hpp>
+#include "support/assert.h"
 
 using namespace std;
 
@@ -32,7 +33,7 @@ docstring const from_ascii(char const * ascii)
 {
        docstring s;
        for (char const * c = ascii; *c; ++c) {
-               BOOST_ASSERT(static_cast<unsigned char>(*c) < 0x80);
+               LASSERT(static_cast<unsigned char>(*c) < 0x80, /**/);
                s.push_back(*c);
        }
        return s;
@@ -43,7 +44,7 @@ docstring const from_ascii(string const & ascii)
 {
        int const len = ascii.length();
        for (int i = 0; i < len; ++i)
-               BOOST_ASSERT(static_cast<unsigned char>(ascii[i]) < 0x80);
+               LASSERT(static_cast<unsigned char>(ascii[i]) < 0x80, /**/);
        return docstring(ascii.begin(), ascii.end());
 }
 
@@ -54,7 +55,7 @@ string const to_ascii(docstring const & ucs4)
        string ascii;
        ascii.resize(len);
        for (int i = 0; i < len; ++i) {
-               BOOST_ASSERT(ucs4[i] < 0x80);
+               LASSERT(ucs4[i] < 0x80, /**/);
                ascii[i] = static_cast<char>(ucs4[i]);
        }
        return ascii;
@@ -160,7 +161,7 @@ bool operator==(lyx::docstring const & l, char const * r)
        lyx::docstring::const_iterator it = l.begin();
        lyx::docstring::const_iterator end = l.end();
        for (; it != end; ++it, ++r) {
-               BOOST_ASSERT(static_cast<unsigned char>(*r) < 0x80);
+               LASSERT(static_cast<unsigned char>(*r) < 0x80, /**/);
                if (!*r)
                        return false;
                if (*it != static_cast<lyx::docstring::value_type>(*r))
@@ -174,7 +175,7 @@ lyx::docstring operator+(lyx::docstring const & l, char const * r)
 {
        lyx::docstring s(l);
        for (char const * c = r; *c; ++c) {
-               BOOST_ASSERT(static_cast<unsigned char>(*c) < 0x80);
+               LASSERT(static_cast<unsigned char>(*c) < 0x80, /**/);
                s.push_back(*c);
        }
        return s;
@@ -185,7 +186,7 @@ lyx::docstring operator+(char const * l, lyx::docstring const & r)
 {
        lyx::docstring s;
        for (char const * c = l; *c; ++c) {
-               BOOST_ASSERT(static_cast<unsigned char>(*c) < 0x80);
+               LASSERT(static_cast<unsigned char>(*c) < 0x80, /**/);
                s.push_back(*c);
        }
        s += r;
@@ -195,7 +196,7 @@ lyx::docstring operator+(char const * l, lyx::docstring const & r)
 
 lyx::docstring operator+(lyx::docstring const & l, char r)
 {
-       BOOST_ASSERT(static_cast<unsigned char>(r) < 0x80);
+       LASSERT(static_cast<unsigned char>(r) < 0x80, /**/);
        docstring s = l;
        s += docstring::value_type(r);
        return s;
@@ -204,7 +205,7 @@ lyx::docstring operator+(lyx::docstring const & l, char r)
 
 lyx::docstring operator+(char l, lyx::docstring const & r)
 {
-       BOOST_ASSERT(static_cast<unsigned char>(l) < 0x80);
+       LASSERT(static_cast<unsigned char>(l) < 0x80, /**/);
        return lyx::docstring::value_type(l) + r;
 }
 
@@ -212,7 +213,7 @@ lyx::docstring operator+(char l, lyx::docstring const & r)
 lyx::docstring & operator+=(lyx::docstring & l, char const * r)
 {
        for (char const * c = r; *c; ++c) {
-               BOOST_ASSERT(static_cast<unsigned char>(*c) < 0x80);
+               LASSERT(static_cast<unsigned char>(*c) < 0x80, /**/);
                l.push_back(*c);
        }
        return l;
@@ -221,7 +222,7 @@ lyx::docstring & operator+=(lyx::docstring & l, char const * r)
 
 lyx::docstring & operator+=(lyx::docstring & l, char r)
 {
-       BOOST_ASSERT(static_cast<unsigned char>(r) < 0x80);
+       LASSERT(static_cast<unsigned char>(r) < 0x80, /**/);
        l.push_back(r);
        return l;
 }
@@ -596,8 +597,8 @@ protected:
                        for (; iit != eit; ++iit) {
                                s += *iit;
                                ++n;
-                               bool true_ok = prefixIs(truename, s);
-                               bool false_ok = prefixIs(falsename, s);
+                               bool true_ok = support::prefixIs(truename, s);
+                               bool false_ok = support::prefixIs(falsename, s);
                                if (!true_ok && !false_ok) {
                                        ++iit;
                                        ok = false;