#pragma once
-uint64_t ConvToUInt64(const std::string& in);
+#include "convto.h"
/**
* Represents a member of a channel.
*/
static Id IdFromString(const std::string& str)
{
- return ConvToUInt64(str);
+ return ConvToNum<Id>(str);
}
/** Constructor, sets the user and chan fields to the parameters, does NOT update any bookkeeping
*/
Membership(User* u, Channel* c) : user(u), chan(c) {}
- /** Returns true if this member has a given prefix mode set
- * @param m The prefix mode letter to check
+ /** Check if this member has a given prefix mode set
+ * @param pm Prefix mode to check
* @return True if the member has the prefix mode set, false otherwise
*/
- inline bool hasMode(char m) const
+ bool HasMode(const PrefixMode* pm) const
{
- return modes.find(m) != std::string::npos;
+ return (modes.find(pm->GetModeChar()) != std::string::npos);
}
/** Returns the rank of this member.
* be in rank order, greatest first, as certain IRC clients require
* this when multiple prefixes are used names lists.
*/
- const char* GetAllPrefixChars() const;
+ std::string GetAllPrefixChars() const;
};