Class TextFile

java.lang.Object
  extended by TextFile

public class TextFile
extends java.lang.Object


Constructor Summary
TextFile(java.lang.String nameFile)
          Constructeur
 
Method Summary
 boolean close()
          Close file
 boolean eof()
          Return the current position is at end of file
 long getLength()
          Return the length of the file
 java.lang.String getNameFile()
          Return the name of file
 long getPosition()
          Return the current position inside the file
 boolean isOpen()
          Return if the file is opened
 boolean openRead()
          Open file in read mode
 boolean openWrite()
          Open file in write mode
 java.lang.String readString()
          Read a string into the file
 boolean setNameFile(java.lang.String nameFile)
          Change the file name
 boolean writeString(java.lang.String str)
          Write a string into the file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextFile

public TextFile(java.lang.String nameFile)
Constructeur

Parameters:
nameFile - name of the file to open/create
Method Detail

getNameFile

public java.lang.String getNameFile()
Return the name of file

Returns:
name of file

isOpen

public boolean isOpen()
Return if the file is opened

Returns:
TRUE if the file is opened

getLength

public long getLength()
Return the length of the file

Returns:
length of the file, -1 if an error occurs

getPosition

public long getPosition()
Return the current position inside the file

Returns:
position courante

setNameFile

public boolean setNameFile(java.lang.String nameFile)
Change the file name

Returns:
TRUE if succes

openRead

public boolean openRead()
Open file in read mode

Returns:
TRUE if succes

openWrite

public boolean openWrite()
Open file in write mode

Returns:
TRUE if succes

close

public boolean close()
Close file

Returns:
TRUE if succes

eof

public boolean eof()
Return the current position is at end of file

Returns:
TRUE if end of file

readString

public java.lang.String readString()
Read a string into the file

Returns:
string readed

writeString

public boolean writeString(java.lang.String str)
Write a string into the file

Parameters:
str - string to write
Returns:
TRUE if succes