colinlin1982 / maashaack

Automatically exported from code.google.com/p/maashaack
0 stars 0 forks source link

system.formatters.ExpressionFormatter #120

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This class format a String expression with a dictionnary of strings

{{{
import system.formatters.ExpressionFormatter ;

var source:String ;

var ExpressionFormatter = new ExpressionFormatter() ;

exp["root"]              = "c:" ;
exp["system"]            = "{root}/project/system" ;
exp["data.maps"]         = "{system}/data/maps" ;
exp["data.maps.HashMap"] = "{data.maps}/HashMap.as" ;

source = "the root : {root} - the class : {data.maps.HashMap}" ;

trace( exp.format( source ) ) ;

trace( "----" ) ;

exp["system"]            = "%root%/project/system" ;
exp["data.maps"]         = "%system%/data/map" ;     * 
exp["data.maps.HashMap"] = "%data.map%/HashMap.as" ;

exp.beginSeparator = "%" ;
exp.endSeparator   = "%" ;

source = "the root : %root% - the class : %data.maps.HashMap%" ;

trace( exp.format( source ) ) ;
}}}

ExpressionFormatter inherit the flash.utils.Dictionnary class and 
implements the Formattable class.

Original issue reported on code.google.com by ekamel...@gmail.com on 22 Jan 2009 at 3:54

GoogleCodeExporter commented 9 years ago

Original comment by ekamel...@gmail.com on 24 Jan 2009 at 7:24

GoogleCodeExporter commented 9 years ago

Original comment by ekamel...@gmail.com on 9 Feb 2009 at 5:04

GoogleCodeExporter commented 9 years ago
Finalize first version in the revision 535 :
http://code.google.com/p/maashaack/source/detail?r=535

Original comment by ekamel...@gmail.com on 10 Feb 2009 at 2:54