CMake Nightly Date Stamp
[kiteware-cmake.git] / Source / cmPathLabel.h
blobd19d2be24a2f0ecd1e9af35d23a7354438ceba4d
1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
3 #pragma once
5 #include "cmConfigure.h" // IWYU pragma: keep
7 #include <string>
9 /** \class cmPathLabel
10 * \brief Helper class for text based labels
12 * cmPathLabel is extended in different classes to act as an inheritable
13 * enum. Comparisons are done on a precomputed Jenkins hash of the string
14 * label for indexing and searchig.
16 class cmPathLabel
18 public:
19 cmPathLabel(std::string label);
21 // The comparison operators are only for quick sorting and searching and
22 // in no way imply any lexicographical order of the label
23 bool operator<(const cmPathLabel& l) const;
24 bool operator==(const cmPathLabel& l) const;
26 const std::string& GetLabel() const { return this->Label; }
27 const unsigned int& GetHash() const { return this->Hash; }
29 protected:
30 cmPathLabel();
32 std::string Label;
33 unsigned int Hash;