haiku/headers/build/private/storage/sniffer/CharStream.h
Ingo Weinhold 338b8dc301 Merged changes from branch build_system_redesign at revision 14573.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14574 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-29 16:27:43 +00:00

57 lines
1.3 KiB
C++

//----------------------------------------------------------------------
// This software is part of the OpenBeOS distribution and is covered
// by the OpenBeOS license.
//---------------------------------------------------------------------
/*!
\file sniffer/CharStream.h
Character stream class
*/
#ifndef _SNIFFER_CHAR_STREAM_H
#define _SNIFFER_CHAR_STREAM_H
#include <SupportDefs.h>
#include <string>
namespace BPrivate {
namespace Storage {
namespace Sniffer {
//! Manages a stream of characters
/*! CharStream is used by the scanner portion of the parser, which is implemented
in TokenStream::SetTo().
It's also used by BPrivate::TRoster while parsing through the the
roster's RosterSettings file.
*/
class CharStream {
public:
CharStream(const std::string &string);
CharStream();
virtual ~CharStream();
status_t SetTo(const std::string &string);
void Unset();
status_t InitCheck() const;
bool IsEmpty() const;
size_t Pos() const;
const std::string& String() const;
char Get();
void Unget();
private:
std::string fString;
size_t fPos;
status_t fCStatus;
CharStream(const CharStream &ref);
CharStream& operator=(const CharStream &ref);
};
}; // namespace Sniffer
}; // namespace Storage
}; // namespace BPrivate
#endif // _SNIFFER_CHAR_STREAM_H