btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / storage / sniffer / CharStream.h
blob23e29ee89eef6c60a8d0401f701467d6ebb70b86
1 //----------------------------------------------------------------------
2 // This software is part of the OpenBeOS distribution and is covered
3 // by the MIT License.
4 //---------------------------------------------------------------------
5 /*!
6 \file sniffer/CharStream.h
7 Character stream class
8 */
9 #ifndef _SNIFFER_CHAR_STREAM_H
10 #define _SNIFFER_CHAR_STREAM_H
12 #include <SupportDefs.h>
14 #include <string>
16 namespace BPrivate {
17 namespace Storage {
18 namespace Sniffer {
20 //! Manages a stream of characters
21 /*! CharStream is used by the scanner portion of the parser, which is implemented
22 in TokenStream::SetTo().
24 It's also used by BPrivate::TRoster while parsing through the the
25 roster's RosterSettings file.
27 class CharStream {
28 public:
29 CharStream(const std::string &string);
30 CharStream();
31 virtual ~CharStream();
33 status_t SetTo(const std::string &string);
34 void Unset();
35 status_t InitCheck() const;
36 bool IsEmpty() const;
37 size_t Pos() const;
38 const std::string& String() const;
40 char Get();
41 void Unget();
43 private:
44 std::string fString;
45 size_t fPos;
46 status_t fCStatus;
48 CharStream(const CharStream &ref);
49 CharStream& operator=(const CharStream &ref);
52 }; // namespace Sniffer
53 }; // namespace Storage
54 }; // namespace BPrivate
56 #endif // _SNIFFER_CHAR_STREAM_H