| 294 | } |
| 295 | |
| 296 | std::wstring UWP::Current::Storage::GetLocalPath() |
| 297 | { |
| 298 | ComPtr<ABI::Windows::Storage::IApplicationData> AppData = GetIApplicationData(); |
| 299 | |
| 300 | ComPtr<ABI::Windows::Storage::IStorageFolder> LocalStateFolder; |
| 301 | |
| 302 | if( AppData->get_LocalFolder(&LocalStateFolder) < 0 ) |
| 303 | { |
| 304 | // Failed to get folder |
| 305 | return L""; |
| 306 | } |
| 307 | |
| 308 | ComPtr<ABI::Windows::Storage::IStorageItem> FolderItem; |
| 309 | if( LocalStateFolder.As(&FolderItem) < 0 ) |
| 310 | { |
| 311 | // Failed to cast to IStorageItem |
| 312 | return L""; |
| 313 | } |
| 314 | |
| 315 | HString LocalPathString; |
| 316 | |
| 317 | if( FolderItem->get_Path(LocalPathString.GetAddressOf()) < 0 ) |
| 318 | { |
| 319 | // Failed to get path as string |
| 320 | return L""; |
| 321 | } |
| 322 | |
| 323 | std::uint32_t PathLength; |
| 324 | const wchar_t* LocalPathRaw = LocalPathString.GetRawBuffer(&PathLength); |
| 325 | return std::wstring(LocalPathRaw, PathLength); |
| 326 | } |
| 327 | |
| 328 | std::wstring UWP::Current::Storage::GetRoamingPath() |
| 329 | { |
nothing calls this directly
no test coverage detected