From 5661b404b0104c3065a40ad622bdd3c11d748a99 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 20 Apr 2017 17:31:26 +0300 Subject: Implement string_parser --- butl/tab-parser | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'butl/tab-parser') diff --git a/butl/tab-parser b/butl/tab-parser index 6aa0705..f140b71 100644 --- a/butl/tab-parser +++ b/butl/tab-parser @@ -7,14 +7,12 @@ #include #include -#include +#include #include // uint64_t #include // runtime_error #include -#include - namespace butl { class LIBBUTL_EXPORT tab_parsing: public std::runtime_error @@ -52,11 +50,11 @@ namespace butl // supported. Blank lines and lines that start with # (collectively called // empty lines) are ignored. // - class LIBBUTL_EXPORT tab_parser: protected butl::char_scanner + class LIBBUTL_EXPORT tab_parser { public: tab_parser (std::istream& is, const std::string& name) - : char_scanner (is), name_ (name) {} + : is_ (is), name_ (name) {} // Return next line of fields. Skip empty lines. Empty result denotes the // end of stream. @@ -65,13 +63,9 @@ namespace butl next (); private: - // Skip spaces and return the first peeked non-space character. - // - xchar - skip_spaces (); - - private: + std::istream& is_; const std::string name_; + std::uint64_t line_ = 0; }; } -- cgit v1.1