forked from npshub/mantid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UserCatalogInfo.cpp
48 lines (36 loc) · 1.67 KB
/
UserCatalogInfo.cpp
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
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidKernel/UserCatalogInfo.h"
namespace Mantid::Kernel {
UserCatalogInfo::UserCatalogInfo(const ICatalogInfo &catInfo, const CatalogConfigService &catalogConfigService)
: m_catInfo(catInfo.clone()), m_mountPoint(catalogConfigService.preferredMountPoint()) {}
UserCatalogInfo::UserCatalogInfo(const UserCatalogInfo &other)
: m_catInfo(other.m_catInfo->clone()), m_mountPoint(other.m_mountPoint) {}
const std::string UserCatalogInfo::catalogName() const { return m_catInfo->catalogName(); }
const std::string UserCatalogInfo::soapEndPoint() const { return m_catInfo->soapEndPoint(); }
const std::string UserCatalogInfo::externalDownloadURL() const { return m_catInfo->externalDownloadURL(); }
const std::string UserCatalogInfo::catalogPrefix() const { return m_catInfo->catalogPrefix(); }
const std::string UserCatalogInfo::windowsPrefix() const {
if (m_mountPoint) {
return m_mountPoint.get();
}
return m_catInfo->windowsPrefix();
}
const std::string UserCatalogInfo::macPrefix() const {
if (m_mountPoint) {
return m_mountPoint.get();
}
return m_catInfo->macPrefix();
}
const std::string UserCatalogInfo::linuxPrefix() const {
if (m_mountPoint) {
return m_mountPoint.get();
}
return m_catInfo->linuxPrefix();
}
UserCatalogInfo *UserCatalogInfo::clone() const { return new UserCatalogInfo(*this); }
} // namespace Mantid::Kernel