Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   
ODBCFilePlugin Class Reference
#include <ODBCFilePlugin.h>
Inheritance diagram for ODBCFilePlugin:
 List of all members.
List of all members.
|  | 
| 
 Public Methods | 
| bool | init () | 
| CoreError | create (NumID &fileid) | 
| CoreError | open (NumID fileid, NumID &of) | 
| CoreError | remove (NumID fileid) | 
| int64_t | getLength (NumID fileid) | 
| CoreError | write (NumID fileid, char *data, int length) | 
| CoreError | read (NumID fileid, char *data, int length, int &bRead) | 
| CoreError | close (NumID fileid) | 
Detailed Description
This file plugin will store files in a PostgreSQL database using ODBC.
CREATE statement for use with a Postgresql server:
 CREATE SEQUENCE files_fileid_seq;
 br> CREATE TABLE files (
     fileid BIGINT DEFAULT nextval('files_fileid_seq') UNIQUE NOT NULL,
     length BIGINT DEFAULT 0,
     data OID NOT NULL
 );
 
This class is multi-thread enabled. 
Member Function Documentation
  
    | 
        
          | CoreError ODBCFilePlugin::close | ( | NumID | fileid | ) |  [virtual] |  | 
  
    |  | 
Close newly created or open file.  Parameters: 
| fileid | the open file to close | 
 Returns: 
status code 
 
Implements FilePlugin.     | 
  
    | 
        
          | CoreError ODBCFilePlugin::create | ( | NumID & | fileid | ) |  [virtual] |  | 
  
    |  | 
Create and store a new file on the fileserver.  Parameters: 
| fileid | the fileid that was created | 
 Returns: 
status code 
 
Implements FilePlugin.     | 
  
    | 
        
          | int64_t ODBCFilePlugin::getLength | ( | NumID | fileid | ) |  [virtual] |  | 
  
    |  | 
Get the length of an open file.  Parameters: 
 Returns: 
the length of the file or -1 on error 
 
Implements FilePlugin.     | 
  
    | 
        
          | bool ODBCFilePlugin::init | ( |  | ) |  [virtual] |  | 
  
    |  | 
Initialize the plugin 
 
Implements Plugin.     | 
  
    | 
        
          | CoreError ODBCFilePlugin::open | ( | NumID | fileid, |  
          |  |  | NumID & | of |  
          |  | ) |  [virtual] |  | 
  
    |  | 
Open and read a file from the fileserver.  Parameters: 
| fileid | the file that is to be read |  | of | the reference that receives the open file ID | 
 Returns: 
status code 
 
Implements FilePlugin.     | 
  
    | 
        
          | CoreError ODBCFilePlugin::read | ( | NumID | fileid, |  
          |  |  | char * | data, |  
          |  |  | int | length, |  
          |  |  | int & | bRead |  
          |  | ) |  [virtual] |  | 
  
    |  | 
Read binary data from file.  Parameters: 
| fileid | the open file to read from |  | data | the buffer that receives the data |  | length | the maximum number of bytes to read |  | bRead | receives the number of bytes actually read | 
 Returns: 
status code 
 
Implements FilePlugin.     | 
  
    | 
        
          | CoreError ODBCFilePlugin::remove | ( | NumID | fileid | ) |  [virtual] |  | 
  
    |  | 
Remove a file from the fileserver.  Parameters: 
| fileid | the file to remove | 
 Returns: 
status code 
 
Implements FilePlugin.     | 
  
    | 
        
          | CoreError ODBCFilePlugin::write | ( | NumID | fileid, |  
          |  |  | char * | data, |  
          |  |  | int | length |  
          |  | ) |  [virtual] |  | 
  
    |  | 
Write binary data to new file.  Parameters: 
| fileid | the newly created file to write to |  | data | the data to write |  | length | the length of the data in bytes | 
 Returns: 
status code 
 
Implements FilePlugin.     | 
The documentation for this class was generated from the following files:
Generated on Wed Feb 18 13:45:56 2004 for strongroom by
 1.2.18
1.2.18