There are some undesirable consequences of using this. My advice? Don't use it unless you feel like going through it and finding out what's wrong.
Added...
blitz_object.c
blitz_object.h
blitz_string.c
blitz_string.h
Edit: I neglected to mention you will have to modify the blitz_classes.i to look like this:
Object^Null{
-New()="bbObjectCtor"
-Delete()="bbObjectDtor"
-Clone:Object()="bbObjectClone"
-ToString:String()="bbObjectToString"
-Compare:Int( otherObject:Object )="bbObjectCompare"
-SendMessage:Object( message:Object,source:object )="bbObjectSendMessage"
-_reserved1_()="bbObjectReserved"
-_reserved2_()="bbObjectReserved"
-_reserved3_()="bbObjectReserved"
}="bbObjectClass"
String^Object{
.length:Int
-Clone:Object()="bbStringClone"
-ToString:String()="bbStringToString"
-Compare:Int(otherObject:Object)="bbStringCompare"
-Find:Int( subString:String,startIndex=0 )="bbStringFind"
-FindLast:Int( subString:String,startIndex=0 )="bbStringFindLast"
-Trim:String()="bbStringTrim"
-Replace:String( substring:String,withString:String )="bbStringReplace"
-ToLower:String()="bbStringToLower"
-ToUpper:String()="bbStringToUpper"
-ToInt:Int()="bbStringToInt"
-ToLong:Long()="bbStringToLong"
-ToFloat:Float()="bbStringToFloat"
-ToDouble:Double()="bbStringToDouble"
-ToCString:Byte Ptr()="bbStringToCString"
-ToWString:Short Ptr()="bbStringToWString"
+FromInt:String( intValue:Int)="bbStringFromInt"
+FromLong:String( longValue:Long )="bbStringFromLong"
+FromFloat:String( floatValue:Float )="bbStringFromFloat"
+FromDouble:String( doubleValue:Double )="bbStringFromDouble"
+FromCString:String( cString:Byte Ptr )="bbStringFromCString"
+FromWString:String( wString:short ptr )="bbStringFromWString"
+FromBytes:String( bytes:Byte Ptr,count )="bbStringFromBytes"
+FromShorts:String( shorts:Short Ptr,count )="bbStringFromShorts"
}AF="bbStringClass"
Array^Object{
.elementTypeEncoding:Byte Ptr
.numberOfDimensions:Int
.sizeMinusHeader:Int
.length:Int
-Sort( ascending=1 )="bbArraySort"
-Dimensions:Int[]()="bbArrayDimensions"
}AF="bbArrayClass"
Note the addition of the Clone methods to the String and Object classes. It is not added to the Array class because it is already implemented in its base class (which is, obviously, Object).
Have fun.
|