X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftex2lyx%2FParser.h;h=489b1325492eff14f0bec11ac81e6f196918bef0;hb=3628ceec480c3d8fa9673f80f781eb1153fb9e1f;hp=89a2d1f3207ad88f1ca56479edd14c88d2cb2523;hpb=df4f08862e6827017664c4a56e7e251d03f80400;p=lyx.git diff --git a/src/tex2lyx/Parser.h b/src/tex2lyx/Parser.h index 89a2d1f320..489b132549 100644 --- a/src/tex2lyx/Parser.h +++ b/src/tex2lyx/Parser.h @@ -123,10 +123,17 @@ class iparserdocstream public: typedef idocstream::int_type int_type; - iparserdocstream(idocstream & is) : is_(is) {}; + iparserdocstream(idocstream & is) : is_(is) {} +#ifdef LYX_USE_CXX11 /// Like std::istream::operator bool() - operator bool() const { return s_.empty() ? is_ : true; } + /// Do not convert is_ implicitly to bool, since that is forbidden in C++11. + explicit operator bool() const { return s_.empty() ? !is_.fail() : true; } +#else + /// Like std::istream::operator void*() + operator void*() const { return (s_.empty() && is_.fail()) ? + 0 : const_cast(this); } +#endif /// change the encoding of the input stream to \p e (iconv name) void setEncoding(std::string const & e); @@ -172,7 +179,7 @@ class Parser { Parser & operator=(Parser const & p); public: /// - Parser(idocstream & is); + Parser(idocstream & is, std::string const & fixedenc); /// Parser(std::string const & s); /// @@ -351,10 +358,12 @@ private: std::string encoding_iconv_; /// CatCode theCatcode_[256]; - // + /// cat_type theCatcodesType_; - // + /// cat_type curr_cat_; + /// + bool fixed_enc_; };