module configfile # # tell Elmer to "guess" on how to convert an SCObj into # the equivalent Tcl object...obviously for Tcl only # type SCObj g class configfile { configfile __init__( string fileName ) -> create string getFileName() list getVars() SCObj getValue( string varName ) } # # these helper functions would not be used in a Tcl interface, since # Tcl supports native lists and associative arrays (dictionaries) # # return vals for getType(): # 0=UNKNOWN, 1=INT, 2=STRING, 3=FLOAT, 4=DOUBLE, 5=LIST, 6=DICT int getType( SCObj obj ) int extractInt( SCObj obj ) string extractString( SCObj obj ) float extractFloat( SCObj obj ) double extractDouble( SCObj obj ) int getListLength( SCObj obj ) SCObj getNthItemInList( SCObj obj, int n ) SCObj getKeys( SCObj obj ) SCObj getItemInMapIntKey( SCObj obj, int key ) SCObj getItemInMapStringKey( SCObj obj, string key ) SCObj getItemInMapFloatKey( SCObj obj, float key ) SCObj getItemInMapDoubleKey( SCObj obj, double key )