nlib
UriTemplate.h
[詳解]
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)
TypeName で指定されたクラスのコピーコンストラクタと代入演算子を禁止します。
Definition: Config.h:158
#define NLIB_VIS_PUBLIC
関数やクラス等のシンボルをライブラリの外部に公開します。
Definition: Platform_unix.h:87
URI Template(RFC 6570, Level3)をサポートします。
Definition: UriTemplate.h:26
#define NLIB_NOEXCEPT
環境に合わせてnoexcept 又は同等の定義がされます。
Definition: Config.h:99
URIを扱うためのクラスを定義しています。
errno_t Resolve(size_t *written, char(&str)[N]) const noexcept
Resolve(written, str, N)を呼び出します。
Definition: UriTemplate.h:35
#define NLIB_FINAL
利用可能であればfinalが定義されます。そうでない場合は空文字列です。
Definition: Config.h:224
int errno_t
intのtypedefで、戻り値としてPOSIXのエラー値を返すことを示します。
Definition: NMalloc.h:37