File: SdText.h

package info (click to toggle)
opensp 1.5pre5-5
  • links: PTS
  • area: main
  • in suites: woody
  • size: 6,860 kB
  • ctags: 8,918
  • sloc: cpp: 63,719; ansic: 10,494; sh: 7,592; makefile: 605; perl: 557; sed: 98
file content (68 lines) | stat: -rw-r--r-- 1,165 bytes parent folder | download | duplicates (15)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Copyright (c) 1995 James Clark
// See the file COPYING for copying permission.

#ifndef SdText_INCLUDED
#define SdText_INCLUDED 1

#ifdef __GNUG__
#pragma interface
#endif

#include "types.h"
#include "StringOf.h"
#include "Vector.h"
#include "Location.h"
#include <stddef.h>

#ifdef SP_NAMESPACE
namespace SP_NAMESPACE {
#endif

struct SP_API SdTextItem {
  SdTextItem();
  Location loc;
  size_t index;
};

class SP_API SdText {
public:
  SdText();
  SdText(const Location &loc, Boolean lita);
  void swap(SdText &);
  void addChar(SyntaxChar, const Location &);
  const String<SyntaxChar> &string() const;
  Boolean lita() const;
  Location endDelimLocation() const;
private:
  Boolean lita_;
  String<SyntaxChar> chars_;
  Vector<SdTextItem> items_;
  friend class SdTextIter;
};

class SP_API SdTextIter {
public:
  SdTextIter(const SdText &);
  Boolean next(const SyntaxChar *&, size_t &, Location &);
private:
  const SdText *ptr_;
  size_t itemIndex_;
};

inline
Boolean SdText::lita() const
{
  return lita_;
}

inline
const String<SyntaxChar> &SdText::string() const
{
  return chars_;
}

#ifdef SP_NAMESPACE
}
#endif

#endif /* not SdText_INCLUDED */