16 #ifndef INCLUDE_NN_NLIB_URITEMPLATE_H_ 17 #define INCLUDE_NN_NLIB_URITEMPLATE_H_ 22 #include "nn/nlib/Swap.h" 31 static bool IsUriTemplate(
const char* first,
const char* last)
NLIB_NOEXCEPT;
52 return Resolve(written, str, N);
54 std::pair<errno_t, size_t> Resolve(
char* str,
size_t n)
const NLIB_NOEXCEPT {
56 errno_t e = Resolve(&written, str, n);
57 return std::make_pair(e, written);
60 std::pair<errno_t, size_t> Resolve(
char (&str)[N])
const NLIB_NOEXCEPT {
62 errno_t e = Resolve(&written, str, N);
63 return std::make_pair(e, written);
67 struct UriTemplatePrivate;
68 mutable UriTemplatePrivate* prv_;
73 #ifndef __cpp_rvalue_references 76 #endif // INCLUDE_NN_NLIB_URITEMPLATE_H_ #define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
errno_t SetTemplate(const char *str) noexcept
Returns SetTemplate(str, nlib_strlen(str)).
The class that supports URI Template (RFC 6570, Level 3).
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
#define NLIB_CEXPR
Defines constexpr if it is available for use. If not, holds an empty string.
Defines the class for handling URIs.
errno_t Resolve(size_t *written, char(&str)[N]) const noexcept
Calls Resolve(written, str, N).
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
static bool IsUriTemplate(const char *str) noexcept
Returns IsUriTemplate(str, str + strlen(str)).