#include <file.h>
Public Member Functions | |
| TransformationManager () | |
| Default constructor. | |
| ~TransformationManager () | |
| Destructor. | |
| void | registerTransformation (const String &pattern, const String &command) |
| Add a new transformation. | |
| void | unregisterTransformation (const String &pattern) |
| Delete a transformation. | |
| String | findTransformation (const String &name) const |
| Find a transformation matching a given file name. | |
| String | transform (const String &name) |
| Apply a suitable transformation to the string. | |
Protected Attributes | |
| std::map< String, String > | transformation_methods_ |
| The map containing all transformation methods. | |
File provides the ability to transform files on the fly using predefined transformation commands (e.g. unix-style filters). For example, compressed files can be automatically decompressed by calling the unic compress command. The respective commands are selectedvia a suitable regular expression, usually matching the file suffix. A frequent application for this transformation is the compressed storage of PDB files in the unix compressed format (*.Z). Transformation manager basically contains a map consisting of two strings. Using findTransformationCommand , File can determine whether there is a suitable transformation command available for a given file name. User-defined transformation may be defined at any time using the registerTransformation method of the static instance of TransformationManager accessible through File::getTransformationManager .
|
|
Apply a suitable transformation to the string.
This first calls findTransformation to determine the command string that should be applied. The
|