Commit 05b7182e authored by Kristof Szabados's avatar Kristof Szabados Committed by Gerrit Code Review
Browse files

Merge "log() in TitanOctetString was implemented"

parents 5c35c1a3 a3cb6a7b
......@@ -16,6 +16,7 @@ import java.util.regex.Pattern;
* TTCN-3 octetstring
* @author Arpad Lovassy
* @author Farkas Izabella Ingrid
* @author Andrea Palfi
*/
public class TitanOctetString extends Base_Type {
......@@ -269,6 +270,31 @@ public class TitanOctetString extends Base_Type {
return constGetAt( index_value.getInt() );
}
public void log() {
if (val_ptr != null) {
boolean onlyPrintable = true;
TtcnLogger.log_char('\'');
for (int i = 0; i < val_ptr.size(); i++) {
final char octet = val_ptr.get(i);
TtcnLogger.log_octet(octet); // get_nibble(i)
if (onlyPrintable && !(TtcnLogger.isPrintable(octet))) {
onlyPrintable = false;
}
}
TtcnLogger.log_event_str("'O");
if (onlyPrintable && val_ptr.size() > 0) {
TtcnLogger.log_event_str("(\"");
for (int i = 0; i < val_ptr.size(); i++) {
TtcnLogger.logCharEscaped(val_ptr.get(i));
TtcnLogger.log_event_str("\")");
}
}
} else {
TtcnLogger.log_event_unbound();
}
}
@Override
public String toString() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment