sdlWinRtGetFsPathUtf8 function

String? sdlWinRtGetFsPathUtf8(
  1. int pathType
)

Retrieve a WinRT defined path on the local file system.

Not all paths are available on all versions of Windows. This is especially true on Windows Phone. Check the documentation for the given SDL_WinRT_Path for more information on which path types are supported where.

Documentation on most app-specific path types on WinRT can be found on MSDN, at the URL:

https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx

\param pathType the type of path to retrieve, one of SDL_WinRT_Path \returns a UTF-8 string (8-bit, multi-byte) containing the path, or NULL if the path is not available for any reason; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.3.

\sa SDL_WinRTGetFSPathUNICODE

extern DECLSPEC const char * SDLCALL SDL_WinRTGetFSPathUTF8(SDL_WinRT_Path pathType)

Implementation

String? sdlWinRtGetFsPathUtf8(int pathType) {
  final sdlWinRtGetFsPathUtf8LookupFunction = libSdl2.lookupFunction<
      Pointer<Utf8> Function(Int32 pathType),
      Pointer<Utf8> Function(int pathType)>('SDL_WinRTGetFSPathUTF8');
  final result = sdlWinRtGetFsPathUtf8LookupFunction(pathType);
  if (result == nullptr) {
    return null;
  }
  return result.toDartString();
}