# Poco

# class CountingInputStream

Library: Foundation
Package: Streams
Header: Poco/CountingStream.h

## Description

This stream counts all characters and lines going through it. This is useful for lexers and parsers that need to determine the current position in the stream.

## Inheritance

Direct Base Classes: CountingIOS, std::istream

All Base Classes: CountingIOS, std::ios, std::istream

## Member Summary

Inherited Functions: addChars, addLines, addPos, chars, getCurrentLineNumber, lines, pos, rdbuf, reset, setCurrentLineNumber

## Constructors

### CountingInputStream

CountingInputStream(
std::istream & istr
);

Creates the CountingInputStream and connects it to the given input stream.

## Destructor

### ~CountingInputStream

~CountingInputStream() override;

Destroys the stream.