-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBCLFileReference.hpp
52 lines (38 loc) · 1.44 KB
/
BCLFileReference.hpp
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
50
51
52
#ifndef UTILITIES_BCL_BCLFILEREFERENCE_HPP
#define UTILITIES_BCL_BCLFILEREFERENCE_HPP
#include <boost/filesystem.hpp>
#include <boost/optional.hpp>
#include <compare>
#include <string>
namespace fs = boost::filesystem;
namespace openstudio {
/** BCLFileReference is a class for tracking files that come with BCL components and measures.
**/
class BCLFileReference
{
public:
/** @name Constructors */
//@{
/// Constructor from file path.
explicit BCLFileReference(const fs::path& measureRootDir, const fs::path& relativePath);
friend bool operator==(const BCLFileReference& lhs, const BCLFileReference& rhs);
friend std::strong_ordering operator<=>(const BCLFileReference& lhs, const BCLFileReference& rhs);
// friend std::strong_ordering operator<=>(const BCLFileReference& lhs, const BCLFileReference& rhs);
/// Returns absolute path to file.
fs::path path() const;
// Returns path to file, relative to measure root directory (including subdirectory, eg 'docs/subfolder/docs.rb')
fs::path relativePath() const;
private:
fs::path m_measureRootDir;
fs::path m_path;
std::string m_checksum;
std::string m_softwareProgram;
std::string m_softwareProgramVersion;
boost::optional<std::string> m_minCompatibleVersion;
boost::optional<std::string> m_maxCompatibleVersion;
std::string m_fileName;
std::string m_fileType;
std::string m_usageType;
};
} // namespace openstudio
#endif // UTILITIES_BCL_BCLFILEREFERENCE_HPP