File tree Expand file tree Collapse file tree 3 files changed +70
-0
lines changed
Expand file tree Collapse file tree 3 files changed +70
-0
lines changed Original file line number Diff line number Diff line change @@ -26,4 +26,10 @@ if (LIBSCRATCHCPP_NETWORK_SUPPORT)
2626 projectdownloader.cpp
2727 projectdownloader.h
2828 )
29+ else ()
30+ target_sources (scratchcpp
31+ PRIVATE
32+ projectdownloaderstub.cpp
33+ projectdownloaderstub.h
34+ )
2935endif ()
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: Apache-2.0
2+
3+ #include " projectdownloaderstub.h"
4+
5+ using namespace libscratchcpp ;
6+
7+ ProjectDownloaderStub::ProjectDownloaderStub ()
8+ {
9+ }
10+
11+ bool ProjectDownloaderStub::downloadJson (const std::string &)
12+ {
13+ return false ;
14+ }
15+
16+ bool ProjectDownloaderStub::downloadAssets (const std::vector<std::string> &)
17+ {
18+ return false ;
19+ }
20+
21+ void ProjectDownloaderStub::cancel ()
22+ {
23+ }
24+
25+ const std::string &ProjectDownloaderStub::json () const
26+ {
27+ static const std::string empty;
28+ return empty;
29+ }
30+
31+ const std::vector<std::string> &ProjectDownloaderStub::assets () const
32+ {
33+ static const std::vector<std::string> empty;
34+ return empty;
35+ }
36+
37+ unsigned int ProjectDownloaderStub::downloadedAssetCount () const
38+ {
39+ return 0 ;
40+ }
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: Apache-2.0
2+
3+ #pragma once
4+
5+ #include " iprojectdownloader.h"
6+
7+ namespace libscratchcpp
8+ {
9+
10+ class ProjectDownloaderStub : public IProjectDownloader
11+ {
12+ public:
13+ ProjectDownloaderStub ();
14+
15+ bool downloadJson (const std::string &) override ;
16+ bool downloadAssets (const std::vector<std::string> &) override ;
17+ void cancel () override ;
18+
19+ const std::string &json () const override ;
20+ const std::vector<std::string> &assets () const override ;
21+ unsigned int downloadedAssetCount () const override ;
22+ };
23+
24+ } // namespace libscratchcpp
You can’t perform that action at this time.
0 commit comments