#include "api1/Cipres.idl" module CipresIDL_api1 { exception NexusException { string errorMsg; string fileName; long filePos; long lineNumber; }; interface ReadNexus: Scriptable, LifeCycle { /* These constants should not be changed without alerting the phycas dev team We are using them, but have them mirrored so that we don't include CORBA-dependent files. */ /* bits used in the blocksToRead arg of readNexusFile. Turning off bits can result in faster parsing of a file and lower memory requirements (for instance if you know that you do not need the matrix, the CHARACTERS block bit can be set to 0, and the block will be skipped).*/ const short NEXUS_TAXA_BLOCK_BIT = 0x01; const short NEXUS_TREES_BLOCK_BIT = 0x02; const short NEXUS_CHARACTERS_BLOCK_BIT = 0x04; const short NEXUS_ASSUMPTIONS_BLOCK_BIT = 0x08; const short NEXUS_SETS_BLOCK_BIT = 0x10; /* block to index mapping used in the NumBlockReadSequence sequence returned by readNexusFile */ const short NEXUS_TAXA_BLOCK_INDEX = 0; const short NEXUS_TREES_BLOCK_INDEX = 1; const short NEXUS_CHARACTERS_BLOCK_INDEX = 2; const short NEXUS_ASSUMPTIONS_BLOCK_INDEX = 3; const short NEXUS_SETS_BLOCK_INDEX = 4; /* Sequence that describes how many blocks of each type were read. The indexing uses the constants above which end in _INDEX */ typedef sequence NumBlockReadSequence; /* Reads the NEXUS file found at the URL described by filePath - currently this must be a local file */ NumBlockReadSequence readNexusFile(in string filePath, in short blocksToRead) raises (NexusException); /* Reads a string as if it were a NEXUS file */ NumBlockReadSequence readStringAsNexus(in string nexusContent, in short blocksToRead) raises (NexusException); DataMatrix getCharacters(in short charactersBlockIndex); TaxonInfoSeq getTaxa(in short taxaBlockIndex); TreeSeq getTrees(in short treesBlockIndex); }; };