| 1 | /*++ |
| 2 | |
| 3 | Copyright (c) Microsoft. All rights reserved. |
| 4 | |
| 5 | Module Name: |
| 6 | |
| 7 | ImageProgress.cpp |
| 8 | |
| 9 | Abstract: |
| 10 | |
| 11 | This file contains the implementation of the WinRT wrapper for the WSLC SDK ImageProgress class. |
| 12 | |
| 13 | --*/ |
| 14 | |
| 15 | #include "precomp.h" |
| 16 | #include "ImageProgress.h" |
| 17 | #include "Microsoft.WSL.Containers.ImageProgress.g.cpp" |
| 18 | |
| 19 | namespace winrt::Microsoft::WSL::Containers::implementation { |
| 20 | ImageProgress::ImageProgress(const WslcImageProgressMessage* progress) : |
| 21 | m_id(winrt::to_hstring(progress->id)), |
| 22 | m_status(static_cast<ImageProgressStatus>(progress->status)), |
| 23 | m_currentBytes(progress->detail.currentBytes), |
| 24 | m_totalBytes(progress->detail.totalBytes) |
| 25 | { |
| 26 | } |
| 27 | |
| 28 | hstring ImageProgress::Id() |
| 29 | { |
| 30 | return m_id; |
| 31 | } |
| 32 | |
| 33 | void ImageProgress::Id(hstring const& value) |
| 34 | { |
| 35 | m_id = value; |
| 36 | } |
| 37 | |
| 38 | winrt::Microsoft::WSL::Containers::ImageProgressStatus ImageProgress::Status() |
| 39 | { |
| 40 | return m_status; |
| 41 | } |
| 42 | |
| 43 | void ImageProgress::Status(winrt::Microsoft::WSL::Containers::ImageProgressStatus const& value) |
| 44 | { |
| 45 | m_status = value; |
| 46 | } |
| 47 | |
| 48 | uint64_t ImageProgress::CurrentBytes() |
| 49 | { |
| 50 | return m_currentBytes; |
| 51 | } |
| 52 | |
| 53 | void ImageProgress::CurrentBytes(uint64_t value) |
| 54 | { |
| 55 | m_currentBytes = value; |
| 56 | } |
| 57 | |
| 58 | uint64_t ImageProgress::TotalBytes() |
| 59 | { |
| 60 | return m_totalBytes; |
| 61 | } |
| 62 | |
| 63 | void ImageProgress::TotalBytes(uint64_t value) |
| 64 | { |
| 65 | m_totalBytes = value; |
| 66 | } |
| 67 | } // namespace winrt::Microsoft::WSL::Containers::implementation |