C++ Client-Side SDK
LaunchDarkly SDK
app_info_builder.hpp
1 #pragma once
2 
3 #include <optional>
4 #include <string>
5 #include <vector>
6 
7 #include <launchdarkly/error.hpp>
8 
9 #include "tl/expected.hpp"
10 
11 namespace launchdarkly::config::shared::builders {
12 
14  public:
15  AppInfoBuilder() = default;
16  AppInfoBuilder& Identifier(std::string app_id);
17  AppInfoBuilder& Version(std::string version);
18  [[nodiscard]] std::optional<std::string> Build() const;
19 
20  private:
21  struct Tag {
22  std::string key;
23  std::string value;
24  std::optional<Error> error;
25  Tag(std::string key, std::string value);
26  [[nodiscard]] tl::expected<std::string, Error> Build() const;
27  };
28  std::vector<Tag> tags_;
29  AppInfoBuilder& AddTag(std::string key, std::string value);
30 };
31 
32 bool ValidChar(char c);
33 std::optional<Error> IsValidTag(std::string const& key,
34  std::string const& value);
35 
36 } // namespace launchdarkly::config::shared::builders