mirror of
https://github.com/Motschen/Adventura.git
synced 2025-12-15 19:35:09 +01:00
Because of a weird task requirement, folders are not allowed
Who tf came up with this limitation? Seriously...
This commit is contained in:
27
identifier.hpp
Normal file
27
identifier.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
|
||||
using std::string;
|
||||
|
||||
class Identifier {
|
||||
public:
|
||||
std::string nameSpace;
|
||||
std::string path;
|
||||
|
||||
Identifier(std::string nameSpace, std::string path) : nameSpace(nameSpace), path(path) {}
|
||||
|
||||
std::ostream& operator<<(std::ostream& out) {
|
||||
out << nameSpace << ":" << path;
|
||||
return out;
|
||||
}
|
||||
std::istream& operator>>(std::istream& in) {
|
||||
string input;
|
||||
in >> input;
|
||||
nameSpace = input.substr(0, input.find(":"));
|
||||
path = input.substr(input.find(":") + 1, input.length());
|
||||
return in;
|
||||
}
|
||||
bool operator==(Identifier otherId) {
|
||||
return this->nameSpace == otherId.nameSpace && this->path == otherId.path;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user