*
* LyX, The Document Processor
*
- * Copyright (C) 1995 Matthias Ettrich
- * Copyright (C) 1995-1998 The LyX Team.
+ * Copyright 1995 Matthias Ettrich
+ * Copyright 1995-2001 The LyX Team.
*
* ====================================================== */
#include <config.h>
#endif
+#ifdef __GNUG__
+#pragma implementation
+#endif
+
#include "LSubstring.h"
+#ifndef CXX_GLOBAL_CSTD
+using std::strlen;
+#endif
+
+
LSubstring::LSubstring(string & s, size_type i, size_type l)
: ps(&s), pos(i), n(l)
LSubstring::LSubstring(string & s, LRegex const & r)
: ps(&s)
{
- LRegex::MatchPair res = r.first_match(s);
+ LRegex::MatchPair const res = r.first_match(s);
if (res.first != string::npos) {
n = res.second;
pos = res.first;
} else {
n = 0;
- pos = 0;
+ pos = string::npos;
}
}
LSubstring & LSubstring::operator=(LSubstring const & s)
{
- ps->replace(pos, n, string(s, 0, string::npos));
+ ps->replace(pos, n, s);
return *this;
}
-LSubstring & LSubstring::operator=(char const * p)
+LSubstring & LSubstring::operator=(string::value_type const * p)
{
ps->replace(pos, n, p);
return *this;
}
-LSubstring & LSubstring::operator=(char c)
+LSubstring & LSubstring::operator=(string::value_type c)
{
ps->replace(pos, n, 1, c);
return *this;