Show
Ignore:
Timestamp:
05/04/08 18:42:55 (4 years ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

reverted char[] to String

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/graphics/FontData.d

    r200 r238  
    2020import tango.util.Convert; 
    2121import dwt.dwthelper.utils; 
     22import tango.util.log.Trace; 
    2223 
    2324/** 
     
    5657     * </p> 
    5758     */ 
    58     public char[] name; 
     59    public String name; 
    5960 
    6061    /** 
     
    9293     * </p> 
    9394     */ 
    94     public char[] str; 
     95    public String str; 
    9596 
    9697    /** 
    9798     * The locales of the font 
    9899     */ 
    99     char[] lang, country, variant; 
     100    String lang, country, variant; 
    100101 
    101102/** 
     
    125126 * @see #toString 
    126127 */ 
    127 public this(char[] str) { 
     128public this(String str) { 
    128129    if (str is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    129130    int start = 0; 
    130131    int end = locate( str, '|' ); 
    131132    if (end is str.length ) DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
    132     char[] version1 = str[ start .. end ]; 
     133    String version1 = str[ start .. end ]; 
    133134    try { 
    134135        if (to!(int)(version1) !is 1) DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
     
    140141    end = locate( str, '|', start ); 
    141142    if (end is str.length ) DWT.error(DWT.ERROR_INVALID_ARGUMENT); 
    142     char[] name = str[start .. end ]; 
     143    String name = str[start .. end ]; 
    143144 
    144145    start = end + 1; 
     
    168169    setStyle(style); 
    169170    if (end is str.length) return; 
    170     char[] platform = str[ start .. end ]; 
     171    String platform = str[ start .. end ]; 
    171172 
    172173    start = end + 1; 
    173174    end = locate( str, '|', start ); 
    174175    if (end is str.length) return; 
    175     char[] version2 = str[ start .. end ]; 
     176    String version2 = str[ start .. end ]; 
    176177 
    177178    if (platform.equals("GTK") && version2.equals("1")) { 
     
    194195 * </ul> 
    195196 */ 
    196 public this(char[] name, int height, int style) { 
     197public this(String name, int height, int style) { 
    197198    setName(name); 
    198199    setHeight(height); 
     
    200201} 
    201202 
    202 /*public*/ this(char[] name, float height, int style) { 
     203/*public*/ this(String name, float height, int style) { 
    203204    setName(name); 
    204205    setHeight(height); 
     
    256257 * @since 3.0 
    257258 */ 
    258 public char[] getLocale () { 
    259     char[] result; 
     259public String getLocale () { 
     260    String result; 
    260261    const char sep = '_'; 
    261262    if (lang !is null) { 
     
    276277        } 
    277278    } 
     279Trace.formatln( "getLocal {}", result ); 
    278280    return result; 
    279281} 
     
    288290 * @see #setName 
    289291 */ 
    290 public char[] getName() { 
     292public String getName() { 
    291293    return name; 
    292294} 
     
    316318 */ 
    317319public override hash_t toHash () { 
    318     return typeid(char[]).getHash(&name) ^ getHeight() ^ style; 
     320    return typeid(String).getHash(&name) ^ getHeight() ^ style; 
    319321} 
    320322 
     
    361363 * @see java.util.Locale#toString 
    362364 */ 
    363 public void setLocale(char[] locale) { 
     365public void setLocale(String locale) { 
     366Trace.formatln( "setLocal {}", locale ); 
    364367    lang = country = variant = null; 
    365368    if (locale !is null) { 
     
    406409 * @see #getName 
    407410 */ 
    408 public void setName(char[] name) { 
     411public void setName(String name) { 
    409412    if (name is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); 
    410413    this.name = name; 
     
    436439 * @see FontData 
    437440 */ 
    438 public override char[] toString() { 
     441public override String toString() { 
    439442    return Format( "1|{}|{}|{}|GTK|1|", getName, getHeightF, getStyle ); 
    440443}