Prototype for UserFileType objects
function UserFileType (document_type)
To create a file type:
document_type. Document Type string.
file_types Array in OptionsSet object.
A UserFileType object represent a file type as defined in the user interface. A document type is associated to it during construction and cannot change anymore. This document type is used to specify how to edit and compare files of that type.
If the document type has properties which can be defined per file type, the 'options' member contains them.
|Encoding string. If empty, platform default encoding is used. Encoding used when loading files if nothing else could indicate the encoding of a file
|EncodingProperties object. Indicates how to save text files by default.
|Boolean. True if pressing TAB will insert the right number of spaces to reach next tabulation column.
|Integer. Space between two tabulations columns.
|Boolean. True if long lines should be wrapped.
|Filters List. List of filters which may be applied when loading. Currently only XML built-in filters can be used here.
|Filters List. List of filters which may be applied when saving. Currently only XML built-in filters can be used here.
|String. Lines covered by that pattern can be ignored
|String. Lines matching that pattern can be ignored
Found inside UserFileType 'options' member
|String. If not empty, the script is executed each
time the file is reloaded. The script
must be the body of a function taking two parameters
dynamic_fields. The function must
content object and fills
|Array of BinaryDocument.Field objects. These fields can be ignored when comparing binary files.
|Integer. Offset in bytes before which the signature must be found
|Hexadecimal String. If not empty, the signature will be compared to the array of bytes starting at searched position combined with a binary AND operation with this array of bytes coded as hexdecimal digits (e.g. FF00FF makes second byte unimportant is the signature)
|Hexadecimal String. If not empty, the file type is recognized only if the signature is found bewteen signature.start and signature.end positions.
|Integer. Offset in bytes from which the signature is searched
Creates a text file type and adds it to the file types used
by a document:
var ft = new UserFileType ("texts");
ft.label = "C++ files";
ft.patterns = "*.cpp";
var params = mydoc.parameters.clone( );
mydoc.parameters = param;