Some update.

This commit is contained in:
ykiko
2024-11-21 12:31:31 +08:00
parent e1c9c70f54
commit 9d19ff164a
19 changed files with 419 additions and 330 deletions

View File

@@ -1,36 +0,0 @@
#pragma once
#include <string>
#include <Support/Error.h>
namespace clice {
class URI {
public:
URI(llvm::StringRef scheme, llvm::StringRef authority, llvm::StringRef path) :
m_scheme(scheme), m_authority(authority), m_body(path) {}
URI(const URI&) = default;
bool operator== (const URI&) const = default;
/// Returns decoded scheme e.g. "https"
llvm::StringRef scheme() const { return m_scheme; }
/// Returns decoded authority e.g. "reviews.lvm.org"
llvm::StringRef authority() const { return m_authority; }
/// Returns decoded body e.g. "/D41946"
llvm::StringRef body() const { return m_body; }
static llvm::Expected<URI> parse(llvm::StringRef content);
static std::string resolve(llvm::StringRef content);
private:
std::string m_scheme;
std::string m_authority;
std::string m_body;
};
} // namespace clice