public enum TreePrintStyle { inOrder, postOrder, preOrder, depthOrder };
// WARNING: This function has no boundary check!
-public void strcatf(char * string, char * format, ...)
+public void strcatf(char * string, const char * format, ...)
{
va_list args;
va_start(args, format);
return this;
}
- public BTNode FindString(char * key)
+ public BTNode FindString(const char * key)
{
while(this)
{
int result;
if(key && this.key)
- result = strcmp(key, (char *)this.key);
+ result = strcmp(key, (const char *)this.key);
else if(key && !this.key)
result = 1;
else if(!key && this.key)
return this;
}
- public BTNode FindPrefix(char * key)
+ public BTNode FindPrefix(const char * key)
{
BTNode subString = null;
int len = key ? strlen(key) : 0;
{
int result;
if(key && this.key)
- result = strcmp(key, (char *)this.key);
+ result = strcmp(key, (const char *)this.key);
else if(key && !this.key)
result = 1;
else if(!key && this.key)
if(result < 0)
{
- if(!strncmp(key, (char *)this.key, len))
+ if(!strncmp(key, (const char *)this.key, len))
subString = this;
this = left;
}
}
};
-// TODO: WHY CAN'T WE HAVE THIS ABOVE?
-
public class StringBTNode : struct // BTNode
{
class_fixed
channel.Unserialize(truth);
if(truth)
{
- // TODO: Fix typed_object issues
- this = eInstance_New(class(StringBTNode));
+ this = { };
channel.Unserialize(key);
channel.Unserialize(left);
if(left) { left.parent = this; }