Hyper API for C++ 0.0.24081
Hyper client library for C++ applications
Loading...
Searching...
No Matches
Name.hpp
Go to the documentation of this file.
1
5#ifndef TABLEAU_HYPER_NAME_HPP
6#define TABLEAU_HYPER_NAME_HPP
7
8#include <string>
9
10namespace hyperapi {
11
15class Name final {
16 private:
18 std::string name_;
20 std::string unescaped_;
21
22 public:
29 Name(std::string name);
30
35 Name(const char* name);
36
38 const std::string& toString() const { return name_; }
39
41 bool isEmpty() const noexcept { return name_.empty(); }
42
49 const std::string& getUnescaped() const { return unescaped_; }
50};
51
53inline std::ostream& operator<<(std::ostream& os, const Name& name) { return os << name.toString(); }
54
56inline bool operator<(const Name& a, const Name& b) noexcept { return a.getUnescaped() < b.getUnescaped(); }
58inline bool operator==(const Name& a, const Name& b) noexcept { return a.getUnescaped() == b.getUnescaped(); }
60inline bool operator>(const Name& a, const Name& b) noexcept { return b < a; }
62inline bool operator!=(const Name& a, const Name& b) noexcept { return !(a == b); }
64inline bool operator<=(const Name& a, const Name& b) noexcept { return !(a > b); }
66inline bool operator>=(const Name& a, const Name& b) noexcept { return !(a < b); }
67}
68
69#include <hyperapi/impl/Name.impl.hpp> // IWYU pragma: export
70
71#endif
Represents an escaped SQL name.
Definition Name.hpp:15
Name(std::string name)
Constructs a properly quoted and escaped SQL name.
const std::string & toString() const
Definition Name.hpp:38
bool isEmpty() const noexcept
Definition Name.hpp:41
Name(const char *name)
Constructs a properly quoted and escaped SQL name.
const std::string & getUnescaped() const
Definition Name.hpp:49
The primary namespace of the Hyper API for C++.
Definition ByteSpan.hpp:14
bool operator<(const DatabaseName &a, const DatabaseName &b) noexcept
Smaller operator.
bool operator==(const DatabaseName &a, const DatabaseName &b) noexcept
Equality operator.
bool operator>(const DatabaseName &a, const DatabaseName &b) noexcept
Greater operator.
bool operator!=(const DatabaseName &a, const DatabaseName &b) noexcept
Not equal operator.
bool operator>=(const DatabaseName &a, const DatabaseName &b) noexcept
Greater or equal operator.
std::ostream & operator<<(std::ostream &os, const DatabaseName &name)
Stream output operator.
bool operator<=(const DatabaseName &a, const DatabaseName &b) noexcept
Smaller or equal operator.