forked from microsoft/winget-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContentId.cpp
More file actions
49 lines (38 loc) · 1.09 KB
/
Copy pathContentId.cpp
File metadata and controls
49 lines (38 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#include "ContentId.h"
#include "details/ErrorHandling.h"
using namespace SFS;
Result ContentId::Make(std::string nameSpace,
std::string name,
std::string version,
std::unique_ptr<ContentId>& out) noexcept
try
{
out.reset();
std::unique_ptr<ContentId> tmp(new ContentId());
tmp->m_nameSpace = std::move(nameSpace);
tmp->m_name = std::move(name);
tmp->m_version = std::move(version);
out = std::move(tmp);
return Result::Success;
}
SFS_CATCH_RETURN()
ContentId::ContentId(ContentId&& other) noexcept
{
m_nameSpace = std::move(other.m_nameSpace);
m_name = std::move(other.m_name);
m_version = std::move(other.m_version);
}
const std::string& ContentId::GetNameSpace() const noexcept
{
return m_nameSpace;
}
const std::string& ContentId::GetName() const noexcept
{
return m_name;
}
const std::string& ContentId::GetVersion() const noexcept
{
return m_version;
}