2018-06-19 17:51:20 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vcpkg/base/optional.h>
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace vcpkg
|
|
|
|
{
|
2018-06-19 17:52:20 -07:00
|
|
|
struct StringRange
|
2018-06-19 17:51:20 -07:00
|
|
|
{
|
2018-06-19 17:52:20 -07:00
|
|
|
static std::vector<StringRange> find_all_enclosed(const StringRange& input,
|
|
|
|
const std::string& left_delim,
|
|
|
|
const std::string& right_delim);
|
2018-06-19 17:51:20 -07:00
|
|
|
|
2018-06-19 17:52:20 -07:00
|
|
|
static StringRange find_exactly_one_enclosed(const StringRange& input,
|
|
|
|
const std::string& left_tag,
|
|
|
|
const std::string& right_tag);
|
2018-06-19 17:51:20 -07:00
|
|
|
|
2018-06-19 17:52:20 -07:00
|
|
|
static Optional<StringRange> find_at_most_one_enclosed(const StringRange& input,
|
|
|
|
const std::string& left_tag,
|
|
|
|
const std::string& right_tag);
|
2018-06-19 17:51:20 -07:00
|
|
|
|
2018-06-19 17:52:20 -07:00
|
|
|
StringRange() = default;
|
|
|
|
StringRange(const std::string& s); // Implicit by design
|
|
|
|
StringRange(const std::string::const_iterator begin, const std::string::const_iterator end);
|
2018-06-19 17:51:20 -07:00
|
|
|
|
|
|
|
std::string::const_iterator begin;
|
|
|
|
std::string::const_iterator end;
|
|
|
|
|
|
|
|
std::string to_string() const;
|
|
|
|
};
|
|
|
|
}
|