1
1
#include " pch.h"
2
2
#include " RNFetchBlob.h"
3
- #include < windows .h>
3
+ #include < winrt/Windows.ApplicationModel.Activation .h>
4
4
#include < winrt/Windows.Security.Cryptography.h>
5
5
#include < winrt/Windows.Security.Cryptography.Core.h>
6
6
#include < winrt/Windows.Storage.FileProperties.h>
7
7
#include < winrt/Windows.Storage.Streams.h>
8
8
#include < winrt/Windows.Storage.h>
9
-
10
9
#include < winrt/Windows.Web.Http.h>
11
10
#include < winrt/Windows.Web.Http.Headers.h>
12
11
#include < winrt/windows.web.http.filters.h>
13
-
14
12
#include < filesystem>
15
13
#include < sstream>
16
14
@@ -21,8 +19,6 @@ using namespace winrt::Windows::Storage::Streams;
21
19
using namespace winrt ::Windows::Foundation;
22
20
using namespace winrt ::Windows::Security::Cryptography;
23
21
using namespace winrt ::Windows::Security::Cryptography::Core;
24
-
25
-
26
22
using namespace std ::chrono_literals;
27
23
28
24
CancellationDisposable::CancellationDisposable (IAsyncInfo const & async, std::function<void ()>&& onCancel) noexcept
@@ -260,11 +256,11 @@ winrt::fire_and_forget RNFetchBlob::createFileASCII(
260
256
winrt::Microsoft::ReactNative::ReactPromise<std::string> promise) noexcept
261
257
try
262
258
{
263
- std::vector<byte > data;
259
+ std::vector<uint8_t > data;
264
260
data.reserve (dataArray.size ());
265
261
for (auto & var : dataArray)
266
262
{
267
- data.push_back (var.AsInt8 ());
263
+ data.push_back (var.AsUInt8 ());
268
264
}
269
265
270
266
Streams::IBuffer buffer{ CryptographicBuffer::CreateFromByteArray (data) };
@@ -369,11 +365,11 @@ winrt::fire_and_forget RNFetchBlob::writeFileArray(
369
365
winrt::Microsoft::ReactNative::ReactPromise<int > promise) noexcept
370
366
try
371
367
{
372
- std::vector<byte > data;
368
+ std::vector<uint8_t > data;
373
369
data.reserve (dataArray.size ());
374
370
for (auto & var : dataArray)
375
371
{
376
- data.push_back (var.AsInt8 ());
372
+ data.push_back (var.AsUInt8 ());
377
373
}
378
374
Streams::IBuffer buffer{ CryptographicBuffer::CreateFromByteArray (data) };
379
375
@@ -497,11 +493,11 @@ void RNFetchBlob::writeArrayChunk(
497
493
try
498
494
{
499
495
auto stream{ m_streamMap.find (streamId)->second };
500
- std::vector<byte > data;
496
+ std::vector<uint8_t > data;
501
497
data.reserve (dataArray.size ());
502
498
for (auto & var : dataArray)
503
499
{
504
- data.push_back (var.AsInt8 ());
500
+ data.push_back (var.AsUInt8 ());
505
501
}
506
502
Streams::IBuffer buffer{ CryptographicBuffer::CreateFromByteArray (data) };
507
503
0 commit comments