fix stream wrapper initializer
fix initialization warning add special wrapper for AutoUTFInputStream
This commit is contained in:
parent
b16ff281f8
commit
79d9c71f98
@ -108,9 +108,9 @@ struct ParseResult {
|
|||||||
typedef bool (ParseResult::*BooleanType)() const;
|
typedef bool (ParseResult::*BooleanType)() const;
|
||||||
public:
|
public:
|
||||||
//! Default constructor, no error.
|
//! Default constructor, no error.
|
||||||
ParseResult() : code_(kParseErrorNone), offset_(0) {}
|
ParseResult() : code_(kParseErrorNone), offset_(0), line_(0), col_(0) {}
|
||||||
//! Constructor to set an error.
|
//! Constructor to set an error.
|
||||||
ParseResult(ParseErrorCode code, size_t offset) : code_(code), offset_(offset) {}
|
ParseResult(ParseErrorCode code, size_t offset) : code_(code), offset_(offset), line_(0), col_(0) {}
|
||||||
|
|
||||||
//! Get the error code.
|
//! Get the error code.
|
||||||
ParseErrorCode Code() const { return code_; }
|
ParseErrorCode Code() const { return code_; }
|
||||||
|
@ -115,7 +115,7 @@ public:
|
|||||||
typedef typename Encoding::Ch Ch;
|
typedef typename Encoding::Ch Ch;
|
||||||
size_t line_;
|
size_t line_;
|
||||||
size_t col_;
|
size_t col_;
|
||||||
GenericStreamWrapper(InputStream& is): is_(is), line_(1), col_(0) {}
|
GenericStreamWrapper(InputStream& is): line_(1), col_(0), is_(is) {}
|
||||||
|
|
||||||
Ch Peek() const { return is_.Peek(); }
|
Ch Peek() const { return is_.Peek(); }
|
||||||
|
|
||||||
@ -133,11 +133,17 @@ public:
|
|||||||
size_t Tell() { return is_.Tell(); }
|
size_t Tell() { return is_.Tell(); }
|
||||||
|
|
||||||
Ch* PutBegin() { return is_.PutBegin(); }
|
Ch* PutBegin() { return is_.PutBegin(); }
|
||||||
void Put(Ch ch) { return is_.Put(ch); }
|
void Put(Ch ch) { is_.Put(ch); }
|
||||||
void Flush() { return is_.Flush(); }
|
void Flush() { is_.Flush(); }
|
||||||
size_t PutEnd(Ch* ch) { is_.PutEnd(ch); }
|
size_t PutEnd(Ch* ch) { return is_.PutEnd(ch); }
|
||||||
|
|
||||||
|
// wrapper for MemoryStream
|
||||||
|
const Ch* Peek4() const { return is_.Peek4(); }
|
||||||
|
|
||||||
|
// wrapper for AutoUTFInputStream
|
||||||
|
UTFType GetType() const { return is_.GetType(); }
|
||||||
|
bool HasBOM() const { return is_.HasBOM(); }
|
||||||
|
|
||||||
const Ch* Peek4() const { is_.Peek4(); }
|
|
||||||
private:
|
private:
|
||||||
InputStream& is_;
|
InputStream& is_;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user