Open project

From TaskDepender
Jump to: navigation, search
(Introduction)
Line 3: Line 3:
 
== Introduction ==
 
== Introduction ==
  
The user of the [[Administration]] can request to start a new project. No name or location is to be specified for the project file yet. However, this method must handle situations in which there are still uncommitted changes in the current project since only  
+
Opening a project can be a new or existing project.
 +
 
 +
The user of the [[Administration]] can request to start a new project. No name or location is to be specified for the project file yet. However, this method must handle situations in which there are still uncommitted changes in the current project since only
 +
 
 +
 
 +
To open an existing project, the caller must supply the filename, including the path. The Administration must handle the situation in which the file can not be found, in which case an error must be returned.
 +
 
 +
== Design ==
 +
 
 +
== Implementation ==
 +
 
 +
The implementation uses the [http://www.sqlite.org/c3ref/open.html sqlite3_open_v2] function.
 +
 
 +
If the filename is an empty string, then a private, temporary on-disk database will be created. This private database will be automatically deleted as soon as the database connection is closed.
 +
 
 +
<syntaxhighlight lang="cpp">
 +
int Admin::Open( char *filename )
 +
{
 +
  if( filename == NULL )
 +
  {
 +
    // Open a new project.
 +
  }
 +
  else
 +
  {
 +
    // Try to open the database.
 +
   
 +
  }
 +
}
 +
</syntaxhighlight>
 +
 
 +
 
 +
The
  
 
== Design ==
 
== Design ==

Revision as of 20:16, 1 October 2011

Personal tools