]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add string logic table
authorTimePath <andrew.hardaker1995@gmail.com>
Sun, 8 Apr 2018 03:55:39 +0000 (13:55 +1000)
committerTimePath <andrew.hardaker1995@gmail.com>
Sun, 8 Apr 2018 03:55:39 +0000 (13:55 +1000)
qcsrc/lib/string.qh

index d79552187929a03511a56febd3f20c763aa82784..7142f334c15254b74b13908bdde8939eb1b9529b 100644 (file)
@@ -4,6 +4,25 @@
 #include "sort.qh"
 #include "oo.qh"
 
+// string logic
+//
+// true: is truthy
+// == "": is equal to ""
+// is "": has the same string index as the string constant ""
+// strunzone: can be strunzoned
+//
+// |              | true | == "" | is "" | strunzone |
+// | :----------: | :--: | :---: | :---: | :-------: |
+// | nil          |      | yes   |       |           |
+// | strcat(nil)  | yes  | yes   |       |           |
+// | strzone(nil) | yes  | yes   |       | yes       |
+// | ""           | yes  | yes   | yes   |           |
+// | strcat("")   | yes  | yes   |       |           |
+// | strzone("")  | yes  | yes   |       | yes       |
+// | "s"          | yes  |       |       |           |
+// | strcat("s")  | yes  |       |       |           |
+// | strzone("s") | yes  |       |       | yes       |
+
 #ifdef CSQC
        float stringwidth_colors(string s, vector theSize)
        {