aboutsummaryrefslogtreecommitdiff
path: root/butl/string-parser
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-05-01 16:08:43 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-05-01 16:59:24 +0300
commit61377c582e0f2675baa5f5e6e30a35d1a4164b33 (patch)
tree11cdca992834d7f7f197f72856712fbcb3020e3d /butl/string-parser
parent442c1a6790e52baa0c081f310d4d9e9b6f1ff638 (diff)
Add hxx extension for headers and lib prefix for library dir
Diffstat (limited to 'butl/string-parser')
-rw-r--r--butl/string-parser56
1 files changed, 0 insertions, 56 deletions
diff --git a/butl/string-parser b/butl/string-parser
deleted file mode 100644
index 74391cd..0000000
--- a/butl/string-parser
+++ /dev/null
@@ -1,56 +0,0 @@
-// file : butl/string-parser -*- C++ -*-
-// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
-// license : MIT; see accompanying LICENSE file
-
-#ifndef BUTL_STRING_PARSER
-#define BUTL_STRING_PARSER
-
-#include <string>
-#include <vector>
-#include <cstddef> // size_t
-#include <utility> // pair
-#include <stdexcept> // invalid_argument
-
-#include <butl/export>
-
-namespace butl
-{
- class LIBBUTL_EXPORT invalid_string: public std::invalid_argument
- {
- public:
- invalid_string (std::size_t p, const std::string& d)
- : invalid_argument (d), position (p) {}
-
- std::size_t position; // Zero-based.
- };
-
- class LIBBUTL_EXPORT string_parser
- {
- public:
- // Parse a whitespace-separated list of strings. Can contain single or
- // double quoted substrings. No escaping is supported. If unquote is true,
- // return one-level unquoted values. Throw invalid_string in case of
- // invalid quoting.
- //
- static std::vector<std::string>
- parse_quoted (const std::string&, bool unquote);
-
- // As above but return a list of string and zero-based position pairs.
- // Position is useful for issuing diagnostics about an invalid string
- // during second-level parsing.
- //
- static std::vector<std::pair<std::string, std::size_t>>
- parse_quoted_position (const std::string&, bool unquote);
-
- // Remove a single level of quotes. Note that the format or the
- // correctness of the quotation is not validated.
- //
- static std::string
- unquote (const std::string&);
-
- static std::vector<std::string>
- unquote (const std::vector<std::string>&);
- };
-}
-
-#endif // BUTL_STRING_PARSER