nlib
UriTemplate.h
Go to the documentation of this file.
1 
2 #pragma once
3 #ifndef INCLUDE_NN_NLIB_URITEMPLATE_H_
4 #define INCLUDE_NN_NLIB_URITEMPLATE_H_
5 
6 #include "nn/nlib/Uri.h"
7 
8 NLIB_NAMESPACE_BEGIN
9 
10 class OutputStream;
11 
12 // See RFC6570: https://tools.ietf.org/html/rfc6570
14  public:
15  UriTemplate() NLIB_NOEXCEPT : prv_(NULL) {}
17  errno_t SetTemplate(const char* str) NLIB_NOEXCEPT;
18  errno_t SetParameter(const char* param, const char* value) NLIB_NOEXCEPT;
19  void ResetParameter() NLIB_NOEXCEPT;
20  errno_t Resolve(size_t* written, char* str, size_t n) const NLIB_NOEXCEPT;
21  template<size_t N>
22  errno_t Resolve(size_t* written, char (&str)[N]) const NLIB_NOEXCEPT {
23  return Resolve(written, str, N);
24  }
25 
26  private:
27  struct UriTemplatePrivate;
28  mutable UriTemplatePrivate* prv_;
30 };
31 
32 NLIB_NAMESPACE_END
33 
34 #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...
Definition: Config.h:145
#define NLIB_VIS_PUBLIC
Symbols for functions and classes are made available outside of the library.
Definition: Platform_unix.h:61
The class that supports URI Template (RFC 6570, Level 3).
Definition: UriTemplate.h:13
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
Definition: Config.h:86
Defines the class for handling URIs.
errno_t Resolve(size_t *written, char(&str)[N]) const noexcept
Calls Resolve(written, str, N).
Definition: UriTemplate.h:22
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
Definition: Config.h:211
int errno_t
Indicates with an int-type typedef that a POSIX error value is returned as the return value...
Definition: NMalloc.h:24