ContentId.h (1108B)
1 // Copyright (c) Microsoft Corporation. 2 // Licensed under the MIT License. 3 4 #pragma once 5 6 #include "Result.h" 7 8 #include <memory> 9 #include <string> 10 11 namespace SFS 12 { 13 class ContentId 14 { 15 public: 16 [[nodiscard]] static Result Make(std::string nameSpace, 17 std::string name, 18 std::string version, 19 std::unique_ptr<ContentId>& out) noexcept; 20 21 ContentId(ContentId&&) noexcept; 22 23 ContentId(const ContentId&) = delete; 24 ContentId& operator=(const ContentId&) = delete; 25 26 /** 27 * @return Content namespace 28 */ 29 const std::string& GetNameSpace() const noexcept; 30 31 /** 32 * @return Content name 33 */ 34 const std::string& GetName() const noexcept; 35 36 /** 37 * @return 4-part integer version. Each part can range from 0-65535 38 */ 39 const std::string& GetVersion() const noexcept; 40 41 private: 42 ContentId() = default; 43 44 std::string m_nameSpace; 45 std::string m_name; 46 std::string m_version; 47 }; 48 } // namespace SFS