]> git.lyx.org Git - lyx.git/blob - src/support/LSubstring.h
some white-space changes, enum changes because of ridance of definitions.h, block...
[lyx.git] / src / support / LSubstring.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  * 
5  *           LyX, The Document Processor
6  *       
7  *          Copyright (C) 1995 Matthias Ettrich
8  *          Copyright (C) 1995-1998 The LyX Team.
9  *
10  * ====================================================== */
11
12 // This one is heavily based on the substring class in The C++
13 // Programming Language by Bjarne Stroustrup
14
15 #ifndef LSUBSTRING_H
16 #define LSUBSTRING_H 
17
18 #ifdef __GNUG__
19 #pragma interface
20 #endif
21
22
23 #include "LString.h"
24 #include "LRegex.h"
25
26 ///
27 class LSubstring {
28 public:
29         ///
30         typedef string::size_type size_type;
31         ///
32         LSubstring(string & s, size_type i, size_type n);
33         ///
34         LSubstring(string & s, string & s2);
35         ///
36         LSubstring(string & s, string::value_type * p);
37         ///
38         LSubstring(string & s, LRegex & r);
39         ///
40         LSubstring & operator=(string const &);
41         ///
42         LSubstring & operator=(LSubstring const &);
43         ///
44         LSubstring & operator=(string::value_type const *);
45         ///
46         LSubstring & operator=(string::value_type);
47         ///
48         operator string() const;
49 #if 0
50         ///
51         operator char const * () const;
52 #endif
53 private:
54         ///
55         string * ps;
56         ///
57         size_type pos;
58         ///
59         size_type n;
60 };
61
62 #endif