nlib
FileStyleUri.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_FILESTYLEURI_H_
17 #define INCLUDE_NN_NLIB_FILESTYLEURI_H_
18 
19 #include "nn/nlib/Config.h"
20 #include "nn/nlib/Uri.h"
21 
22 NLIB_NAMESPACE_BEGIN
23 
25  public:
26  FileStyleUri() NLIB_NOEXCEPT : prv_(NULL) {}
28  bool FromUri(const Uri& uri) NLIB_NOEXCEPT;
29  bool ToUri(Uri* uri) const NLIB_NOEXCEPT NLIB_NONNULL;
30  bool Parse(const char* str) NLIB_NOEXCEPT NLIB_NONNULL;
31  bool ComposeString(
32  char* buf,
33  size_t size) const NLIB_NOEXCEPT NLIB_NONNULL;
34  template <size_t N>
36  char (&buf)[N]) const NLIB_NOEXCEPT {
37  return this->ComposeString(buf, N);
38  }
39  bool SetPath(const char* path) NLIB_NOEXCEPT;
40  size_t GetNumSegment() const NLIB_NOEXCEPT;
41  const char* GetSegment(size_t i) const NLIB_NOEXCEPT;
42  bool AddBaseUri(const Uri& relative, const FileStyleUri& base) NLIB_NOEXCEPT;
43  void Reset() NLIB_NOEXCEPT;
44  bool IsPathDirectory() const NLIB_NOEXCEPT;
45 
46  private:
47  NLIB_VIS_HIDDEN bool CheckInit() const NLIB_NOEXCEPT;
48  struct FileStyleUriPrivate;
49  mutable FileStyleUriPrivate* prv_;
51 };
52 
53 NLIB_NAMESPACE_END
54 
55 #endif // INCLUDE_NN_NLIB_FILESTYLEURI_H_
#define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
TypeName で指定されたクラスのコピーコンストラクタと代入演算子を禁止します。
Definition: Config.h:158
fileスキームを用いたURIをパースしたりURI文字列を構築したりするためのクラスです。
Definition: FileStyleUri.h:24
#define NLIB_VIS_HIDDEN
関数やクラス等のシンボルをライブラリの外部に公開しません。
Definition: Platform_unix.h:86
#define NLIB_VIS_PUBLIC
関数やクラス等のシンボルをライブラリの外部に公開します。
Definition: Platform_unix.h:87
bool ComposeString(char(&buf)[N]) const noexcept
URI文字列を書き出します。
Definition: FileStyleUri.h:35
#define NLIB_NOEXCEPT
環境に合わせてnoexcept 又は同等の定義がされます。
Definition: Config.h:99
開発環境別の設定が書かれるファイルです。
一般的なURIをパースしたり構築したりするためのクラスです。
Definition: Uri.h:30
URIを扱うためのクラスを定義しています。
#define NLIB_FINAL
利用可能であればfinalが定義されます。そうでない場合は空文字列です。
Definition: Config.h:224
#define NLIB_NONNULL
全ての引数にNULLを指定することができないことを示します。
FileStyleUri() noexcept
デフォルトコンストラクタです。オブジェクトを初期化します。
Definition: FileStyleUri.h:26