summaryrefslogtreecommitdiff
path: root/include/users.h
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2016-02-25 18:05:04 +0100
committerAttila Molnar <attilamolnar@hush.com>2016-02-25 18:05:04 +0100
commit761e6d75ba37b984998952940ed681e79e456142 (patch)
tree002d219057b5b4fda5c49595eada3eb7e1e8d525 /include/users.h
parentb928bbfd192c5569b2fc5d497cfc88790bb6d795 (diff)
parent304b6dbbf56710b1310fce8c5cf71b73334c060a (diff)
Merge branch 'master+writenumeric'
Diffstat (limited to 'include/users.h')
-rw-r--r--include/users.h104
1 files changed, 102 insertions, 2 deletions
diff --git a/include/users.h b/include/users.h
index fa346a329..5e7df74ea 100644
--- a/include/users.h
+++ b/include/users.h
@@ -519,9 +519,109 @@ class CoreExport User : public Extensible
*/
void WriteNotice(const std::string& text) { this->WriteCommand("NOTICE", ":" + text); }
- void WriteNumeric(unsigned int numeric, const char* text, ...) CUSTOM_PRINTF(3, 4);
+ void WriteRemoteNumeric(const Numeric::Numeric& numeric);
- void WriteNumeric(unsigned int numeric, const std::string &text);
+ template <typename T1>
+ void WriteRemoteNumeric(unsigned int numeric, T1 p1)
+ {
+ Numeric::Numeric n(numeric);
+ n.push(p1);
+ WriteRemoteNumeric(n);
+ }
+
+ template <typename T1, typename T2>
+ void WriteRemoteNumeric(unsigned int numeric, T1 p1, T2 p2)
+ {
+ Numeric::Numeric n(numeric);
+ n.push(p1);
+ n.push(p2);
+ WriteRemoteNumeric(n);
+ }
+
+ template <typename T1, typename T2, typename T3>
+ void WriteRemoteNumeric(unsigned int numeric, T1 p1, T2 p2, T3 p3)
+ {
+ Numeric::Numeric n(numeric);
+ n.push(p1);
+ n.push(p2);
+ n.push(p3);
+ WriteRemoteNumeric(n);
+ }
+
+ template <typename T1, typename T2, typename T3, typename T4>
+ void WriteRemoteNumeric(unsigned int numeric, T1 p1, T2 p2, T3 p3, T4 p4)
+ {
+ Numeric::Numeric n(numeric);
+ n.push(p1);
+ n.push(p2);
+ n.push(p3);
+ n.push(p4);
+ WriteRemoteNumeric(n);
+ }
+
+ template <typename T1, typename T2, typename T3, typename T4, typename T5>
+ void WriteRemoteNumeric(unsigned int numeric, T1 p1, T2 p2, T3 p3, T4 p4, T5 p5)
+ {
+ Numeric::Numeric n(numeric);
+ n.push(p1);
+ n.push(p2);
+ n.push(p3);
+ n.push(p4);
+ n.push(p5);
+ WriteRemoteNumeric(n);
+ }
+
+ void WriteNumeric(const Numeric::Numeric& numeric);
+
+ template <typename T1>
+ void WriteNumeric(unsigned int numeric, T1 p1)
+ {
+ Numeric::Numeric n(numeric);
+ n.push(p1);
+ WriteNumeric(n);
+ }
+
+ template <typename T1, typename T2>
+ void WriteNumeric(unsigned int numeric, T1 p1, T2 p2)
+ {
+ Numeric::Numeric n(numeric);
+ n.push(p1);
+ n.push(p2);
+ WriteNumeric(n);
+ }
+
+ template <typename T1, typename T2, typename T3>
+ void WriteNumeric(unsigned int numeric, T1 p1, T2 p2, T3 p3)
+ {
+ Numeric::Numeric n(numeric);
+ n.push(p1);
+ n.push(p2);
+ n.push(p3);
+ WriteNumeric(n);
+ }
+
+ template <typename T1, typename T2, typename T3, typename T4>
+ void WriteNumeric(unsigned int numeric, T1 p1, T2 p2, T3 p3, T4 p4)
+ {
+ Numeric::Numeric n(numeric);
+ n.push(p1);
+ n.push(p2);
+ n.push(p3);
+ n.push(p4);
+ WriteNumeric(n);
+ }
+
+ template <typename T1, typename T2, typename T3, typename T4, typename T5>
+ void WriteNumeric(unsigned int numeric, T1 p1, T2 p2, T3 p3, T4 p4, T5 p5)
+ {
+ Numeric::Numeric n(numeric);
+ n.push(p1);
+ n.push(p2);
+ n.push(p3);
+ n.push(p4);
+ n.push(p5);
+ WriteNumeric(n);
+ }
/** Write text to this user, appending CR/LF and prepending :nick!user\@host of the user provided in the first parameter.
* @param user The user to prepend the :nick!user\@host of