summaryrefslogtreecommitdiff
path: root/ACEXML/common/InputSource.h
blob: 396b7626e52bc27ef0aa74a933197df9c5a49a72 (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
// -*- C++ -*- $Id$

#ifndef _ACEXML_INPUTSOURCE_H_
#define _ACEXML_INPUTSOURCE_H_

#include "Common/CharStream.h"

class ACEXML_Export ACEXML_InputSource
{
public:
  /*
   * Default constructor.
   */
  ACEXML_InputSource (void);

  /*
   * Create a new input source with a ACEXML_Char stream.
   * Notice that ACEXML_InputSource assumes the ownership
   * of <stream>
   */
  ACEXML_InputSource (ACEXML_CharStream *stream);

  /*
   * Create a new input source with a system identifier.
   */
  ACEXML_InputSource (const ACEXML_Char *systemId);

  /*
   * Default destructor.
   */
  virtual ~ACEXML_InputSource (void);

  /*
   * Get the ACEXML_Char stream for this input source.
   */
  virtual ACEXML_CharStream *getCharStream (void);

  /*
   * Get the character encoding for a byte stream or URI.
   */
  virtual const ACEXML_Char *getEncoding (void);

  /*
   * Get the public identifier for this input source.
   */
  virtual const ACEXML_Char *getPublicId (void);

  /*
   * Get the system identifier for this input source.
   */
  virtual const ACEXML_Char *getSystemId (void);

  /*
   * Set the ACEXML_Char stream for this input source.
   * Notice that ACEXML_InputSource assumes the ownership
   * of <stream>
   */
  virtual void setCharStream (ACEXML_CharStream *charStream);

  /*
   * Set the character encoding, if known.
   */
  virtual void setEncoding (const ACEXML_Char *encoding);

  /*
   * Set the public identifier for this input source.
   */
  virtual void setPublicId (const ACEXML_Char *publicId);

  /*
   * Set the public identifier for this input source.
   */
  virtual void setSystemId (const ACEXML_Char *systemId);

private:
  ACEXML_Char *publicId_;
  ACEXML_Char *systemId_;
  ACEXML_CharStream *charStream_;
  ACEXML_Char *encoding_;
};

#endif /* _ACEXML_INPUTSOURCE_H_ */