~ubuntu-branches/ubuntu/trusty/openjade1.3/trusty

« back to all changes in this revision

Viewing changes to include/SdText.h

  • Committer: Bazaar Package Importer
  • Author(s): Yann Dirson
  • Date: 2002-04-09 00:01:50 UTC
  • Revision ID: james.westby@ubuntu.com-20020409000150-r9rkyalxlhvf9ba3
Tags: upstream-1.3.1
ImportĀ upstreamĀ versionĀ 1.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) 1995 James Clark
 
2
// See the file COPYING for copying permission.
 
3
 
 
4
#ifndef SdText_INCLUDED
 
5
#define SdText_INCLUDED 1
 
6
 
 
7
#ifdef __GNUG__
 
8
#pragma interface
 
9
#endif
 
10
 
 
11
#include "types.h"
 
12
#include "StringOf.h"
 
13
#include "Vector.h"
 
14
#include "Location.h"
 
15
#include <stddef.h>
 
16
 
 
17
#ifdef SP_NAMESPACE
 
18
namespace SP_NAMESPACE {
 
19
#endif
 
20
 
 
21
struct SP_API SdTextItem {
 
22
  SdTextItem();
 
23
  Location loc;
 
24
  size_t index;
 
25
};
 
26
 
 
27
class SP_API SdText {
 
28
public:
 
29
  SdText();
 
30
  SdText(const Location &loc, Boolean lita);
 
31
  void swap(SdText &);
 
32
  void addChar(SyntaxChar, const Location &);
 
33
  const String<SyntaxChar> &string() const;
 
34
  Boolean lita() const;
 
35
  Location endDelimLocation() const;
 
36
private:
 
37
  Boolean lita_;
 
38
  String<SyntaxChar> chars_;
 
39
  Vector<SdTextItem> items_;
 
40
  friend class SdTextIter;
 
41
};
 
42
 
 
43
class SP_API SdTextIter {
 
44
public:
 
45
  SdTextIter(const SdText &);
 
46
  Boolean next(const SyntaxChar *&, size_t &, Location &);
 
47
private:
 
48
  const SdText *ptr_;
 
49
  size_t itemIndex_;
 
50
};
 
51
 
 
52
inline
 
53
Boolean SdText::lita() const
 
54
{
 
55
  return lita_;
 
56
}
 
57
 
 
58
inline
 
59
const String<SyntaxChar> &SdText::string() const
 
60
{
 
61
  return chars_;
 
62
}
 
63
 
 
64
#ifdef SP_NAMESPACE
 
65
}
 
66
#endif
 
67
 
 
68
#endif /* not SdText_INCLUDED */