Open project

From TaskDepender
Jump to: navigation, search
(Implementation)
 
Line 1: Line 1:
''This page describes the method used by the [[Administration]] to start a new project.''
+
''This page describes the method to start a new project.''
  
== Introduction ==
+
== Description ==
  
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 <tt>sqlite3_open_v2</tt>] 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)
 +
{
 +
  int returnValue;
 +
  if( filename == NULL )
 +
  {
 +
    // Open a new project.
 +
  }
 +
  else
 +
  {
 +
    // Try to open the database.
 +
    returnValue = sqlite3_open_v2( xx, xx, xx );
 +
    if( returnValue == SQL_OK )
 +
 
 +
  }
 +
}
 +
</syntaxhighlight>
 +
 
 +
The following errors can be returned by the SQL-open function.
 +
 
 +
http://www.sqlite.org/c3ref/c_abort.html
 +
 
 +
The following table converts the possible SQLITE error-codes into error-codes for the [[Administration]]
  
 
== Design ==
 
== Design ==

Latest revision as of 09:47, 23 October 2011

Personal tools