static bool EndScript(const char *text) { char *temp = UpperCase (text); bool code = !strcmp("</SERVER>", temp) || !strcmp("</SCRIPT>", temp); delete[] temp; return code; }
// removes punctuation from the input // and do some more preprocessing void Eliza::preProcessInput() { if(m_sInput.length() > 0) { tok.cleanString(m_sInput, " ?!,;"); trimRight(m_sInput, '.'); UpperCase(m_sInput); m_sInput.insert(0, " "); m_sInput.append(" "); } }
bool CompareExt(char *filename, char *ext, bool cs=false) { if (cs) { char *file_ext = Ext(filename); LowerCase(ext); if (strcmp(file_ext, ext) == 0) return true; UpperCase(ext); if (strcmp(file_ext, ext) == 0) return true; return false; } else { return ( strcmp( Ext(filename), ext ) == 0 ); } }
CString CVirtualTarget::Name(const CString& Prefix) const { switch (m_NameCase) { default: case 0: return Prefix+m_MFName; case 1: return LowerCase(Prefix)+m_LCName; case 2: return UpperCase(Prefix)+m_UCName; } }
CString CBuildTarget::Name(const CString& Prefix, const int Case) const { switch (Case) { default: case 0: return Prefix+m_MFName; case 1: return LowerCase(Prefix)+m_LCName; case 2: return UpperCase(Prefix)+m_UCName; } }
void ParseCommandLine() { TRY_CATCH int nArgc = 0; // Extract arguments from command line PTCHAR* pArgs = CHelper::CommandLineToArgv( GetCommandLine(), &nArgc ); if (!pArgs) return; // Create shared pointer for auto destroy pArgs handle boost::shared_ptr< boost::remove_pointer<HGLOBAL>::type > spArgs((HGLOBAL)pArgs, GlobalFree); tstring param(_T("")); while(*(++pArgs)) { param.assign(*pArgs); tstring paramName = param.substr(0, 3); paramName = UpperCase(paramName); param.erase(0, 3); if(!paramName.compare(_T("-P="))) { SETTINGS_INSTANCE.SetLocalPort(atoi(param.c_str())); } else { if(!paramName.compare(_T("-GT"))) { SETTINGS_INSTANCE.SetUseGarbageThread(true); } else { if(!paramName.compare(_T("-T="))) { SETTINGS_INSTANCE.SetTestTime(atoi(param.c_str())); } else { if(!paramName.compare(_T("-SG"))) { SETTINGS_INSTANCE.SetSendGarbage(true); } } } } } return; CATCH_THROW() }
void ParseCommandLine() { TRY_CATCH int nArgc = 0; // Extract arguments from command line PTCHAR* pArgs = CHelper::CommandLineToArgv( GetCommandLine(), &nArgc ); if (!pArgs) return; // Create shared pointer for auto destroy pArgs handle boost::shared_ptr< boost::remove_pointer<HGLOBAL>::type > spArgs((HGLOBAL)pArgs, GlobalFree); tstring param(_T("")); while(*(++pArgs)) { param.assign(*pArgs); tstring paramName = param.substr(0, 3); paramName = UpperCase(paramName); param.erase(0, 3); if( !paramName.compare(_T("-A=")) ) SETTINGS_INSTANCE.SetRemoteAddr(param); else if( !paramName.compare(_T("-P=")) ) SETTINGS_INSTANCE.SetRemotePort(atoi(param.c_str())); else if( !paramName.compare(_T("-F=")) ) SETTINGS_INSTANCE.SetFramesFileName(param); else if( !paramName.compare(_T("-AS")) ) SETTINGS_INSTANCE.SetClientAutoStart(true); else if( !paramName.compare(_T("-R=")) ) SETTINGS_INSTANCE.SetResultsFileName(param); else if( !paramName.compare(_T("-AE")) ) SETTINGS_INSTANCE.SetAnalyzeEmptySpace(true); else if( !paramName.compare(_T("-M=")) ) SETTINGS_INSTANCE.SetDisplayMode(atoi(param.c_str())); else if ( !paramName.compare(_T("-MS")) ) SETTINGS_INSTANCE.SetMultiplexMode(true); } return; CATCH_THROW() }
CString CVirtualTarget::Name(const CString& Prefix, const int TargetIndex) const { CString name = MakefileFriendly(m_Targets.GetString(TargetIndex)); switch (m_NameCase) { default: case 0: return name; case 1: return LowerCase(name); case 2: return UpperCase(name); } }
//--------------------------------------------------------------------------- void __fastcall TfrmMain::KillClient(AnsiString ClientName) { TSimpleClient* Client; TIdPeerThread* peerthread; ClientName=UpperCase(ClientName); int Count; int matchfound=0; for ( Count = 0; Count < lbClients->Items->Count; Count++) { if (Count < Clients->Count) {Client=(TSimpleClient*)Clients->Items[Count]; if (UpperCase(Client->Name) ==ClientName) { matchfound=true; break; } } } if (matchfound==0) { ShowMessage("Error Finding Client"); return; } peerthread=(TIdPeerThread*)Client->Thread; try { peerthread->Connection->Disconnect(); } catch (...) { } }
CloseSource(src); if (InitSource(src->name,src,filter)==FAIL) { HError(15299, "NumLines: Unable to reopen file '%s'", src->name); }; return count; }
//--------------------------------------------------------------------------- // This event handler is called when the data session for a get file has // been opened. This is a good place build a file or a stream if the data // requested is not already stored in a file on the file system. // This feature is very powerfull and enable the FTP protocol to be used to // retrieve any kind of data. It this sample, we just check for C:\VIRTUAL // directory. If this directory is curent, then a TMemoryStream is created // on the fly with some data. If another directory is selected, the FTP // server works as any other: just send the requested file, if it exist ! // This event handler is also a place where you can abort the file transfer. // Simply trigger an exception and transfer will not take place. // Note that if you just wants to prohibe access to some directory or file, // the best place to code that is in the OnValidateGet or OnValidatePut // event handlers. void __fastcall TFtpServerForm::FtpServer1RetrSessionConnected( TObject *Sender, TFtpCtrlSocket *Client, TWSocket *Data, WORD Error) { AnsiString Buf; if (Error) InfoMemo->Lines->Add("! " + Client->GetPeerAddr() + " Data session connected. Error #" + IntToStr(Error)); else if (UpperCase(Client->FilePath).SubString(1, 19) == "C:\\VIRTUAL\\FORBIDEN") throw Exception("Access prohibed !"); else if (UpperCase(Client->FilePath).SubString(1, 11) == "C:\\VIRTUAL\\") { InfoMemo->Lines->Add("! VIRTUAL FILE"); Client->UserData = 1; // Remember we created a stream if (Client->DataStream) delete Client->DataStream; // Prevent memory leaks Client->DataStream = new TMemoryStream; Buf = "This is a file created on the fly by the FTP server\r\n" "It could result of a query to a database or anything else.\r\n" "The request was: \"" + Client->FilePath + "\"\r\n"; Client->DataStream->Write(&Buf[1], Buf.Length()); Client->DataStream->Seek(0, 0); } }
//--------------------------------------------------------------------------- void __fastcall TfrmParolaDegistir::BitBtn1Click(TObject *Sender) { if (UpperCase(frmSifre->querySIFREKONTROLPAROLA->Value) == UpperCase(editESKIPAROLA->Text)) { if (UpperCase(editYENIPAROLA->Text) == UpperCase(editYENIPAROLAONAY->Text)) { frmYoneticiModulu->tblYONETICI->Open(); frmYoneticiModulu->tblYONETICI->Filtered = true; frmYoneticiModulu->tblYONETICI->Filter = "[KULLANICI]='"+ frmSifre->querySIFREKONTROLKULLANICI->Value+"'"; frmYoneticiModulu->tblYONETICI->Edit(); frmYoneticiModulu->tblYONETICIPAROLA->Value = editYENIPAROLA->Text; frmYoneticiModulu->tblYONETICI->Edit(); frmYoneticiModulu->tblYONETICIPAROLA_ONAY->Value = editYENIPAROLAONAY->Text; frmYoneticiModulu->tblYONETICI->Post(); frmYoneticiModulu->tblYONETICI->Filtered = false; frmYoneticiModulu->tblYONETICI->Close(); Application->MessageBoxA("Parola baþarýyla deðiþtirildi...", "Uyarý Mesajý", MB_OK + MB_ICONEXCLAMATION); frmParolaDegistir->Close(); } else { Application->MessageBoxA("Yeni girilen paralolar uyumsuz...", "Uyarý Mesajý", MB_OK + MB_ICONEXCLAMATION); } } else { Application->MessageBoxA("Eski parolanýzý doðru girmediniz !..", "Uyarý Mesajý", MB_OK + MB_ICONEXCLAMATION); } }
//--------------------------------------------------------------------------- // This event handler is called by the FTP component once it has built the // directory listing. We can use this handler to alter the listing, adding // or removing some info. This sample add the 'virtual' directory. void __fastcall TFtpServerForm::FtpServer1AlterDirectory(TObject *Sender, TFtpCtrlSocket *Client, TFtpString &Directory, bool Detailed) { AnsiString Buf; if (UpperCase(Client->Directory) != "C:\\") return; // Add our 'virtual' directory to the list if (Detailed) { // We need to format directory lines according to the Unix standard Buf = "drwxrwxrwx 1 ftp ftp 0 Apr 30 19:00 VIRTUAL\r\n"; Client->DataStream->Write(&Buf[1], Buf.Length()); } }
BasicSymbol *Command::Read (const string &str, InputFile &inp) { BasicSymbol *s; string UppercaseName (str); UpperCase (UppercaseName); s = Instruction::Read (UppercaseName, inp); if (s != 0) return s; s = Directive::Read (UppercaseName, inp); if (s != 0) return s; s = PrefixInstruction::Read (UppercaseName, inp); return s; }
//Prepare Header for Browser string ConnectionToHTTP::PrepareHeaderForBrowser() { string header; header.reserve(20000); header = ""; vector<string>::iterator itvec; string it; it.reserve(200); //Strip unwanted headers to browser for (itvec = tokens.begin(); itvec != tokens.end(); ++itvec) { //Uppercase for matching it = UpperCase(*itvec); if ( MatchBegin( it, "KEEP-ALIVE", 10 ) ) { continue; } else if ( MatchBegin( it, "CONNECTION", 10 ) ) { continue; } else if ( MatchBegin( it, "PROXY-CONNECTION", 16 ) ) { continue; } else if ( MatchBegin( it, "CONTENT-LENGTH", 14 ) && (ContentLength == -1) ) { //Do not pass invalid Content-Length continue; } else if ( MatchBegin( it, "TRANSFER-ENCODING", 17 ) ) { continue; } header += *itvec; header += "\r\n"; } return header; }
//-- // // ReadFile // //-- // Read mesh from a file bool Mesh::ReadFile( const std::string& file_name ) { FileFormat file_format(UNKNOWN_FILE); // Find file extension int pos = file_name.find_last_of('.'); if( pos == -1 ) { // File has no extension return false; } // Format extension string std::string extension = UpperCase( file_name.substr( ++pos ) ); // WRL extension if( extension == "WRL" ) { // // Check VRML file version // std::ifstream file(file_name.c_str()); if( file.is_open() == false ) return false; std::string word; file>>word; if( word != "#VRML" ) { file.close(); return false; } file>>word; file.close(); if( word == "V1.0" ) { file_format = VRML_1_FILE; } else if( word == "V2.0" ) { file_format = VRML_2_FILE; } else { return false; } }
static void AddMovieTemplateCB(void *cbdata, const std::string &filename, bool isDir, bool canAccess, long size) { if(!isDir && canAccess) { std::string ext(filename.substr(filename.size() - 3, filename.size()-1)); UpperCase(ext, ext); if(ext == ".MT") { void **arr = (void **)cbdata; MovieTemplateFileList *fl = (MovieTemplateFileList *)arr[0]; int onoff = (int)((long)arr[1]); fl->filenames.push_back(filename); fl->userDefined.push_back(onoff ? true : false); } } }
static ConfParam *cParm[MAXGLOBS]; /* config parameters */ static int nParm = 0; static MemHeap hashTableHeap; /* heap for hash tables */ /* --------------------- Initialisation --------------------- */ /* EXPORT -> InitWMap: initialise the module */ void InitLUtil(void)
void CVirtualTarget::Read(const TiXmlElement *TargetRoot) { char *value = 0; if ((value = (char *)TargetRoot->Attribute("alias"))) { m_Alias = value; } if ((value = (char *)TargetRoot->Attribute("targets"))) { ParseStr(value,';',m_Targets); m_Targets.RemoveEmpty(); } // decorate target name { m_MFName = MakefileFriendly(m_Alias); m_UCName = UpperCase(m_MFName); m_LCName = LowerCase(m_MFName); } }
string ofxEliza::ask(string _inputString){ // gets input from the user save_prev_input(); m_sInput = _inputString; saveLog("USER"); // Finds and display a response // to the current input of the user. // removes punctuation from the input // and do some more preprocessing if(m_sInput.length() > 0) { tok.cleanString(m_sInput, " ?!,;"); trimRight(m_sInput, '.'); UpperCase(m_sInput); m_sInput.insert(0, " "); m_sInput.append(" "); } save_prev_responses(); save_prev_response(); if(null_input()) { handle_null_input(); } else if(user_repeat()) { handle_user_repetition(); } else if(short_input()) { handle_short_input(); } else { reset_repeat_count(); reset_short_input_count(); find_response(); } select_response(); preProcessResponse(); handle_repetition(); saveLog("ELIZA"); return m_sResponse; }
//--------------------------------------------------------------------------- bool TConfigElement::initialise( String sect ) { if ( config ) { name = sect; std::string noprog = "nOpRoGrAm"; commandLine = config->ReadString( sect, "program", noprog.c_str() ).c_str(); params = config->ReadString( sect, "params", "" ).c_str(); if ( commandLine == noprog ) { // ConfigForm->logMessage( ("No program configured ([" + sect + "]program=xxxx)").c_str() ); return false; } String S = UpperCase( config->ReadString( sect, "Run", "Yes" ) ).Trim(); run = !( S[ 1 ] == 'N' || S[ 1 ] == 'F' || S[ 1 ] == '0' ); rundir = config->ReadString( sect, "Directory", "" ).Trim().c_str(); return true; } return false; }
} CreateHeap(&hashTableHeap,"hashTableHeap",MSTAK,1,0.5,5000,20000); } /* ----------- HLM Header Type and Operations -------------- */ typedef struct hdrField{ char * name; char * value; struct hdrField * next; } HdrField; typedef struct lmFileHdrRec { MemHeap *mem; int numFields; struct hdrField *list; }LMFileHdrRec; /* NumLines: return num lines remaining in source and rewind it */ static int NumLines(Source *src, IOFilter filter)
//--------------------------------------------------------------------------- // This event handler is called when the FTP component needs to build a // directory listing. You can just return without doing anything then the // component will build the directory for you, based on the actual disk // content. But you can also build your own directory listing with anything // you like in it. Just create a stream with the required content. The // example below construct a virtual directory when the user is on the // C:\VIRTUAL subdirectory (use elsewhere in this sample program). void __fastcall TFtpServerForm::FtpServer1BuildDirectory(TObject *Sender, TFtpCtrlSocket *Client, TFtpString &Directory, bool Detailed) { AnsiString Buf; if (UpperCase(Client->Directory) != "C:\\VIRTUAL\\") return; InfoMemo->Lines->Add("! VIRTUAL DIR"); Client->UserData = 1; // Remember we created a stream if (Client->DataStream) delete Client->DataStream; // Prevent memory leaks Client->DataStream = new TMemoryStream; if (Detailed) // We need to format directory lines according to the Unix standard Buf = "-rwxrwxrwx 1 ftp ftp 0 Apr 30 19:00 FORBIDEN\r\n" "-rwxrwxrwx 1 ftp ftp 0 Apr 30 19:00 TEST\r\n" "drwxrwxrwx 1 ftp ftp 0 Apr 30 19:00 SOME DIR\r\n"; else Buf = "FORBIDEN\r\nTEST\r\r"; Client->DataStream->Write(&Buf[1], Buf.Length()); Client->DataStream->Seek(0, 0); }
void op_xtd() { /* Stack: |=============================|=============================| | BEFORE | AFTER | |=============================|=============================| top | Input string | Converted value | |=============================|=============================| */ DESCRIPTOR * descr; char s[20+1]; /* 0493 */ char * p; /* 0493 */ int n; register u_char c; /* Get and convert value */ descr = e_stack - 1; if (k_get_c_string(descr, s, 20) <= 0) goto exit_op_xtd; n = 0; for(p = s; (c = UpperCase(*p)) != '\0'; p++) { if ((c >= '0') && (c <= '9')) n = (n * 16) + (c - '0'); else if ((c >= 'A') && (c <= 'F')) n = (n * 16) + (c - 'A' + 10); else goto exit_op_xtd; } k_dismiss(); InitDescr(e_stack, INTEGER); (e_stack++)->data.value = n; exit_op_xtd: return; }
/** * CHaracter added */ void FbEditor::onCharAdded(wxStyledTextEvent & event) { int p = GetCurrentPos(); auto w = GetTextRange(WordStartPosition(p, true), p); if (w.length() < 2) return; w.UpperCase(); wxString words = ""; int count = 0; for (auto id : m_srcCtx->getIdentifiers(LineFromPosition(p), p - LineFromPosition(p))) { wxString ID(id); ID.UpperCase(); if (ID.compare(0, w.length(), w) == 0) { if (ID.length() == w.length()) continue; words += id + " "; count++; } } if (count > 0) { AutoCompShow((int)w.Length(), words); } }
Private void itype() { /* Stack: |=============================|=============================| | BEFORE | AFTER | |=============================|=============================| top | ADDR to object code | Result | |=============================|=============================| */ DESCRIPTOR * descr; STRING_CHUNK * str; char * p; short int i; int n; u_char type; unsigned short int header_flags; OBJECT_HEADER * obj; /* Find I-type code. An I-type must be referenced via an ADDR as we are going to pop the pointer and use the actual string. Anything else would require that we dereference the string on leaving the I-type program. This implies that an I-type must be a variable or an array reference, not a field extraction, etc. */ descr = e_stack - 1; if (descr->type != ADDR) k_error(sysmsg(1470)); do {descr = descr->data.d_addr;} while(descr->type == ADDR); k_get_string(descr); descr->data.str.saddr = s_make_contiguous(descr->data.str.saddr, NULL); str = descr->data.str.saddr; if (str == NULL) goto inva_i_type; p = str->data; type = UpperCase(*p); if ((type == 'I') || (type == 'C') || (type == 'A') || (type == 'S')) { /* It's a complete dictionary record */ for(i = 15; i--;) /* Skip 15 field marks */ { p = strchr(p, FIELD_MARK); if (p == NULL) goto inva_i_type; p++; } } if (*p != HDR_MAGIC) { if (*p == HDR_MAGIC_INVERSE) convert_object_header((OBJECT_HEADER *)p); if (*p != HDR_MAGIC) goto inva_i_type; } k_pop(1); if (((long int)p) & 0x00000003) { /* Not word aligned - must make a copy. To ensure that this gets released at an abort, we push a string descriptor onto the stack */ n = str->bytes - (p - str->data); k_put_string(p, n, e_stack); obj = (OBJECT_HEADER *)((e_stack++)->data.str.saddr->data); header_flags = obj->flags; k_recurse((u_char *)obj, 0); if (header_flags & HDR_CTYPE) /* 0560 */ { k_release(e_stack - 1); } else { k_release(e_stack - 2); *(e_stack - 2) = *(e_stack - 1); } e_stack--; } else { header_flags = ((OBJECT_HEADER *)p)->flags; k_recurse((u_char *)p, 0); } /* If this is a C-type, load @ANS on to the stack */ if (header_flags & HDR_CTYPE) { *e_stack = *(Element(process.syscom, SYSCOM_AT_ANS)); if (e_stack->type >= COMPLEX_DESCR) k_incr_refct(e_stack); e_stack++; } return; inva_i_type: k_recurse(pcode_itype, 1); if (process.status == ER_INVA_ITYPE) k_error(sysmsg(1471)); }
void main(int argc, char *argv[]) { register int i, k; char inputLine[MAX_REC_LENGTH+1], *commentChar = COMMENT_CHAR, *atomID, *spectrum, *label, *ptr, *Jstr, *term1, *term2, *Estr; int Nlevel, Nread, Ntemp, n, J; float E, g, *kT, *pf; FILE *fp_NIST; struct NIST_Level *levels, *nl; commandline.quiet = FALSE; commandline.logfile = stderr; if (argc < 2) { fprintf(stderr, "Usage: %s inFile E0\n", argv[0]); exit(0); } /* --- Open the data file for model atom -- -------------- */ if ((fp_NIST = fopen(argv[1], "r")) == NULL) { sprintf(messageStr, "Unable to open input file %s", argv[1]); Error(ERROR_LEVEL_2, argv[0], messageStr); } Nlevel = 0; while (fgets(inputLine, MAX_REC_LENGTH, fp_NIST) != NULL) if (*inputLine != *commentChar) Nlevel++; printf("Found %d levels in NIST input file %s\n\n", Nlevel, argv[1]); rewind(fp_NIST); levels = (struct NIST_Level *) malloc(Nlevel * sizeof(struct NIST_Level)); nl = levels; while (fgets(inputLine, MAX_REC_LENGTH+1, fp_NIST) != NULL && nl < levels + Nlevel-1) { if (*inputLine != *commentChar) { atomID = strtok(inputLine, " "); spectrum = strtok(NULL, " "); label = strtok(NULL, " "); UpperCase(atomID); for (i = 0; i < strlen(label); i++) if (*(label+i) == '.') *(label+i) = ' '; UpperCase(label); if (strcmp(spectrum, "I") == 0) nl->stage = 0; else if (strcmp(spectrum, "II") == 0) nl->stage = 1; else if (strcmp(spectrum, "III") == 0) nl->stage = 2; term1 = strtok(NULL, " "); term2 = strtok(NULL, " "); Jstr = strtok(NULL, " "); if (strstr(Jstr, "/")) { sscanf(Jstr, "%d/", &J); nl->g = J + 1.0; } else { sscanf(Jstr, "%d", &J); nl->g = 2.0*J + 1.0; } /* --- Parity, @ if odd, blank if even -- -------------- */ Estr = strtok(NULL, " "); if (strstr(Estr, "@")) { nl->parity = 1; Estr = strtok(NULL, " "); } else nl->parity = 0; nl->E = atof(Estr) * (HPLANCK * CLIGHT) / CM_TO_M; sprintf(nl->label, "%2s %s %-8.8s %2.2s%1s", atomID, spectrum, label, term2, (nl->parity) ? "O" : "E"); nl++; } } Ntemp = argc - 2; kT = (float *) malloc(Ntemp * sizeof(float)); for (k = 0; k < Ntemp; k++) kT[k] = 1.0 / (KBOLTZMANN * atof(argv[k+2])); pf = (float *) calloc(Ntemp, sizeof(float)); for (i = 0; i < Nlevel-1; i++) { nl = levels + i; if (nl->stage == levels[0].stage) { for (k = 0; k < Ntemp; k++) { /* printf("%s -> %e\n", nl->label, nl->g * exp(-nl->E * kT[k])); */ pf[k] += nl->g * exp(-nl->E * kT[k]); } } } for (k = 0; k < Ntemp; k++) printf(" T = %f pf = %e\n", 1.0/(KBOLTZMANN*kT[k]), pf[k]); }
void preprocess_input(std::string &str) { cleanString(str); UpperCase(str); }
void WrapUCase (TomVM& vm) { vm.RegString () = UpperCase (vm.GetStringParam (1)); }
void RNAFuncs::printMAliXML(deque<pair<double,RNAProfileAlignment*> > &resultList,const RNAforesterOptions &options, double &minPairProb,AddXmlInfos &xmlInfos,const string &outputFile) { string xsdurl = getXSDURL(); int j; // get RNAforester call const char** args; int nrOptions; string command; args = options.getArgs(); nrOptions = options.getNrOfOptions(); for(int i=0;i<nrOptions;i++) { command.append(args[i]); command.append(" "); } try { xmlpp::Document document; deque<pair<string,string> > seqAli; deque<string> strAli; string consSeq, consStr; deque<double> baseprobs; deque<pair<pair<int,int>,double> > pairprobs; stringstream tmpBase; //create root node xmlpp::Element* nodeRoot = document.create_root_node("rnastructAlignmentML", "", ""); //set namespace declarations to root element nodeRoot->set_namespace_declaration(xsdurl, ""); nodeRoot->set_namespace_declaration("http://www.w3.org/2001/XMLSchema-instance","xsi"); nodeRoot->set_attribute("schemaLocation",xsdurl + " http://bibiserv.techfak.uni-bielefeld.de/xsd/net/sourceforge/hobit/20060515/rnastructAlignmentML.xsd","xsi"); // N VALues in the deque are n cluster deque<pair<double,RNAProfileAlignment*> >::const_iterator it; for(it=resultList.begin();it!=resultList.end();it++) { // create node rnastructalignment xmlpp::Element* nodeRnaStructAlignment = nodeRoot->add_child("rnastructurealignment"); //print aligned sequences and structures seqAli = it->second->getSeqAli(); strAli = it->second->getStrAli(); // j iterator to get structure alignment j=0; deque<pair<string,string> >::const_iterator it2; for(it2=seqAli.begin();it2!=seqAli.end();it2++) { xmlpp::Element* nodeSequence = nodeRnaStructAlignment->add_child("sequence"); nodeSequence->set_attribute("seqID",xmlInfos.idmapping[atoi(it2->first.c_str())]); if(xmlInfos.names.count(atoi(it2->first.c_str())) > 0){ nodeSequence->add_child("name")->set_child_text(xmlInfos.names[atoi(it2->first.c_str())]); } if(xmlInfos.synonyms.count(atoi(it2->first.c_str())) > 0){ nodeSequence->add_child("synonyms")->set_child_text(xmlInfos.synonyms[atoi(it2->first.c_str())]); } if(xmlInfos.descriptions.count(atoi(it2->first.c_str())) > 0){ nodeSequence->add_child("description")->set_child_text(xmlInfos.descriptions[atoi(it2->first.c_str())]); } xmlpp::Element* nodeAlignedFreeSequence = nodeSequence->add_child("alignedFreeSequence"); nodeAlignedFreeSequence->set_child_text(UpperCase(it2->second)); xmlpp::Element* nodeStructure = nodeSequence->add_child("structure"); nodeStructure->set_child_text(strAli[j]); if(xmlInfos.comments.count(atoi(it2->first.c_str())) > 0){ nodeSequence->add_child("comment")->set_child_text(xmlInfos.comments[atoi(it2->first.c_str())]); } j++; } // insert consensus element xmlpp::Element* nodeConsensus = nodeRnaStructAlignment->add_child("consensus"); // get and insert structure pairprobs it->second->getPairProb(minPairProb, pairprobs); xmlpp::Element* nodeStrProbs = nodeConsensus->add_child("structureprobabilities"); deque<pair<pair<int,int>,double> >::iterator it3; for(it3=pairprobs.begin();it3!=pairprobs.end();it3++) { xmlpp::Element* nodePt = nodeStrProbs->add_child("pt"); tmpBase << it3->first.first; nodePt->set_attribute("a",tmpBase.str()); tmpBase.str(""); tmpBase << it3->first.second; nodePt->set_attribute("b",tmpBase.str()); tmpBase.str(""); tmpBase << it3->second; nodePt->set_attribute("probability",tmpBase.str()); tmpBase.str(""); } // get and insert consensus sequence consSeq = it->second->getConsSeq(); xmlpp::Element* nodeConsSeq = nodeConsensus->add_child("sequence"); nodeConsSeq->set_attribute("seqID","consensus"); xmlpp::Element* nodeAlignedFSCons = nodeConsSeq->add_child("alignedFreeSequence"); nodeAlignedFSCons->set_child_text(UpperCase(consSeq)); // get and insert consensus structure consStr = it->second->getConsStr(minPairProb); xmlpp::Element* nodeConsStr = nodeConsSeq->add_child("structure"); nodeConsStr->set_child_text(consStr); //xmlpp::Element* nodeConsStr = nodeConsensus->add_child("structure"); //nodeConsStr->set_child_text(consStr); // insert nodes program and attribute command xmlpp::Element* nodeProgram = nodeRnaStructAlignment->add_child("program"); nodeProgram->set_attribute("command",command); } // end for document.write_to_file("./" + outputFile,"UTF-8"); // display the mapping from the internal id to the name of the sequence / structure qualified in the name element in the rnastructML if(xmlInfos.xmlInput){ printMapping(xmlInfos.idmapping); } } catch(const std::exception& ex) { cout << "xml exception: " << ex.what() << std::endl; } }