![]()
Implementing a File Translator
When creating a file translator, you must derive from the
MPxFileTranslatorclass and consider which types of methods are required for your translator.You need to define certain methods of the class if your translator is an importer or exporter or both. The
MPxFileTranslator::canBeOpened()method is very important as it determines if the translator can open files. If the translator is only used for import, then set the method to returnfalse. Otherwise, thecanBeOpened()method should returntruefor exporters.To implement an importer, you must include the
haveReadMethod()andreader()methods. These two methods determine if the file being imported is readable by your translator.For an exporter, you need to include the
haveWriteMethod()andwriter()methods. These two methods allow you to save the file in a type supported by your translator. These methods are described in more detail later in this documentation.Finally, you must decide on the extension name for your file type.