nlib
NativePathMapper.h
Go to the documentation of this file.
1 
2 #pragma once
3 #ifndef INCLUDE_NN_NLIB_NATIVEPATHMAPPER_H_
4 #define INCLUDE_NN_NLIB_NATIVEPATHMAPPER_H_
5 
6 #include "nn/nlib/Platform.h"
7 #include "nn/nlib/Nlist.h"
8 
9 NLIB_NAMESPACE_BEGIN
10 
12  public:
15  NLIB_VIS_PUBLIC errno_t AddMap(const char* nativePrefix, const char* uriPrefix) NLIB_NOEXCEPT;
16  NLIB_VIS_PUBLIC errno_t ResolvePath(size_t* count, char* native, size_t n,
17  const char* uriPath) const NLIB_NOEXCEPT;
18  template <size_t N>
19  errno_t ResolvePath(size_t* count, char (&native)[N],
20  const char* uriPath) const NLIB_NOEXCEPT {
21  return ResolvePath(count, native, N, uriPath);
22  }
23 
24  private:
25  struct ConvertMap {
26  char* uri_prefix;
27  size_t uri_prefix_len;
28  char* native_prefix;
29  };
30  Nlist<ConvertMap> m_Map;
31 
32  NLIB_DISALLOW_COPY_AND_ASSIGN(NativePathMapper);
33 };
34 
35 NLIB_NAMESPACE_END
36 
37 #endif // INCLUDE_NN_NLIB_NATIVEPATHMAPPER_H_
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
Definition: Platform.h:2151
#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:126
NativePathMapper() noexcept
Instantiates the object.
C-based declaration of the basic API.
Defines the class that resembles std::vector but can store objects that cannot be copied...
The class for getting the native path string from the URI path notation that is not machine-dependent...
#define NLIB_VIS_PUBLIC
Symbols for functions and classes are made available outside of the library.
Definition: Platform_unix.h:51
int errno_t
Indicates with an int-type typedef that a POSIX error value is returned as the return value...
Definition: NMalloc.h:24