TextualFileaccess Class

public class TextualFileaccess
Namespace: yaTDL.Classes
Inherits from: Fileaccess

Provides the possibility to save and read a collection of projects to/from a text file.
The used format is described here.

Members

Public Members
public override string defaultFileName Returns the default filename, which is TaskStore.txt in the default directory.(Implements a abstract method inherited from Fileaccess)
public override void SaveProjects(Collection<Project> projects) Saves the Collection<Project> to a text file at the default location. (Implements a abstract method inherited from Fileaccess)
public override void SaveProjects(Collection<Project> projects, string fileName) Saves the Collection<Project> to a text file at the indicated location. (Implements a abstract method inherited from Fileaccess)
public override Collection<Project> OpenProjects() Reads a text file at the default location and returns a Collection<Projects> containing the projects and tasks that were stored in the file. (Implements a abstract method inherited from Fileaccess)
public override Collection<Project> OpenProjects(string fileName) Reads a text file at the indicated location and returns a Collection<Projects> containing the projects and tasks that were stored in the file. (Implements a abstract method inherited from Fileaccess)
public string defaultDirectory Inherited from Fileaccess


Protected Members
protected void backupTaskStore(string fileName) Inherited from Fileaccess
protected string getDirectory(string fileName) Inherited from Fileaccess
protected string getFileExtension(string fileName) Inherited from Fileaccess


Private Members
private Collection<String> lines = new Collection<string>(); A collection of strings. Each member represents a line in a text file that has been read. This collection is used by all methods that are part of the process of reading a text file.
private bool compatibleVersion_Continue() Reads the version of yaTDL the text file that shall be read and checks if it is a lower or equal version as the current one. If it is a higher version, the user will be prompted whether he wants to continue because there might data be lost. This method will be called by OpenProjects() every time a file is read and OpenProjects() will only continue if this method returns true.
private Collection<int> searchFor(string value, int startIndex, int endIndex) Returns a Collection<int> where every member represents is a index of a member of lines that contains value. searchFor() searches lines beginning at startIndex to endIndex.
private Collection<int> searchFor(string value) Returns a Collection<int> where every member represents is a index of a member of lines that contains value. searchFor() will search every member of lines
private Project readSingleProject(int firstLine, int lastLine) Reads a single project. firstLine is the index in lines where the project begins and lastLine the last member of lines belonging to the project.
private Task readSingleTask(int firstLine, int lastline) Reads a single task. firstLine is the index in lines where the task begins and lastLine the last member of lines belonging to the task.

Last edited Aug 16, 2009 at 2:28 PM by apoll0, version 3

Comments

No comments yet.