Skip to content

Commit aecd764

Browse files
committed
merge linux change with codeplex
2 parents b4b0b6c + 58fff16 commit aecd764

File tree

236 files changed

+13610
-5563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+13610
-5563
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@
3232
*.exe
3333
*.manifest
3434
*.rc
35+
*~
3536
ipch/
3637
obj/
3738
*.resfiles
3839
[Bb]in
3940
Binaries/
40-
VS11.winrt/
41-
!*.vcxproj.*

Release/collateral/Samples/BingRequest/bingrequest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
2323
****/
2424

25-
#include <http_client.h>
26-
#include <filestream.h>
25+
#include <cpprest/http_client.h>
26+
#include <cpprest/filestream.h>
2727

2828
using namespace utility;
2929
using namespace web::http;

Release/collateral/Samples/SearchFile/searchfile.cpp

Lines changed: 113 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
2323
****/
2424

25-
#include <filestream.h>
26-
#include <containerstream.h>
27-
#include <producerconsumerstream.h>
25+
#include "cpprest/filestream.h"
26+
#include "cpprest/containerstream.h"
27+
#include "cpprest/producerconsumerstream.h"
2828

2929
using namespace utility;
3030
using namespace concurrency::streams;
@@ -34,30 +34,30 @@ using namespace concurrency::streams;
3434
/// </summary>
3535
pplx::task<bool> _do_while_iteration(std::function<pplx::task<bool>(void)> func)
3636
{
37-
pplx::task_completion_event<bool> ev;
38-
func().then([=](bool guard)
39-
{
40-
ev.set(guard);
41-
});
42-
return pplx::create_task(ev);
37+
pplx::task_completion_event<bool> ev;
38+
func().then([=](bool guard)
39+
{
40+
ev.set(guard);
41+
});
42+
return pplx::create_task(ev);
4343
}
4444
pplx::task<bool> _do_while_impl(std::function<pplx::task<bool>(void)> func)
4545
{
46-
return _do_while_iteration(func).then([=](bool guard) -> pplx::task<bool>
47-
{
48-
if(guard)
49-
{
50-
return ::_do_while_impl(func);
51-
}
52-
else
53-
{
54-
return pplx::task_from_result(false);
55-
}
56-
});
46+
return _do_while_iteration(func).then([=](bool guard) -> pplx::task<bool>
47+
{
48+
if(guard)
49+
{
50+
return ::_do_while_impl(func);
51+
}
52+
else
53+
{
54+
return pplx::task_from_result(false);
55+
}
56+
});
5757
}
5858
pplx::task<void> do_while(std::function<pplx::task<bool>(void)> func)
5959
{
60-
return _do_while_impl(func).then([](bool){});
60+
return _do_while_impl(func).then([](bool){});
6161
}
6262

6363
/// <summary>
@@ -77,21 +77,21 @@ class type_parser<CharType, matched_lines>
7777
basic_istream<CharType> in(buffer);
7878
auto lines = std::make_shared<matched_lines>();
7979
return do_while([=]()
80-
{
81-
container_buffer<std::string> line;
82-
return in.read_line(line).then([=](const size_t bytesRead)
83-
{
84-
if(bytesRead == 0 && in.is_eof())
85-
{
86-
return false;
87-
}
88-
else
89-
{
90-
lines->push_back(std::move(line.collection()));
91-
return true;
92-
}
93-
});
94-
}).then([=]()
80+
{
81+
container_buffer<std::string> line;
82+
return in.read_line(line).then([=](const size_t bytesRead)
83+
{
84+
if(bytesRead == 0 && in.is_eof())
85+
{
86+
return false;
87+
}
88+
else
89+
{
90+
lines->push_back(std::move(line.collection()));
91+
return true;
92+
}
93+
});
94+
}).then([=]()
9595
{
9696
return matched_lines(std::move(*lines));
9797
});
@@ -103,79 +103,79 @@ class type_parser<CharType, matched_lines>
103103
/// </summary>
104104
static pplx::task<void> find_matches_in_file(const string_t &fileName, const std::string &searchString, basic_ostream<char> results)
105105
{
106-
return file_stream<char>::open_istream(fileName).then([=](basic_istream<char> inFile)
107-
{
108-
auto lineNumber = std::make_shared<int>(1);
109-
return ::do_while([=]()
110-
{
111-
container_buffer<std::string> inLine;
112-
return inFile.read_line(inLine).then([=](size_t bytesRead)
113-
{
114-
if(bytesRead == 0 && inFile.is_eof())
115-
{
116-
return pplx::task_from_result(false);
117-
}
106+
return file_stream<char>::open_istream(fileName).then([=](basic_istream<char> inFile)
107+
{
108+
auto lineNumber = std::make_shared<int>(1);
109+
return ::do_while([=]()
110+
{
111+
container_buffer<std::string> inLine;
112+
return inFile.read_line(inLine).then([=](size_t bytesRead)
113+
{
114+
if(bytesRead == 0 && inFile.is_eof())
115+
{
116+
return pplx::task_from_result(false);
117+
}
118118

119-
else if(inLine.collection().find(searchString) != std::string::npos)
120-
{
121-
results.print("line ");
122-
results.print((*lineNumber)++);
123-
return results.print(":").then([=](size_t)
124-
{
125-
container_buffer<std::string> outLine(std::move(inLine.collection()));
126-
return results.write(outLine, outLine.collection().size());
127-
}).then([=](size_t)
128-
{
129-
return results.print("\r\n");
130-
}).then([=](size_t)
131-
{
132-
return true;
133-
});
134-
}
119+
else if(inLine.collection().find(searchString) != std::string::npos)
120+
{
121+
results.print("line ");
122+
results.print((*lineNumber)++);
123+
return results.print(":").then([=](size_t)
124+
{
125+
container_buffer<std::string> outLine(std::move(inLine.collection()));
126+
return results.write(outLine, outLine.collection().size());
127+
}).then([=](size_t)
128+
{
129+
return results.print("\r\n");
130+
}).then([=](size_t)
131+
{
132+
return true;
133+
});
134+
}
135135

136-
else
137-
{
138-
++(*lineNumber);
139-
return pplx::task_from_result(true);
140-
}
141-
});
142-
}).then([=]()
143-
{
144-
// Close the file and results stream.
145-
return inFile.close() && results.close();
146-
});
147-
});
136+
else
137+
{
138+
++(*lineNumber);
139+
return pplx::task_from_result(true);
140+
}
141+
});
142+
}).then([=]()
143+
{
144+
// Close the file and results stream.
145+
return inFile.close() && results.close();
146+
});
147+
});
148148
}
149149

