nlib
FileStyleUri.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_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)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
Definition: Config.h:158
The class for parsing URIs that use the file scheme and for constructing URI strings.
Definition: FileStyleUri.h:24
#define NLIB_VIS_HIDDEN
Symbols for functions and classes are not made available outside of the library.
Definition: Platform_unix.h:86
#define NLIB_VIS_PUBLIC
Symbols for functions and classes are made available outside of the library.
Definition: Platform_unix.h:87
bool ComposeString(char(&buf)[N]) const noexcept
Writes a URI string.
Definition: FileStyleUri.h:35
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
Definition: Config.h:99
A file that contains the configuration information for each development environment.
The class for parsing and constructing regular URIs.
Definition: Uri.h:30
Defines the class for handling URIs.
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
Definition: Config.h:224
#define NLIB_NONNULL
Indicates that you cannot specify NULL for all arguments.
FileStyleUri() noexcept
Instantiates the object with default parameters (default constructor). Initializes an object...
Definition: FileStyleUri.h:26