Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions toolsrc/include/vcpkg/base/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace vcpkg::Parse
{
virtual ~IParseError() = default;
virtual std::string format() const = 0;
virtual const std::string& get_message() const = 0;
};

struct ParseError : IParseError
Expand All @@ -38,6 +39,7 @@ namespace vcpkg::Parse
const std::string message;

virtual std::string format() const override;
virtual const std::string& get_message() const override;
};

struct ParserBase
Expand Down
2 changes: 2 additions & 0 deletions toolsrc/src/vcpkg/base/parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ namespace vcpkg::Parse
"^\n");
}

const std::string& ParseError::get_message() const { return this->message; }

ParserBase::ParserBase(StringView text, StringView origin, TextRowCol init_rowcol)
: m_it(text.begin(), text.end())
, m_start_of_line(m_it)
Expand Down
1 change: 1 addition & 0 deletions toolsrc/src/vcpkg/binarycaching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,7 @@ ExpectedS<std::unique_ptr<IBinaryProvider>> vcpkg::create_binary_provider_from_c

BinaryConfigParser default_parser("default,readwrite", "<defaults>", &s);
default_parser.parse();
if (auto err = default_parser.get_error()) return err->get_message();

BinaryConfigParser env_parser(env_string, "VCPKG_BINARY_SOURCES", &s);
env_parser.parse();
Expand Down
13 changes: 7 additions & 6 deletions toolsrc/src/vcpkg/versiondeserializers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
using namespace vcpkg;
using namespace vcpkg::Versions;

static constexpr StringLiteral VERSION_RELAXED = "version";
static constexpr StringLiteral VERSION_SEMVER = "version-semver";
static constexpr StringLiteral VERSION_STRING = "version-string";
static constexpr StringLiteral VERSION_DATE = "version-date";
static constexpr StringLiteral PORT_VERSION = "port-version";

namespace
{
constexpr StringLiteral VERSION_RELAXED = "version";
constexpr StringLiteral VERSION_SEMVER = "version-semver";
constexpr StringLiteral VERSION_STRING = "version-string";
constexpr StringLiteral VERSION_DATE = "version-date";
constexpr StringLiteral PORT_VERSION = "port-version";
constexpr StringLiteral GIT_TREE = "git-tree";

struct VersionDeserializer final : Json::IDeserializer<std::string>
{
VersionDeserializer(StringLiteral type) : m_type(type) { }
Expand Down