9 #include <stk_util/util/Identifier.hpp> 20 const size_t s1_length,
22 const size_t s2_length)
24 const size_t length = std::min(s1_length, s2_length);
27 result = s1_length - s2_length;
37 const size_t s1_length,
39 const size_t s2_length)
41 const size_t length = std::min(s1_length, s2_length);
44 result = s1_length - s2_length;
49 IdentifierA operator+(
const IdentifierA &identifier1,
const IdentifierA &identifier2) {
50 IdentifierA identifier(identifier1);
52 return identifier += identifier2;
55 IdentifierA operator+(
const IdentifierA &identifier1,
const std::string &string2) {
56 IdentifierA identifier(identifier1);
58 return identifier += IdentifierA(string2);
61 std::string operator+(
const std::string &string1,
const IdentifierA &identifier2) {
62 std::string
string(string1);
64 return string += identifier2;
67 std::ostream &
operator<<(std::ostream &os,
const IdentifierA &identifier) {
68 return os << identifier.c_str();
71 std::istream &operator>>(std::istream &is, IdentifierA &identifier) {
80 bool operator<(
const std::string &s1,
const IdentifierA &s2) {
81 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) < 0;
84 bool operator<(
const IdentifierA &s1,
const std::string &s2) {
85 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) < 0;
88 bool operator<(
const IdentifierA &s1,
const char *s2) {
89 return compare(s1.c_str(), s1.length(), s2, std::strlen(s2)) < 0;
92 bool operator<(
const IdentifierA &s1,
const IdentifierA &s2) {
93 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) < 0;
96 bool operator==(
const std::string &s1,
const IdentifierA &s2) {
97 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) == 0;
100 bool operator==(
const IdentifierA &s1,
const std::string &s2) {
101 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) == 0;
104 bool operator==(
const IdentifierA &s1,
const char *s2) {
105 return compare(s1.c_str(), s1.length(), s2, std::strlen(s2)) == 0;
108 bool operator==(
const IdentifierA &s1,
const IdentifierA &s2) {
109 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) == 0;
112 bool operator<=(
const std::string &s1,
const IdentifierA &s2) {
113 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) <= 0;
116 bool operator<=(
const IdentifierA &s1,
const std::string &s2) {
117 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) <= 0;
120 bool operator<=(
const IdentifierA &s1,
const char *s2) {
121 return compare(s1.c_str(), s1.length(), s2, std::strlen(s2)) <= 0;
124 bool operator<=(
const IdentifierA &s1,
const IdentifierA &s2) {
125 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) <= 0;
128 bool operator>(
const std::string &s1,
const IdentifierA &s2) {
129 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) > 0;
132 bool operator>(
const IdentifierA &s1,
const std::string &s2) {
133 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) > 0;
136 bool operator>(
const IdentifierA &s1,
const char *s2) {
137 return compare(s1.c_str(), s1.length(), s2, std::strlen(s2)) > 0;
140 bool operator>(
const IdentifierA &s1,
const IdentifierA &s2) {
141 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) > 0;
144 bool operator>=(
const std::string &s1,
const IdentifierA &s2) {
145 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) >= 0;
148 bool operator>=(
const IdentifierA &s1,
const std::string &s2) {
149 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) >= 0;
152 bool operator>=(
const IdentifierA &s1,
const char *s2) {
153 return compare(s1.c_str(), s1.length(), s2, std::strlen(s2)) >= 0;
156 bool operator>=(
const IdentifierA &s1,
const IdentifierA &s2) {
157 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) >= 0;
160 bool operator!=(
const std::string &s1,
const IdentifierA &s2) {
161 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) != 0;
164 bool operator!=(
const IdentifierA &s1,
const std::string &s2) {
165 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) != 0;
168 bool operator!=(
const IdentifierA &s1,
const char *s2) {
169 return compare(s1.c_str(), s1.length(), s2, std::strlen(s2)) != 0;
172 bool operator!=(
const IdentifierA &s1,
const IdentifierA &s2) {
173 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) != 0;
179 IdentifierB::compare(
181 const size_t s1_length,
183 const size_t s2_length)
185 const size_t length = std::min(s1_length, s2_length);
188 result = s1_length - s2_length;
193 std::ostream &
operator<<(std::ostream &os,
const IdentifierB &identifier) {
194 return os << identifier.c_str();
197 std::istream &operator>>(std::istream &is, IdentifierB &identifier) {
206 IdentifierB operator+(
const IdentifierB &identifier1,
const IdentifierB &identifier2) {
207 std::string identifier(identifier1);
209 return IdentifierB(identifier += identifier2);
212 IdentifierB operator+(
const IdentifierB &identifier1,
const std::string &string2) {
213 std::string identifier(identifier1);
215 return IdentifierB(identifier += string2);
218 IdentifierB operator+(
const IdentifierB &identifier1,
const char *string2) {
219 IdentifierB identifier(identifier1);
221 return IdentifierB(identifier += string2);
224 std::string operator+(
const std::string &string1,
const IdentifierB &identifier2) {
225 std::string
string(string1);
227 return string += identifier2;
230 bool operator<(
const IdentifierB &s1,
const std::string &s2) {
231 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) < 0;
234 bool operator<(
const IdentifierB &s1,
const char *s2) {
235 return compare(s1.c_str(), s1.length(), s2, std::strlen(s2)) < 0;
238 bool operator<(
const IdentifierB &s1,
const IdentifierB &s2) {
239 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) < 0;
242 bool operator==(
const std::string &s1,
const IdentifierB &s2) {
243 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) == 0;
246 bool operator==(
const IdentifierB &s1,
const std::string &s2) {
247 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) == 0;
250 bool operator==(
const IdentifierB &s1,
const char *s2) {
251 return compare(s1.c_str(), s1.length(), s2, std::strlen(s2)) == 0;
254 bool operator==(
const IdentifierB &s1,
const IdentifierB &s2) {
255 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) == 0;
258 bool operator<=(
const std::string &s1,
const IdentifierB &s2) {
259 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) <= 0;
262 bool operator<=(
const IdentifierB &s1,
const std::string &s2) {
263 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) <= 0;
266 bool operator<=(
const IdentifierB &s1,
const char *s2) {
267 return compare(s1.c_str(), s1.length(), s2, std::strlen(s2)) <= 0;
270 bool operator<=(
const IdentifierB &s1,
const IdentifierB &s2) {
271 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) <= 0;
274 bool operator>(
const std::string &s1,
const IdentifierB &s2) {
275 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) > 0;
278 bool operator>(
const IdentifierB &s1,
const std::string &s2) {
279 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) > 0;
282 bool operator>(
const IdentifierB &s1,
const char *s2) {
283 return compare(s1.c_str(), s1.length(), s2, std::strlen(s2)) > 0;
286 bool operator>(
const IdentifierB &s1,
const IdentifierB &s2) {
287 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) > 0;
290 bool operator>=(
const std::string &s1,
const IdentifierB &s2) {
291 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) >= 0;
294 bool operator>=(
const IdentifierB &s1,
const std::string &s2) {
295 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) >= 0;
298 bool operator>=(
const IdentifierB &s1,
const char *s2) {
299 return compare(s1.c_str(), s1.length(), s2, std::strlen(s2)) >= 0;
302 bool operator>=(
const IdentifierB &s1,
const IdentifierB &s2) {
303 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) >= 0;
306 bool operator!=(
const std::string &s1,
const IdentifierB &s2) {
307 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) != 0;
310 bool operator!=(
const IdentifierB &s1,
const std::string &s2) {
311 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) != 0;
314 bool operator!=(
const IdentifierB &s1,
const char *s2) {
315 return compare(s1.c_str(), s1.length(), s2, std::strlen(s2)) != 0;
318 bool operator!=(
const IdentifierB &s1,
const IdentifierB &s2) {
319 return compare(s1.c_str(), s1.length(), s2.c_str(), s2.length()) != 0;
std::ostream & operator<<(std::ostream &s, const Bucket &k)
Print the part names for which this bucket is a subset.
basic_string< char > string
string / wstring
static int compare(const char *s1, const char *s2, std::size_t n)
Member function compare compares up to n characters of s1 and s2 and returns -1 if s1 is less then s2...