Fixed scanning of < and > operators in where clauses. #12

This commit is contained in:
Gideon le Grange 2014-10-07 09:04:27 +02:00
parent 2e431894bf
commit 91b95e8466
3 changed files with 29 additions and 2 deletions

View File

@ -7,7 +7,7 @@ package examples;
public class Config {
public static final String HOST = "10.0.1.1";
public static final String HOST = "10.0.1.134";
public static final String USERNAME = "admin";
public static final String PASSWORD = "";

View File

@ -0,0 +1,27 @@
package examples;
import java.util.List;
import java.util.Map;
import me.legrange.mikrotik.MikrotikApiException;
/**
* Example 7: Dump your complete config
*
* @author gideon
*/
public class Example8 extends Example {
public static void main(String... args) throws Exception {
Example8 ex = new Example8();
ex.connect();
ex.test();
ex.disconnect();
}
private void test() throws MikrotikApiException, InterruptedException {
List<Map<String, String>> res = con.execute("/ip/hotspot/user/print where uptime<00:00:01");
for (Map<String, String> r : res) {
System.out.println(r);
}
}
}

View File

@ -95,7 +95,7 @@ class Scanner {
/** process 'name' tokens which could be key words or text */
private Token name() throws ScanException {
text = new StringBuilder();
while (!in(c, "[ \t\r\n=]")) {
while (!in(c, "[ \t\r\n=<>]")) {
text.append(c);
nextChar();
}