150150
/// <summary>
151151
/// Function to write out results from matched_lines type to file
152152
/// </summary>
153153
static pplx::task<void> write_matches_to_file(const string_t &fileName, matched_lines results)
154154
{
155-
// Create a shared pointer to the matched_lines structure to copying repeatedly.
156-
auto sharedResults = std::make_shared<matched_lines>(std::move(results));
155+
// Create a shared pointer to the matched_lines structure to copying repeatedly.
156+
auto sharedResults = std::make_shared<matched_lines>(std::move(results));
157157

158158
return file_stream<char>::open_ostream(fileName, std::ios::trunc).then([=](basic_ostream<char> outFile)
159-
{
160-
auto currentIndex = std::make_shared<size_t>(0);
161-
return ::do_while([=]()
162-
{
163-
if(*currentIndex >= sharedResults->size())
164-
{
165-
return pplx::task_from_result(false);
166-
}
159+
{
160+
auto currentIndex = std::make_shared<size_t>(0);
161+
return ::do_while([=]()
162+
{
163+
if(*currentIndex >= sharedResults->size())
164+
{
165+
return pplx::task_from_result(false);
166+
}
167167

168-
container_buffer<std::string> lineData((*sharedResults)[(*currentIndex)++]);
169-
outFile.write(lineData, lineData.collection().size());
170-
return outFile.print("\r\n").then([](size_t)
171-
{
172-
return true;
173-
});
174-
}).then([=]()
175-
{
176-
return outFile.close();
177-
});
178-
});
168+
container_buffer<std::string> lineData((*sharedResults)[(*currentIndex)++]);
169+
outFile.write(lineData, lineData.collection().size());
170+
return outFile.print("\r\n").then([](size_t)
171+
{
172+
return true;
173+
});
174+
}).then([=]()
175+
{
176+
return outFile.close();
177+
});
178+
});
179179
}
180180

181181
#ifdef _MS_WINDOWS
@@ -193,26 +193,26 @@ int main(int argc, char *args[])
193193
const std::string searchString = utility::conversions::to_utf8string(args[2]);
194194
const string_t outFileName = args[3];
195195
producer_consumer_buffer<char> lineResultsBuffer;
196-
197-
// Find all matches in file.
198-
basic_ostream<char> outLineResults(lineResultsBuffer);
196+
197+
// Find all matches in file.
198+
basic_ostream<char> outLineResults(lineResultsBuffer);
199199
find_matches_in_file(inFileName, searchString, outLineResults)
200200

201-
// Write matches into custom data structure.
202-
.then([&]()
203-
{
204-
basic_istream<char> inLineResults(lineResultsBuffer);
205-
return inLineResults.extract<matched_lines>();
206-
})
201+
// Write matches into custom data structure.
202+
.then([&]()
203+
{
204+
basic_istream<char> inLineResults(lineResultsBuffer);
205+
return inLineResults.extract<matched_lines>();
206+
})
207207

208-
// Write out stored match data to a new file.
209-
.then([&](matched_lines lines)
210-
{
211-
return write_matches_to_file(outFileName, std::move(lines));
212-
})
208+
// Write out stored match data to a new file.
209+
.then([&](matched_lines lines)
210+
{
211+
return write_matches_to_file(outFileName, std::move(lines));
212+
})
213213

214-
// Wait for everything to complete.
215-
.wait();
214+
// Wait for everything to complete.
215+
.wait();
216216

217217
return 0;
218218
}

Release/collateral/Samples/WindowsLiveAuth/MainPage.xaml.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include "pch.h"
1919
#include "MainPage.xaml.h"
20-
#include <filestream.h>
20+
#include "cpprest/filestream.h"
2121

2222
using namespace WindowsLiveAuth;
2323

Release/collateral/Samples/WindowsLiveAuth/live_connect.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
#pragma once
2828

2929
#include <collection.h>
30-
#include <pplxtasks.h>
31-
#include <basic_types.h>
32-
#include <http_client.h>
33-
#include <streams.h>
34-
#include <filestream.h>
30+
#include "pplx/pplxtasks.h"
31+
#include "cpprest/basic_types.h"
32+
#include "cpprest/http_client.h"
33+
#include "cpprest/streams.h"
34+
#include "cpprest/filestream.h"
3535

3636
namespace web { namespace live {
3737

Release/collateral/Samples/WindowsLiveAuth/pch.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
#include <collection.h>
2121
#include "App.xaml.h"
2222
#include "MainPage.xaml.h"
23-
#include <pplxtasks.h>
24-
#include <basic_types.h>
23+
#include <pplx/pplxtasks.h>
24+
#include <cpprest/basic_types.h>
2525
#include "live_connect.h"

0 commit comments

Comments
 (0)