1999-11-09 22:20:24 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
|
|
|
* ======================================================
|
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
2000-03-09 03:36:48 +00:00
|
|
|
* Copyright 1995 Matthias Ettrich
|
|
|
|
* Copyright 1995-2000 The LyX Team.
|
1999-11-09 22:20:24 +00:00
|
|
|
*
|
1999-11-15 10:54:16 +00:00
|
|
|
* ====================================================== */
|
1999-11-09 22:20:24 +00:00
|
|
|
|
|
|
|
// This one is heavily based on the substring class in The C++
|
|
|
|
// Programming Language by Bjarne Stroustrup
|
|
|
|
|
|
|
|
#ifndef LSUBSTRING_H
|
|
|
|
#define LSUBSTRING_H
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#include "LString.h"
|
|
|
|
#include "LRegex.h"
|
|
|
|
|
|
|
|
///
|
|
|
|
class LSubstring {
|
|
|
|
public:
|
|
|
|
///
|
|
|
|
typedef string::size_type size_type;
|
|
|
|
///
|
|
|
|
LSubstring(string & s, size_type i, size_type n);
|
|
|
|
///
|
1999-11-15 14:45:17 +00:00
|
|
|
LSubstring(string & s, string const & s2);
|
1999-11-09 22:20:24 +00:00
|
|
|
///
|
1999-11-15 14:45:17 +00:00
|
|
|
LSubstring(string & s, string::value_type const * p);
|
1999-11-09 22:20:24 +00:00
|
|
|
///
|
1999-11-15 14:45:17 +00:00
|
|
|
LSubstring(string & s, LRegex const & r);
|
1999-11-09 22:20:24 +00:00
|
|
|
///
|
|
|
|
LSubstring & operator=(string const &);
|
|
|
|
///
|
|
|
|
LSubstring & operator=(LSubstring const &);
|
|
|
|
///
|
|
|
|
LSubstring & operator=(string::value_type const *);
|
|
|
|
///
|
|
|
|
LSubstring & operator=(string::value_type);
|
|
|
|
///
|
|
|
|
operator string() const;
|
|
|
|
private:
|
|
|
|
///
|
|
|
|
string * ps;
|
|
|
|
///
|
|
|
|
size_type pos;
|
|
|
|
///
|
|
|
|
size_type n;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|