Represents an escaped SQL name.
More...
#include <Name.hpp>
|
| Name (std::string name) |
| Constructs a properly quoted and escaped SQL name.
|
|
| Name (const char *name) |
| Constructs a properly quoted and escaped SQL name.
|
|
const std::string & | toString () const |
|
bool | isEmpty () const noexcept |
|
const std::string & | getUnescaped () const |
|
Represents an escaped SQL name.
Definition at line 18 of file Name.hpp.
◆ Name() [1/2]
hyperapi::Name::Name |
( |
std::string |
name | ) |
|
Constructs a properly quoted and escaped SQL name.
The name will be equal to the return value of calling hyperapi::escapeName(name).
- Parameters
-
- Precondition
- !name.empty()
◆ Name() [2/2]
hyperapi::Name::Name |
( |
const char * |
name | ) |
|
Constructs a properly quoted and escaped SQL name.
The name will be equal to the return value of calling hyperapi::escapeName(name).
- Parameters
-
- Precondition
- !name.empty()
-
name != nullptr
◆ getUnescaped()
const std::string & hyperapi::Name::getUnescaped |
( |
| ) |
const |
|
inline |
- Returns
- The original unescaped string that was passed to the
Name
constructor.
Do not use the result of this method in SQL, as it is prone to SQL injection. This method should be used for use-cases where the original name is more readable (e.g., logging).
Definition at line 52 of file Name.hpp.
◆ isEmpty()
bool hyperapi::Name::isEmpty |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- Whether the name is empty
Definition at line 44 of file Name.hpp.
◆ toString()
const std::string & hyperapi::Name::toString |
( |
| ) |
const |
|
inline |
- Returns
- Returns the properly quoted and escaped string representation of this name.
Definition at line 41 of file Name.hpp.
The documentation for this class was generated from the following file: