public static void StrAlloc(CrakenString str, int newsize) { byte[] data = new byte[newsize]; int l = str.Length; for (int i = 0; i < newsize; i++) { if (i < l) { data[i] = str[i]; } else { data[i] = 0; }; }; str[false, null] = data; }
public static CrakenString operator +(CrakenString a, CrakenChar b) { Type ttype = a.parent.GetType(); string stra, strc; char strb; stra = (string)a.Value; strb = (char)b.Value; strc = stra + strb; CrakenString result; if (ttype == typeof(Craken)) { result = new CrakenString((Craken)a.parent, a.name, strc.Length); } else if (ttype == typeof(Script)) { result = new CrakenString((Script)a.parent, a.name, strc.Length); } else if (ttype == typeof(Function)) { result = new CrakenString((Function)a.parent, a.name, strc.Length); } else { return null; } result[false, null] = strc; return result; }