You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
995 B
35 lines
995 B
#include <smtpd/token.hpp>
|
|
#include <util.hpp>
|
|
#include <log.hpp>
|
|
|
|
using namespace std;
|
|
|
|
namespace smtpd {
|
|
TokenPattern::TokenPattern() :
|
|
sparse_vector<Token>() {}
|
|
|
|
TokenPattern::TokenPattern(const TokenPattern & pattern) :
|
|
sparse_vector<Token>(pattern), wildcard(pattern.wildcard) {};
|
|
|
|
TokenPattern::TokenPattern(const std::vector<std::string> & vector, bool wildcard) :
|
|
sparse_vector<Token>(vector), wildcard(wildcard) {}
|
|
|
|
TokenPattern::TokenPattern(const string & input, bool wildcard) :
|
|
TokenPattern(util::split(input, '|'), wildcard) {}
|
|
|
|
TokenPattern::TokenPattern(std::initializer_list<Token> list) :
|
|
sparse_vector<Token>(list) {}
|
|
|
|
|
|
TokenPattern::operator std::string() const {
|
|
return util::join(*this, '|');
|
|
}
|
|
|
|
bool operator<(const TokenPattern& left, const TokenPattern& right) {
|
|
return true;
|
|
}
|
|
|
|
ostream & operator<<(ostream & out, const TokenPattern & pattern) {
|
|
return out;
|
|
}
|
|
} |