nlib
NativePathMapper.h
Go to the documentation of this file.
1 
2 /*--------------------------------------------------------------------------------*
3  Project: CrossRoad
4  Copyright (C)Nintendo All rights reserved.
5 
6  These coded instructions, statements, and computer programs contain proprietary
7  information of Nintendo and/or its licensed developers and are protected by
8  national and international copyright laws. They may not be disclosed to third
9  parties or copied or duplicated in any form, in whole or in part, without the
10  prior written consent of Nintendo.
11 
12  The content herein is highly confidential and should be handled accordingly.
13  *--------------------------------------------------------------------------------*/
14 
15 #pragma once
16 #ifndef INCLUDE_NN_NLIB_NATIVEPATHMAPPER_H_
17 #define INCLUDE_NN_NLIB_NATIVEPATHMAPPER_H_
18 
19 #include "nn/nlib/Config.h"
20 #include "nn/nlib/Swap.h"
21 
22 NLIB_NAMESPACE_BEGIN
23 
25  public:
28  NLIB_DEFMOVE_PIMPL(NativePathMapper);
30  using std::swap;
31  swap(prv_, rhs.prv_);
32  }
33  void Reset() NLIB_NOEXCEPT;
34  errno_t AddMap(const char* native_prefix,
35  const char* uri_prefix) NLIB_NOEXCEPT;
36  errno_t ResolvePath(
37  size_t* count,
38  char* native,
39  size_t n,
40  const char* uri_path) const NLIB_NOEXCEPT;
41  template <size_t N>
43  size_t* count,
44  char (&native)[N],
45  const char* uri_path) const NLIB_NOEXCEPT {
46  return ResolvePath(count, native, N, uri_path);
47  }
48 
49  private:
50  struct NativePathMapperPrivate;
51  NativePathMapperPrivate* prv_;
53 };
54 
55 NLIB_NAMESPACE_END
56 #ifndef __cpp_rvalue_references
57 NLIB_DEFINE_STD_SWAP(::nlib_ns::NativePathMapper)
58 #endif
59 #endif // INCLUDE_NN_NLIB_NATIVEPATHMAPPER_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:179
constexpr NativePathMapper() noexcept
Instantiates the object.
#define NLIB_DEPRECATED
Indicates that a function or something has been deprecated.
Definition: Config.h:109
#define NLIB_VIS_PUBLIC
Symbols for functions and classes are made available outside of the library.
Definition: Platform_unix.h:89
~NativePathMapper() noexcept
Destructor.
The class for getting the native path string from the URI path notation that is not machine-dependent...
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
Definition: Config.h:105
#define NLIB_CEXPR
Defines constexpr if it is available for use. If not, holds an empty string.
Definition: Config.h:107
A file that contains the configuration information for each development environment.
errno_t ResolvePath(size_t *count, char(&native)[N], const char *uri_path) const noexcept
Returns ResolvePath(count, native, N, uri_path).
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
Definition: Config.h:245
int errno_t
Indicates with an int-type typedef that a POSIX error value is returned as the return value...
Definition: NMalloc.h:37