nlib
UriTemplate.h
Go to the documentation of this file.
1 
2 /*---------------------------------------------------------------------------*
3 
4  Project: CrossRoad
5  Copyright (C)2012-2016 Nintendo. All rights reserved.
6 
7  These coded instructions, statements, and computer programs contain
8  proprietary information of Nintendo of America Inc. and/or Nintendo
9  Company Ltd., and are protected by Federal copyright law. They may
10  not be disclosed to third parties or copied or duplicated in any form,
11  in whole or in part, without the prior written consent of Nintendo.
12 
13  *---------------------------------------------------------------------------*/
14 
15 #pragma once
16 #ifndef INCLUDE_NN_NLIB_URITEMPLATE_H_
17 #define INCLUDE_NN_NLIB_URITEMPLATE_H_
18 
19 #include "nn/nlib/Uri.h"
20 
21 NLIB_NAMESPACE_BEGIN
22 
23 class OutputStream;
24 
25 // See RFC6570: https://tools.ietf.org/html/rfc6570
27  public:
28  UriTemplate() NLIB_NOEXCEPT : prv_(NULL) {}
30  errno_t SetTemplate(const char* str) NLIB_NOEXCEPT;
31  errno_t SetParameter(const char* param, const char* value) NLIB_NOEXCEPT;
32  void ResetParameter() NLIB_NOEXCEPT;
33  errno_t Resolve(size_t* written, char* str, size_t n) const NLIB_NOEXCEPT;
34  template<size_t N>
35  errno_t Resolve(size_t* written, char (&str)[N]) const NLIB_NOEXCEPT {
36  return Resolve(written, str, N);
37  }
38 
39  private:
40  struct UriTemplatePrivate;
41  mutable UriTemplatePrivate* prv_;
43 };
44 
45 NLIB_NAMESPACE_END
46 
47 #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:158
#define NLIB_VIS_PUBLIC
Symbols for functions and classes are made available outside of the library.
Definition: Platform_unix.h:87
The class that supports URI Template (RFC 6570, Level 3).
Definition: UriTemplate.h:26
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
Definition: Config.h:99
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:35
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
Definition: Config.h:224
int errno_t
Indicates with an int-type typedef that a POSIX error value is returned as the return value...
Definition: NMalloc.h:37