From b9f5e5315e8d4ad75f7011baf75e74ebeeebbd71 Mon Sep 17 00:00:00 2001 From: SpaiR Date: Thu, 6 Aug 2020 13:28:05 +0300 Subject: [PATCH] Add ImString#isEmpty and ImString#isNotEmpty methods --- .../src/main/java/imgui/type/ImString.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/imgui-binding/src/main/java/imgui/type/ImString.java b/imgui-binding/src/main/java/imgui/type/ImString.java index 0b8ea99..7f57ca3 100644 --- a/imgui-binding/src/main/java/imgui/type/ImString.java +++ b/imgui-binding/src/main/java/imgui/type/ImString.java @@ -143,6 +143,20 @@ public final class ImString implements Cloneable { return data.length; } + /** + * @return true if the length of the text inside of the data buffer is 0 + */ + public boolean isEmpty() { + return getLength() == 0; + } + + /** + * @return true if the length of the text inside of the data buffer is not 0 + */ + public boolean isNotEmpty() { + return !isEmpty(); + } + @Override public String toString() { return get();