Package dwlab.base.files

Examples of dwlab.base.files.TextFile


  public int escapingBackslash = 0;
  private static String text;
         
  public static XMLObject readFromFile( String fileName ) {
    TextFile file = TextFile.read( fileName );
    text = "";

    version = 0;
    while( true ) {
      String string = file.readLine();
      if( string == null ) break;
      text += string;
      if( version == 0 ) {
        int quote = text.indexOf( "\"", text.indexOf( "dwlab_version" ) );
        version = Service.versionToInt( text.substring( quote + 1, text.indexOf( "\"", quote + 1 ) ) );
      }
    }

    file.close();

    textPos = 0;
    return readObject( new StringWrapper( "" ) );
  }
View Full Code Here


    return readObject( new StringWrapper( "" ) );
  }


  public void writeToFile( String fileName ) {
    TextFile file = TextFile.write( fileName );
    writeObject( file, "" );
    file.close();
  }
View Full Code Here

    this.fromNum = fromNum;
    this.toNum = toNum;
   
    if( variableLength ) {
      this.variableLength = variableLength;
      TextFile file = TextFile.read( fileName + "len" );
      this.letterWidth = new int[ symbolsQuantity ];
      while( true ) {
        String line = file.readLine();
        if( line == null ) break;
        letterWidth[ line.charAt( 0 ) - fromNum ] = Integer.parseInt( line.substring( 2 ) );
      }
    }
 
View Full Code Here

TOP

Related Classes of dwlab.base.files.TextFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.