summaryrefslogtreecommitdiff
path: root/ACEXML/common/InputSource.cpp
blob: c350531f656f6788799aed18f8859b65e45caa61 (plain)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// -*- C++ -*- $Id$

#include "Common/InputSource.h"
#include "ace/ACE.h"

ACEXML_InputSource::ACEXML_InputSource (void)
  : publicId_ (0),
    systemId_ (0),
    charStream_ (0),
    encoding_ (0)
{
}

ACEXML_InputSource::ACEXML_InputSource (ACEXML_CharStream *stm)
  : publicId_ (0),
    systemId_ (0),
    charStream_ (stm),
    encoding_ (0)
{
}

  /*
   * Create a new input source with a character stream.
   * /
    InputSource (Reader);
  */

ACEXML_InputSource::ACEXML_InputSource (const ACEXML_Char *systemId)
  : systemId_ (ACE::strnew (systemId))
{
}

ACEXML_InputSource::~ACEXML_InputSource (void)
{
  delete this->publicId_;
  delete this->systemId_;
  delete this->charStream_;
  delete this->encoding_;
}

ACEXML_CharStream *
ACEXML_InputSource::getCharStream (void)
{
  return this->charStream_;
}

  /*
   * Get the character stream for this input source.
   * /
   virtual Reader *getCharacterStream (void);
  */

const ACEXML_Char *
ACEXML_InputSource::getEncoding (void)
{
  return this->encoding_;
}

const ACEXML_Char *
ACEXML_InputSource::getPublicId (void)
{
  return this->publicId_;
}

const ACEXML_Char *
ACEXML_InputSource::getSystemId (void)
{
  return this->systemId_;
}

void
ACEXML_InputSource::setCharStream (ACEXML_CharStream *stm)
{
  delete this->charStream_;
  this->charStream_ = stm;
}

  /*
   * Set the character stream for this input source.
   * /
   virtual void setCharacterStream (Reader *characterStream);
  */

void
ACEXML_InputSource::setEncoding (const ACEXML_Char *encoding)
{
  this->encoding_ = ACE::strnew (encoding);
}

void
ACEXML_InputSource::setPublicId (const ACEXML_Char *publicId)
{
  this->publicId_ = ACE::strnew (publicId);
}

void
ACEXML_InputSource::setSystemId (const ACEXML_Char *systemId)
{
  this->systemId_ = ACE::strnew (systemId);
}