X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ftex2lyx%2FParser.h;h=19f0c5fbe33a61ab5bbbb5af4a06fcef8dce8fb4;hb=ce8929e9b237af569934b434154d199634363268;hp=42243c6465a581a4427bca8f183310519831aef7;hpb=683050d4f9a2e9476ccf2313f8f72eb99fcf4a87;p=lyx.git diff --git a/src/tex2lyx/Parser.h b/src/tex2lyx/Parser.h index 42243c6465..19f0c5fbe3 100644 --- a/src/tex2lyx/Parser.h +++ b/src/tex2lyx/Parser.h @@ -123,13 +123,14 @@ class iparserdocstream public: typedef idocstream::int_type int_type; - iparserdocstream(idocstream & is) : is_(is) {}; + iparserdocstream(idocstream & is) : is_(is) {} /// 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; } /// change the encoding of the input stream to \p e (iconv name) - bool setEncoding(std::string const & e); + void setEncoding(std::string const & e); // add to the list of characters to read before actually reading // the stream @@ -172,7 +173,7 @@ class Parser { Parser & operator=(Parser const & p); public: /// - Parser(idocstream & is); + Parser(idocstream & is, std::string const & fixedenc); /// Parser(std::string const & s); /// @@ -280,9 +281,13 @@ public: * stopped at string \p end_string. Contrary to the other * methods, this uses proper catcode setting. This function is * designed to parse verbatim environments and command. The - * intention is to eventually replace all of its siblings. + * intention is to eventually replace all of its siblings. the + * member \p first of the result tells whether the arg was + * found and the member \p second is the value. If \p + * allow_linebreak is false, then the parsing is limited to one line */ - std::string const verbatimStuff(std::string const & end_string); + Arg verbatimStuff(std::string const & end_string, + bool allow_linebreak = true); /* * \returns the contents of the environment \p name. * \begin{name} must be parsed already, @@ -347,10 +352,12 @@ private: std::string encoding_iconv_; /// CatCode theCatcode_[256]; - // + /// cat_type theCatcodesType_; - // + /// cat_type curr_cat_; + /// + bool fixed_enc_; };