activemq-cpp-3.8.2
FilterInputStream.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _DECAF_IO_FILTERINPUTSTREAM_H_
19 #define _DECAF_IO_FILTERINPUTSTREAM_H_
20 
21 #include <decaf/io/InputStream.h>
22 #include <decaf/io/IOException.h>
25 
26 namespace decaf{
27 namespace io{
28 
39  protected:
40 
41  // The input stream to wrap
43 
44  // Indicates if we own the wrapped stream
45  bool own;
46 
47  // Indicates that this stream was closed
48  volatile bool closed;
49 
50  private:
51 
53  FilterInputStream& operator=(const FilterInputStream&);
54 
55  public:
56 
65  FilterInputStream(InputStream* inputStream, bool own = false);
66 
67  virtual ~FilterInputStream();
68 
72  virtual int available() const;
73 
77  virtual void close();
78 
82  virtual long long skip(long long num);
83 
87  virtual void mark(int readLimit);
88 
92  virtual void reset();
93 
97  virtual bool markSupported() const;
98 
99  protected:
100 
101  virtual int doReadByte();
102 
103  virtual int doReadArray(unsigned char* buffer, int size);
104 
105  virtual int doReadArrayBounded(unsigned char* buffer, int size, int offset, int length);
106 
110  virtual bool isClosed() const;
111 
112  };
113 
114 }}
115 
116 #endif /*_DECAF_IO_FILTERINPUTSTREAM_H_*/
bool own
Definition: FilterInputStream.h:45
A base class that must be implemented by all classes wishing to provide a class that reads in a strea...
Definition: InputStream.h:39
InputStream * inputStream
Definition: FilterInputStream.h:42
A FilterInputStream contains some other input stream, which it uses as its basic source of data...
Definition: FilterInputStream.h:38
#define DECAF_API
Definition: Config.h:29
volatile bool closed
Definition: FilterInputStream.h:48
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: AprPool.h:25