Fix typo in license headers
[oweals/cde.git] / cde / programs / nsgmls / SdText.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these libraries and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /* $XConsortium: SdText.h /main/1 1996/07/29 17:03:58 cde-hp $ */
24 // Copyright (c) 1995 James Clark
25 // See the file COPYING for copying permission.
26
27 #ifndef SdText_INCLUDED
28 #define SdText_INCLUDED 1
29
30 #ifdef __GNUG__
31 #pragma interface
32 #endif
33
34 #include "types.h"
35 #include "StringOf.h"
36 #include "Vector.h"
37 #include "Location.h"
38 #include <stddef.h>
39
40 #ifdef SP_NAMESPACE
41 namespace SP_NAMESPACE {
42 #endif
43
44 struct SP_API SdTextItem {
45   SdTextItem();
46   Location loc;
47   size_t index;
48 };
49
50 class SP_API SdText {
51 public:
52   SdText();
53   SdText(const Location &loc, Boolean lita);
54   void swap(SdText &);
55   void addChar(SyntaxChar, const Location &);
56   const String<SyntaxChar> &string() const;
57   Boolean lita() const;
58   Location endDelimLocation() const;
59 private:
60   Boolean lita_;
61   String<SyntaxChar> chars_;
62   Vector<SdTextItem> items_;
63   friend class SdTextIter;
64 };
65
66 class SP_API SdTextIter {
67 public:
68   SdTextIter(const SdText &);
69   Boolean next(const SyntaxChar *&, size_t &, Location &);
70 private:
71   const SdText *ptr_;
72   size_t itemIndex_;
73 };
74
75 inline
76 Boolean SdText::lita() const
77 {
78   return lita_;
79 }
80
81 inline
82 const String<SyntaxChar> &SdText::string() const
83 {
84   return chars_;
85 }
86
87 #ifdef SP_NAMESPACE
88 }
89 #endif
90
91 #endif /* not SdText_INCLUDED */