@@ -62,26 +62,26 @@ class BlinkerProtocol
62
62
}
63
63
}
64
64
65
- void print ( const String &s) { conn. print (s + BLINKER_CMD_NEWLINE); }
66
- void print (const char str[] ) { print (STRING_format (str) ); }
67
- void print (char c ) { print (STRING_format (c) ); }
68
- void print ( unsigned char b) { print ( STRING_format (b)); }
69
- void print ( int n) { print ( STRING_format (n)); }
70
- void print ( unsigned int n) { print (STRING_format (n) ); }
71
- void print ( long n ) { print (STRING_format (n) ); }
72
- void print ( unsigned long n) { print ( STRING_format (n)); }
73
- void print ( double n) { print ( STRING_format (n)); }
74
- void print () { print ( " " ); }
75
- void println ( const String &s) { print (s); }
76
- void println ( const char str[]) { print (str); }
77
- void println (char c ) { print (c ); }
78
- void println ( unsigned char b) { print (b); }
79
- void println ( int n) { print (n); }
80
- void println ( unsigned int n ) { print (n ); }
81
- void println ( long n) { print (n); }
82
- void println ( unsigned long n) { print (n); }
83
- void println (double n ) { print (n ); }
84
- void println () { print (); }
65
+ template < typename T>
66
+ void print (T n ) { conn. print (STRING_format (n) + BLINKER_CMD_NEWLINE ); }
67
+ void print () { print (" " ); }
68
+
69
+ template < typename T>
70
+ void println (T n) { print (n ); }
71
+ void println ( ) { print (); }
72
+
73
+ template < typename T1, typename T2, typename T3>
74
+ void print (T1 n1, T2 n2, T3 n3) { print ( " { \" " + STRING_format (n1) + " \" : \" " + STRING_format (n2) + BLINKER_CMD_INTERSPACE + STRING_format (n3) + " \" } " ); }
75
+
76
+ template < typename T1, typename T2, typename T3>
77
+ void println (T1 n1, T2 n2, T3 n3 ) { print ( " { \" " + STRING_format (n1) + " \" : \" " + STRING_format (n2) + BLINKER_CMD_INTERSPACE + STRING_format (n3) + " \" } " ); }
78
+
79
+ // template <typename T1, typename T2>
80
+ // void print(T1 n1, T2 n2 ) { print("{\"" + STRING_format(n1) + "\":\"" + STRING_format(n2) + "\"}" ); }
81
+
82
+ // template <typename T1, typename T2>
83
+ // void println(T1 n1, T2 n2 ) { print("{\"" + STRING_format(n1) + "\":\"" + STRING_format(n2) + "\"}" ); }
84
+
85
85
void print (const String &s1, const String &s2) { print (" {\" " + s1 + " \" :\" " + s2 + " \" }" ); }
86
86
void print (const char str1[], const char str2[]) { print (" {\" " + STRING_format (str1) + " \" :\" " + STRING_format (str2) + " \" }" ); }
87
87
void print (const char str[], char c) { print (" {\" " + STRING_format (str) + " \" :" + STRING_format (c) + " }" ); }
@@ -100,7 +100,7 @@ class BlinkerProtocol
100
100
void println (const char str[], long n) { print (str, n); }
101
101
void println (const char str[], unsigned long n) { print (str, n); }
102
102
void println (const char str[], double n) { print (str, n); }
103
-
103
+
104
104
void flush () {
105
105
isFresh = false ;
106
106
}
0 commit comments