Matrix Science header
Public Member Functions

ms_license Class Reference
[Mascot configuration files module]

The class provides access license details in read-only mode. More...

#include <ms_license.hpp>

Inheritance diagram for ms_license:
Inheritance graph
[legend]
Collaboration diagram for ms_license:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ms_license ()
 Default constructor.
 ms_license (const ms_license &src)
 Copying constructor.
 ms_license (const char *filename)
 Immediate action constructor.
 ~ms_license ()
 Destructor.
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 copyFrom (const ms_errors *right)
 Use this member to make a copy of another instance.
void copyFrom (const ms_license *right)
 Copies all information from another instance.
void defaultValues ()
 Can be called before re-using the instance in order to erase the previous license details.
std::string getDistributor () const
 Returns Mascot distributor information.
std::string getEndDate () const
 Returns a date the license is valid until as a string.
const ms_errsgetErrorHandler () const
 Retrive the error object using this function to get access to all errors and error parameters.
std::string getFeatures () const
 Returns a string which encodes feature information.
std::string getFileName () const
 Returns a file name being used as a license.
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.
std::string getLicensee () const
 Returns a name of the licensee.
std::string getLicenseString () const
 Returns a compound license string that can be used for displaying license information.
std::string getLicenseVersion () const
 Returns a license version as a string.
int getNumProcessorsLicensed () const
 Returns a number of processors licensed.
std::string getStartDate () const
 Returns a date the license is valid from as a string.
bool isLicenseValid () const
 Returns TRUE if the license has been sucessfully read, parsed and checked.
bool isValid () const
 Call this function to determine if there have been any errors.
ms_licenseoperator= (const ms_license &right)
 Assignment operator for C++ client applications.
void read_file ()
 Main method that reads in the license file.
void setFileName (const char *filename)
 Set the license file name explicitly rather than use a default location.

Detailed Description

The class provides access license details in read-only mode.

This class doesn't contain functions to create a new license or read details of why a license may be invalid.

Please note the ms_license class will only work with license files from Mascot release 2.3 or earlier.

To use this class:

Examples:

config_license.cpp.


Constructor & Destructor Documentation

ms_license (  )

Default constructor.

Deprecated:
Warning: This class just reads licenses for Mascot version 2.4.x and earlier

This doesn't read a license file.

ms_license ( const char *  filename )

Immediate action constructor.

Deprecated:
Warning: This class just reads licenses for Mascot version 2.4.x and earlier

Loads the license file into memory. Call isValid() and isLicenseValid() to checks that it is a valid license file.

Parameters:
filenameis a full or relative path to mascot.license

Member Function Documentation

void appendErrors ( const ms_errors src ) [inherited]

Copies all errors from another instance and appends them at the end of own list.

Parameters:
srcThe object to copy the errors across from. See Maintaining object references: two rules of thumb.
void clearAllErrors (  ) [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.

See also:
isValid(), getLastError(), getLastErrorString(), getErrorHandler()
Examples:
common_error.cpp, resfile_error.cpp, and resfile_summary.cpp.
void copyFrom ( const ms_errors right ) [inherited]

Use this member to make a copy of another instance.

Parameters:
rightis the source to initialise from
std::string getDistributor (  ) const

Returns Mascot distributor information.

The distributor will be one of:

  • Unknown
  • Direct
  • Bruker
  • Infocom
  • Kratos
  • Applied Biosystems
  • Mass Solutions Ltd Taiwan
Returns:
the distributor as a string.
std::string getEndDate (  ) const

Returns a date the license is valid until as a string.

Returns:
the license end date as a string in the format YYYYMMDD.
const ms_errs * getErrorHandler (  ) const [inherited]

Retrive the error object using this function to get access to all errors and error parameters.

See Error Handling.

Returns:
Constant pointer to the error handler
See also:
isValid(), getLastError(), getLastErrorString(), clearAllErrors(), getErrorHandler()
Examples:
common_error.cpp, and http_helper_getstring.cpp.
std::string getFeatures (  ) const

Returns a string which encodes feature information.

Returns:
a numerically encoded string.
std::string getFileName (  ) const

Returns a file name being used as a license.

Returns:
The license filename -- full or relative path.
int getLastError (  ) const [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.

See also:
isValid(), getLastErrorString(), clearAllErrors(), getErrorHandler()
Returns:
the error number of the last error, or 0 if there have been no errors.

Reimplemented in ms_mascotresfile.

std::string getLastErrorString (  ) const [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.

Returns:
Most recent error, warning, information or debug message

See Error Handling.

See also:
isValid(), getLastError(), clearAllErrors(), getErrorHandler()

Reimplemented in ms_mascotresfile.

Examples:
common_error.cpp, config_enzymes.cpp, config_fragrules.cpp, config_license.cpp, config_mascotdat.cpp, config_masses.cpp, config_modfile.cpp, config_procs.cpp, config_quantitation.cpp, config_taxonomy.cpp, http_helper_getstring.cpp, and tools_aahelper.cpp.
std::string getLicensee (  ) const

Returns a name of the licensee.

The licensee name will be up to 80 characters long.

Returns:
the licensee as a string.
std::string getLicenseString (  ) const

Returns a compound license string that can be used for displaying license information.

This will be of the following format:

   Licensed to: xxx, (yy processors).

For a temporary license:

    Licensed to: xxx, (yy processors). Demo version expires: zzzz
Returns:
the license string.
Examples:
config_license.cpp.
std::string getLicenseVersion (  ) const

Returns a license version as a string.

The license version number is not directly related to the Mascot version number. It is incremented each time new functionality (and hence extra lines) are added to the license file.

Returns:
The license version number as a string.
int getNumProcessorsLicensed (  ) const

Returns a number of processors licensed.

Returns:
the number of processors licensed.
std::string getStartDate (  ) const

Returns a date the license is valid from as a string.

Returns:
the license start date as a string in the format YYYYMMDD.
bool isLicenseValid (  ) const

Returns TRUE if the license has been sucessfully read, parsed and checked.

If the license is not valid, some information may be available by calling getLastErrorString() or getLastError().

Returns:
true if the license is valid.
Examples:
config_license.cpp.
bool isValid (  ) const [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.

Returns:
True is no fatal error occured
See also:
getLastError(), getLastErrorString(), clearAllErrors(), getErrorHandler()
Examples:
common_error.cpp, config_enzymes.cpp, config_fragrules.cpp, config_license.cpp, config_mascotdat.cpp, config_masses.cpp, config_modfile.cpp, config_procs.cpp, config_quantitation.cpp, config_taxonomy.cpp, http_helper_getstring.cpp, peptide_list.cpp, resfile_summary.cpp, and tools_aahelper.cpp.
void read_file (  )

Main method that reads in the license file.

Deprecated:
Warning: This class just reads licenses for Mascot version 2.4.x and earlier

Called by the constructor if a filename is passed.

void setFileName ( const char *  filename )

Set the license file name explicitly rather than use a default location.

Deprecated:
Warning: This class just reads licenses for Mascot version 2.4.x and earlier

A default location for the license file is ../config/mascot.license. Call this member to change this file name before calling read_file().

Parameters:
filenameThe license filename -- full or relative path.

The documentation for this class was generated from the following files:
Copyright © 2016 Matrix Science Ltd.  All Rights Reserved. Generated on Fri Jun 2 2017 01:44:52