aboutsummaryrefslogtreecommitdiff
path: root/butl/tab-parser
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-04-20 17:31:26 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-04-20 21:08:32 +0300
commit5661b404b0104c3065a40ad622bdd3c11d748a99 (patch)
treeb1e1d7aefa9fda7214fa0fcce92cf1b85f87fc76 /butl/tab-parser
parent972f89d5a1d0c094241eb6ce1b8f499e3fcf151b (diff)
Implement string_parser
Diffstat (limited to 'butl/tab-parser')
-rw-r--r--butl/tab-parser16
1 files changed, 5 insertions, 11 deletions
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 <string>
#include <vector>
-#include <iosfwd>
+#include <istream>
#include <cstdint> // uint64_t
#include <stdexcept> // runtime_error
#include <butl/export>
-#include <butl/char-scanner>
-
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;
};
}