*
* LyX, The Document Processor
*
- * Copyright (C) 1995 Matthias Ettrich
- * Copyright (C) 1995-1998 The LyX Team.
+ * Copyright 1995 Matthias Ettrich
+ * Copyright 1995-1999 The LyX Team.
*
- *======================================================*/
+ * ====================================================== */
#ifdef HAVE_CONFIG_H
#include <config.h>
}
-LSubstring::LSubstring(string & s, string & s2)
+LSubstring::LSubstring(string & s, string const & s2)
: ps(&s), n(s2.length())
{
pos = s.find(s2);
}
-LSubstring::LSubstring(string & s, char * p)
+LSubstring::LSubstring(string & s, string::value_type const * p)
: ps(&s)
{
n = strlen(p);
}
-LSubstring::LSubstring(string & s, LRegex & r)
+LSubstring::LSubstring(string & s, LRegex const & r)
: ps(&s)
{
LRegex::MatchPair res = r.first_match(s);
pos = res.first;
} else {
n = 0;
- pos = 0;
+ pos = string::npos;
}
}
{
return string(*ps, pos, n); // copy from *ps
}
-
-
-#if 0
-LSubstring::operator char const * () const
-{
- static string tr;
- tr.assign(*ps, pos, n);
- return tr.c_str();
-}
-#endif