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

« back to all changes in this revision

Viewing changes to lib/InputSource.cxx

  • 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) 1994 James Clark
 
2
// See the file COPYING for copying permission.
 
3
 
 
4
#ifdef __GNUG__
 
5
#pragma implementation
 
6
#endif
 
7
#include "splib.h"
 
8
#include "InputSource.h"
 
9
#include "MarkupScan.h"
 
10
 
 
11
#ifdef SP_NAMESPACE
 
12
namespace SP_NAMESPACE {
 
13
#endif
 
14
 
 
15
InputSource::InputSource(InputSourceOrigin *origin, const Char *start,
 
16
                         const Char *end)
 
17
: origin_(origin), start_(start), end_(end), cur_(start), accessError_(0),
 
18
  startLocation_(origin, 0), multicode_(0), scanSuppress_(0)
 
19
{
 
20
}
 
21
 
 
22
void InputSource::reset(const Char *start,
 
23
                        const Char *end)
 
24
{
 
25
  origin_ = origin_->copy();
 
26
  start_ = start;
 
27
  end_ = end;
 
28
  cur_ = start_;
 
29
  startLocation_ = Location(origin_.pointer(), 0);
 
30
  multicode_ = 0;
 
31
  scanSuppress_ = 0;
 
32
  markupScanTable_.clear();
 
33
}
 
34
 
 
35
InputSource::~InputSource()
 
36
{
 
37
}
 
38
 
 
39
void InputSource::advanceStartMulticode(const Char *to)
 
40
{
 
41
  while (start_ < to) {
 
42
    switch (markupScanTable_[*start_]) {
 
43
    case MarkupScan::normal:
 
44
      break;
 
45
    case MarkupScan::in:
 
46
      scanSuppress_ = 0;
 
47
      break;
 
48
    case MarkupScan::out:
 
49
      if (!scanSuppress()) {
 
50
        scanSuppress_ = 1;
 
51
        scanSuppressSingle_ = 0;
 
52
      }
 
53
      break;
 
54
    case MarkupScan::suppress:
 
55
      // what's the effect of MSSCHAR followed by MSSCHAR
 
56
      if (!scanSuppress()) {
 
57
        scanSuppress_ = 1;
 
58
        scanSuppressSingle_ = 1;
 
59
        scanSuppressIndex_ = startLocation_.index() + 1;
 
60
      }
 
61
      break;
 
62
    }
 
63
    start_++;
 
64
    startLocation_ += 1;
 
65
  }
 
66
}
 
67
 
 
68
void InputSource::willNotRewind()
 
69
{
 
70
}
 
71
 
 
72
void InputSource::setDocCharset(const CharsetInfo &,
 
73
                                const CharsetInfo &)
 
74
{
 
75
}
 
76
 
 
77
void InputSource::willNotSetDocCharset()
 
78
{
 
79
}
 
80
 
 
81
#ifdef SP_NAMESPACE
 
82
}
 
83
#endif