Bug 773151: Convert nsCAutoString->nsAutoCString CLOSED TREE r=bsmedberg
[gecko.git] / parser / html / nsHtml5ByteReadable.h
blob78729f19cce42a95eed4bc05bd579c89f6558350
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef nsHtml5ByteReadable_h__
6 #define nsHtml5ByteReadable_h__
8 #include "prtypes.h"
10 /**
11 * A weak reference wrapper around a byte array.
13 class nsHtml5ByteReadable
15 public:
17 nsHtml5ByteReadable(const uint8_t* current, const uint8_t* end)
18 : current(current),
19 end(end)
23 inline int32_t read() {
24 if (current < end) {
25 return *(current++);
26 } else {
27 return -1;
31 private:
32 const uint8_t* current;
33 const uint8_t* end;
35 #endif