summaryrefslogtreecommitdiff
path: root/src/buildtool/serve_api/remote/source_tree_client.cpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-06-12 11:45:15 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-06-18 12:05:10 +0200
commit0390e2d345eab7999d092f67a0937594048ca030 (patch)
tree2cb0876ac282237b7512db89100a6446f6d1b8c4 /src/buildtool/serve_api/remote/source_tree_client.cpp
parenta7bdda7bd9520238ca3a588a33fc75beeef3c488 (diff)
downloadjustbuild-0390e2d345eab7999d092f67a0937594048ca030.tar.gz
Mark ServeApi's services' methods contant.
Diffstat (limited to 'src/buildtool/serve_api/remote/source_tree_client.cpp')
-rw-r--r--src/buildtool/serve_api/remote/source_tree_client.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/buildtool/serve_api/remote/source_tree_client.cpp b/src/buildtool/serve_api/remote/source_tree_client.cpp
index b734dae8..2d011cab 100644
--- a/src/buildtool/serve_api/remote/source_tree_client.cpp
+++ b/src/buildtool/serve_api/remote/source_tree_client.cpp
@@ -65,7 +65,8 @@ SourceTreeClient::SourceTreeClient(std::string const& server,
auto SourceTreeClient::ServeCommitTree(std::string const& commit_id,
std::string const& subdir,
- bool sync_tree) noexcept -> result_t {
+ bool sync_tree) const noexcept
+ -> result_t {
justbuild::just_serve::ServeCommitTreeRequest request{};
request.set_commit(commit_id);
request.set_subdir(subdir);
@@ -96,7 +97,7 @@ auto SourceTreeClient::ServeArchiveTree(
std::string const& archive_type,
std::string const& subdir,
std::optional<PragmaSpecial> const& resolve_symlinks,
- bool sync_tree) noexcept -> result_t {
+ bool sync_tree) const noexcept -> result_t {
justbuild::just_serve::ServeArchiveTreeRequest request{};
request.set_content(content);
request.set_archive_type(StringToArchiveType(archive_type));
@@ -128,7 +129,7 @@ auto SourceTreeClient::ServeArchiveTree(
auto SourceTreeClient::ServeDistdirTree(
std::shared_ptr<std::unordered_map<std::string, std::string>> const&
distfiles,
- bool sync_tree) noexcept -> result_t {
+ bool sync_tree) const noexcept -> result_t {
justbuild::just_serve::ServeDistdirTreeRequest request{};
for (auto const& [k, v] : *distfiles) {
auto* distfile = request.add_distfiles();
@@ -160,7 +161,7 @@ auto SourceTreeClient::ServeDistdirTree(
auto SourceTreeClient::ServeForeignFileTree(const std::string& content,
const std::string& name,
- bool executable) noexcept
+ bool executable) const noexcept
-> result_t {
justbuild::just_serve::ServeDistdirTreeRequest request{};
auto* distfile = request.add_distfiles();
@@ -189,7 +190,7 @@ auto SourceTreeClient::ServeForeignFileTree(const std::string& content,
return response.tree(); // success
}
-auto SourceTreeClient::ServeContent(std::string const& content) noexcept
+auto SourceTreeClient::ServeContent(std::string const& content) const noexcept
-> bool {
justbuild::just_serve::ServeContentRequest request{};
request.set_content(content);
@@ -212,7 +213,8 @@ auto SourceTreeClient::ServeContent(std::string const& content) noexcept
return true;
}
-auto SourceTreeClient::ServeTree(std::string const& tree_id) noexcept -> bool {
+auto SourceTreeClient::ServeTree(std::string const& tree_id) const noexcept
+ -> bool {
justbuild::just_serve::ServeTreeRequest request{};
request.set_tree(tree_id);
@@ -233,7 +235,7 @@ auto SourceTreeClient::ServeTree(std::string const& tree_id) noexcept -> bool {
return true;
}
-auto SourceTreeClient::CheckRootTree(std::string const& tree_id) noexcept
+auto SourceTreeClient::CheckRootTree(std::string const& tree_id) const noexcept
-> std::optional<bool> {
justbuild::just_serve::CheckRootTreeRequest request{};
request.set_tree(tree_id);
@@ -260,7 +262,7 @@ auto SourceTreeClient::CheckRootTree(std::string const& tree_id) noexcept
return true; // tree found
}
-auto SourceTreeClient::GetRemoteTree(std::string const& tree_id) noexcept
+auto SourceTreeClient::GetRemoteTree(std::string const& tree_id) const noexcept
-> bool {
justbuild::just_serve::GetRemoteTreeRequest request{};
request.set_tree(tree_id);