X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fparser.h;h=32a776082de1896e20fbe5aa001a78669e33ea66;hb=refs%2Fheads%2Fwip;hp=c7c10f162f3339b4085f88df03afe69dc5bad3dc;hpb=82e19fd15e24f913fba0cf8a4fb0352f282c3389;p=libs%2Fdatafile.git diff --git a/source/parser.h b/source/parser.h index c7c10f1..32a7760 100644 --- a/source/parser.h +++ b/source/parser.h @@ -4,6 +4,7 @@ #include #include #include "input.h" +#include "mspdatafile_api.h" namespace Msp { namespace DataFile { @@ -19,14 +20,14 @@ Frontend for loading datafiles. Handles switching between text and binary formats. A Parser evaluates into a boolean value indicating whether more statements may be read. */ -class Parser: private NonCopyable +class MSPDATAFILE_API Parser: private NonCopyable { private: Input in; std::string main_src; std::string src; - bool good; - ParserMode *mode; + bool good = true; + ParserMode *mode = nullptr; public: Parser(IO::Base &i, const std::string &s); @@ -51,7 +52,7 @@ public: statement's signature. */ bool parse_and_load(unsigned, Loader &, const LoaderAction &); - operator bool() const { return good && in; } + explicit operator bool() const { return good && in; } }; } // namespace DataFile