url_builder.h 546 B

1234567891011121314151617181920212223242526
  1. #pragma once
  2. #include <vector>
  3. #include <util/string/builder.h>
  4. namespace NYql {
  5. class TUrlBuilder {
  6. struct TParam {
  7. TString Name;
  8. TString Value;
  9. };
  10. public:
  11. explicit TUrlBuilder(const TString& uri);
  12. // Assuming name is already escaped, do not use strings from user input
  13. TUrlBuilder& AddUrlParam(const TString& name, const TString& value = "");
  14. TUrlBuilder& AddPathComponent(const TString& value);
  15. TString Build() const;
  16. private:
  17. std::vector<TParam> Params;
  18. TString MainUri;
  19. };
  20. } // NYql