interface.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef CPR_INTERFACE_H
  2. #define CPR_INTERFACE_H
  3. #include <initializer_list>
  4. #include <string>
  5. #include "cpr/cprtypes.h"
  6. namespace cpr {
  7. class Interface : public StringHolder<Interface> {
  8. public:
  9. Interface() : StringHolder<Interface>() {}
  10. // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions)
  11. Interface(const std::string& iface) : StringHolder<Interface>(iface) {}
  12. // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions)
  13. Interface(std::string&& iface) : StringHolder<Interface>(std::move(iface)) {}
  14. // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions)
  15. Interface(std::string_view iface) : StringHolder<Interface>(iface) {}
  16. // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions)
  17. Interface(const char* iface) : StringHolder<Interface>(iface) {}
  18. Interface(const char* str, size_t len) : StringHolder<Interface>(str, len) {}
  19. Interface(const std::initializer_list<std::string> args) : StringHolder<Interface>(args) {}
  20. Interface(const Interface& other) = default;
  21. Interface(Interface&& old) noexcept = default;
  22. ~Interface() override = default;
  23. Interface& operator=(Interface&& old) noexcept = default;
  24. Interface& operator=(const Interface& other) = default;
  25. };
  26. } // namespace cpr
  27. #endif