source: NonGTP/Xerces/xerces/include/xercesc/framework/StdInInputSource.hpp @ 358

Revision 358, 4.6 KB checked in by bittner, 19 years ago (diff)

xerces added

Line 
1/*
2 * Copyright 1999-2000,2004 The Apache Software Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/*
18 * $Log: StdInInputSource.hpp,v $
19 * Revision 1.5  2004/09/08 13:55:58  peiyongz
20 * Apache License Version 2.0
21 *
22 * Revision 1.4  2004/01/29 11:46:29  cargilld
23 * Code cleanup changes to get rid of various compiler diagnostic messages.
24 *
25 * Revision 1.3  2003/05/16 21:36:55  knoaman
26 * Memory manager implementation: Modify constructors to pass in the memory manager.
27 *
28 * Revision 1.2  2002/11/04 15:00:21  tng
29 * C++ Namespace Support.
30 *
31 * Revision 1.1.1.1  2002/02/01 22:21:50  peiyongz
32 * sane_include
33 *
34 * Revision 1.6  2000/12/14 18:49:55  tng
35 * Fix API document generation warning: "Warning: end of member group without matching begin"
36 *
37 * Revision 1.5  2000/02/24 20:00:22  abagchi
38 * Swat for removing Log from API docs
39 *
40 * Revision 1.4  2000/02/15 23:59:06  roddey
41 * More updated documentation of Framework classes.
42 *
43 * Revision 1.3  2000/02/15 01:21:30  roddey
44 * Some initial documentation improvements. More to come...
45 *
46 * Revision 1.2  2000/02/06 07:47:46  rahulj
47 * Year 2K copyright swat.
48 *
49 * Revision 1.1  2000/01/12 00:13:26  roddey
50 * These were moved from internal/ to framework/, which was something that should have
51 * happened long ago. They are really framework type of classes.
52 *
53 * Revision 1.1.1.1  1999/11/09 01:08:17  twl
54 * Initial checkin
55 *
56 * Revision 1.2  1999/11/08 20:44:44  rahul
57 * Swat for adding in Product name and CVS comment log variable.
58 *
59 */
60
61
62#if !defined(STDININPUTSOURCE_HPP)
63#define STDININPUTSOURCE_HPP
64
65#include <xercesc/sax/InputSource.hpp>
66
67XERCES_CPP_NAMESPACE_BEGIN
68
69class BinInputStream;
70
71
72/**
73 *  This class is a derivative of the standard InputSource class. It provides
74 *  for the parser access to data via the standard input. This input source
75 *  is not commonly used, but can be useful when implementing such things
76 *  as pipe based tools which exchange XML data.
77 *
78 *  As with all InputSource derivatives. The primary objective of an input
79 *  source is to create an input stream via which the parser can spool in
80 *  data from the referenced source.
81 */
82class XMLPARSER_EXPORT StdInInputSource : public InputSource
83{
84public :
85    // -----------------------------------------------------------------------
86    //  Constructors and Destructor
87    // -----------------------------------------------------------------------
88
89    /** @name Constructor */
90    //@{
91
92    /**
93      * Since the standard input is a canned source, the constructor is very
94      * simple. It just uses local platform services to open up the standard
95      * input source as file, a new handleof which it gives to each new stream
96      * it creates.
97      */
98    StdInInputSource(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
99    //@}
100
101    /** @name Destructor */
102    //@{
103    ~StdInInputSource();
104    //@}
105
106
107    // -----------------------------------------------------------------------
108    //  Virtual input source interface
109    // -----------------------------------------------------------------------
110
111
112    /** @name Virtual methods */
113    //@{
114
115    /**
116     * This method will return a binary input stream derivative that will
117     * parse from the standard input of the local host.
118     *
119     * @return A dynamically allocated binary input stream derivative that
120     *         can parse from the standardinput.
121     */
122    BinInputStream* makeStream() const;
123
124    //@}
125
126private:
127    // -----------------------------------------------------------------------
128    //  Unimplemented constructors and operators
129    // -----------------------------------------------------------------------
130    StdInInputSource(const StdInInputSource&);
131    StdInInputSource& operator=(const StdInInputSource&);
132
133};
134
135inline StdInInputSource::StdInInputSource(MemoryManager* const manager) :
136
137    InputSource("stdin", manager)
138{
139}
140
141inline StdInInputSource::~StdInInputSource()
142{
143}
144
145XERCES_CPP_NAMESPACE_END
146
147#endif
Note: See TracBrowser for help on using the repository browser.