#include #include #include #include #include #include "node.h" #include "node_util.h" //#include "nexus_util.h" //#include "retriever.h" #include "string_util.h" //#include "xml_parser.h" //#include "Ptr.h" //#include "tree.hh" //#include "nxtranslate_debug.h" using std::cerr; using std::cout; using std::endl; using std::exception; using std::invalid_argument; //using std::map; using std::runtime_error; using std::string; using std::vector; /** * The void pointer passed to this function must have enough space * allocated to be filled with values generated from the string. */ extern void void_ptr_from_string(void *&value, string &char_data, int rank, int *dims, Node::NXtype type){ /* * type | napi4_test | napi5_test | nxbrowse * -----------|---------------|---------------|----------- * NX_CHAR | char | char | char * NX_FLOAT32 | float | float | float * NX_FLOAT64 | double | double | double * NX_INT8 | unsigned char | unsigned char | char * NX_INT16 | short int | short int | short * NX_INT32 | int | int | int * NX_UINT8 | | | unsigned char * NX_UINT16 | | | unsigned short * NX_UINT32 | | | unsigned int */ // REMEMBER: int a[10][20] can be accessed using a[20*row+col] int len=1; for( int i=0 ; i &v_dims, Node::NXtype type){ // local variables to do the work int rank=v_dims.size(); if(type==NX_CHAR) rank=1; int dims[NX_MAXRANK]; if(type==NX_CHAR){ dims[0]=char_data.size(); }else{ for( int i=0 ; i