diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2021-09-28 19:24:31 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-09-28 20:29:59 +0300 |
commit | df1ef68cd8e8582724ce1192bfc202e0b9aeaf0c (patch) | |
tree | b731ca4c68e60c00c7e7d499dbf4868ee7b71f44 /libbutl/string-parser.mxx | |
parent | 7a4fc37f264cdb67f2f83fa92703c869215bbc86 (diff) |
Get rid of C++ modules related code and rename *.mxx files to *.hxx
Diffstat (limited to 'libbutl/string-parser.mxx')
-rw-r--r-- | libbutl/string-parser.mxx | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/libbutl/string-parser.mxx b/libbutl/string-parser.mxx deleted file mode 100644 index 4ff1590..0000000 --- a/libbutl/string-parser.mxx +++ /dev/null @@ -1,66 +0,0 @@ -// file : libbutl/string-parser.mxx -*- C++ -*- -// license : MIT; see accompanying LICENSE file - -#ifndef __cpp_modules_ts -#pragma once -#endif - -// C includes. - -#ifndef __cpp_lib_modules_ts -#include <string> -#include <vector> -#include <cstddef> // size_t -#include <utility> // pair -#include <stdexcept> // invalid_argument -#endif - -// Other includes. - -#ifdef __cpp_modules_ts -export module butl.string_parser; -#ifdef __cpp_lib_modules_ts -import std.core; -#endif -#endif - -#include <libbutl/export.hxx> - -LIBBUTL_MODEXPORT namespace butl -{ - namespace string_parser - { - class LIBBUTL_SYMEXPORT 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. - }; - - // 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. - // - LIBBUTL_SYMEXPORT 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. - // - LIBBUTL_SYMEXPORT 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. - // - LIBBUTL_SYMEXPORT std::string - unquote (const std::string&); - - LIBBUTL_SYMEXPORT std::vector<std::string> - unquote (const std::vector<std::string>&); - } -} |