Commit 79d9c71f authored by KaitoHH's avatar KaitoHH

fix stream wrapper initializer

fix initialization warning

add special wrapper for AutoUTFInputStream
parent b16ff281
......@@ -108,9 +108,9 @@ struct ParseResult {
typedef bool (ParseResult::*BooleanType)() const;
public:
//! Default constructor, no error.
ParseResult() : code_(kParseErrorNone), offset_(0) {}
ParseResult() : code_(kParseErrorNone), offset_(0), line_(0), col_(0) {}
//! 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.
ParseErrorCode Code() const { return code_; }
......
......@@ -115,7 +115,7 @@ public:
typedef typename Encoding::Ch Ch;
size_t line_;
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(); }
......@@ -133,11 +133,17 @@ public:
size_t Tell() { return is_.Tell(); }
Ch* PutBegin() { return is_.PutBegin(); }
void Put(Ch ch) { return is_.Put(ch); }
void Flush() { return is_.Flush(); }
size_t PutEnd(Ch* ch) { is_.PutEnd(ch); }
void Put(Ch ch) { is_.Put(ch); }
void Flush() { is_.Flush(); }
size_t PutEnd(Ch* ch) { return is_.PutEnd(ch); }
const Ch* Peek4() const { is_.Peek4(); }
// 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(); }
private:
InputStream& is_;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment