Use this class in order to read in a taxonomy file. More...
#include <ms_taxonomyfile.hpp>
Public Member Functions | |
ms_taxonomyfile () | |
Default constructor. | |
ms_taxonomyfile (const char *filename, const matrix_science::ms_connection_settings *cs=0) | |
Immediate-action constructor that reads the given file on construction. | |
ms_taxonomyfile (const ms_taxonomyfile &src) | |
Copying constructor. | |
~ms_taxonomyfile () | |
Destructor. | |
void | appendEntry (const ms_taxonomychoice *item) |
Adds a new taxonomy choice at the end of the list. | |
void | appendErrors (const ms_errors &src) |
Copies all errors from another instance and appends them at the end of own list. | |
void | clearAllErrors () |
Remove all errors from the current list of errors. | |
void | clearEntries () |
Deletes all taxonomy choices from the list. | |
void | copyFrom (const ms_errors *right) |
Use this member to make a copy of another instance. | |
void | copyFrom (const ms_taxonomyfile *right) |
Copies all content from another instance. | |
void | defaultValues () |
Call this member if you want to start again. | |
matrix_science::ms_connection_settings | getConnectionSettings () const |
Returns the sessionID and proxy server for use with an HTTP transfer. | |
ms_taxonomychoice * | getEntryByName (const char *name) |
Returns a taxonomy choice entry by its name or NULL in case of not found. | |
const ms_taxonomychoice * | getEntryByNumber (const int index) const |
Returns a taxonomy choice entry by its number. | |
const ms_errs * | getErrorHandler () const |
Retrive the error object using this function to get access to all errors and error parameters. | |
std::string | getFileName () const |
Returns a file name that is used to read the file. | |
int | getLastError () const |
Return the error description of the last error that occurred. | |
std::string | getLastErrorString () const |
Return the error description of the last error that occurred. | |
int | getNumberOfEntries () const |
Returns a number of taxonomy choices currently held in memory. | |
bool | isValid () const |
Call this function to determine if there have been any errors. | |
ms_taxonomyfile & | operator= (const ms_taxonomyfile &right) |
C++ style assignment operator. | |
void | read_buffer (const char *buffer) |
Reads and parses an in-memory null-terminated buffer instead of a disk file. | |
void | read_file () |
Reads configuration information from the file. | |
void | save_file () |
Stores modification information in the file. | |
void | setConnectionSettings (const matrix_science::ms_connection_settings &cs) |
Sets the sessionID and proxy server for use with an http transfer. | |
void | setFileName (const char *name) |
Call this member to set a custom file name to read from a different location. | |
Use this class in order to read in a taxonomy file.
The list of taxonomy choices in the search form is taken from the taxonomy file. The file consists of several entries. The first line of each entry must start with the Title:
keyword, followed by a text string that is used to identify the species in forms and reports. The definition should be short and self-explanatory.
To show the tree structure, indentation can be used. Unfortunately, it is not possible to use tabs or multiple spaces for indentation in an HTML form, so a full stop (period) and a space are used to indent the list. Internal spaces are significant, and there should never be two or more spaces together.
This should be followed with a definition line starting with the Include:
keyword, followed by one or more numbers separated with commas. With the supplied MSDB database, and supplied taxonomy files, these numbers should be the NCBI taxonomy ID.
This should be followed with a definition line starting with the Exclude:
keyword, followed by one or more numbers separated with commas. Any sequence with a taxonomy ID that passes the 'include' test may then be rejected by any entry in the exclude list.
Finally, each entry must end with a *
.
ms_taxonomyfile | ( | const char * | filename, |
const matrix_science::ms_connection_settings * | cs = 0 |
||
) |
Immediate-action constructor that reads the given file on construction.
filename | The file name parameter can be either a local file path or a Mascot server URL, it cannot be an empty string or NULL pointer. If it is a URL it should be of the form http://your-server/mascot/cgi . |
cs | is a pointer to the connection settings. This should contain a sessionID and optionally the proxy server settings. |
|
inherited |
Copies all errors from another instance and appends them at the end of own list.
src | The object to copy the errors across from. See Maintaining object references: two rules of thumb. |
|
inherited |
Remove all errors from the current list of errors.
The list of 'errors' can include fatal errors, warning messages, information messages and different levels of debugging messages.
All messages are accumulated into a list in this object, until clearAllErrors() is called.
See Error Handling.
|
inherited |
Use this member to make a copy of another instance.
right | is the source to initialise from |
matrix_science::ms_connection_settings getConnectionSettings | ( | ) | const |
Returns the sessionID and proxy server for use with an HTTP transfer.
See also the constructor documentation and setConnectionSettings().
|
inherited |
Retrive the error object using this function to get access to all errors and error parameters.
See Error Handling.
|
inherited |
Return the error description of the last error that occurred.
All errors are accumulated into a list in this object, until clearAllErrors() is called. This function returns the last error that occurred.
See Error Handling.
|
inherited |
Return the error description of the last error that occurred.
All errors are accumulated into a list in this object, until clearAllErrors() is called. This function returns the last error that occurred.
See Error Handling.
|
inherited |
Call this function to determine if there have been any errors.
This will return true unless there have been any fatal errors.
See Error Handling.
void read_buffer | ( | const char * | buffer | ) |
Reads and parses an in-memory null-terminated buffer instead of a disk file.
Check for possible errors after calling this functions with isValid().
buffer | a null-terminated string with taxonomies definitions. |
void read_file | ( | ) |
Reads configuration information from the file.
Check for possible errors after calling this functions with isValid().
void setConnectionSettings | ( | const matrix_science::ms_connection_settings & | cs | ) |
Sets the sessionID and proxy server for use with an http transfer.
This value would normally be passed in the constructor.
cs | Is the new connection settings. |