void TextLineBase::write(XmlWriter& xml) const { if (!xml.canWrite(this)) return; xml.stag(QString("%1 id=\"%2\"").arg(name()).arg(xml.spannerId(this))); writeProperties(xml); xml.etag(); }
void Text::write(Xml& xml) const { if (isEmpty()) return; xml.stag(name()); writeProperties(xml, true); xml.etag(); }
void StaffText::write(XmlWriter& xml) const { if (!xml.canWrite(this)) return; xml.stag("StaffText"); writeProperties(xml); xml.etag(); }
/** Constructor @param create: 1 if we need to create the shared mem. 0 if we connect to it. @param id: the id of the queue */ JobQueue::JobQueue(int create, int id) { memory = new ProtectedSharedMemory(create,MAX_JOB_NUMBER*sizeof(job_descriptor) + sizeof(queue_properties),id); if(create){ queue_properties props = {0,0,0}; writeProperties(props); } }
void JUnitTestOutput::writeTestGroupToFile() { openFileForWrite(createFileName(impl_->results_.group_)); writeXmlHeader(); writeTestSuiteSummery(); writeProperties(); writeTestCases(); writeFileEnding(); closeFile(); }
void EnvDef::writeToFile(File* f, int indent/*=0 */) { #define INDENT Indent(f, ind.c_str()) String ind(indent*2, ' '); INDENT;f->printf("<envDef\n"); writeProperties(f, indent++); INDENT;f->printf("/>\n"); #undef INDENT }
void SimManager::runSimulation() { #ifdef RUNTIME_PROFILING MEASURETIME_REGION_DEFINE(runSimHandler, "runSimulation"); if (MeasureTime::getInstance() != NULL) { MEASURETIME_START(runSimStartValues, runSimHandler, "runSimulation"); } #endif try { Logger::write("SimManager: start simulation at t = " + boost::lexical_cast<std::string>(_tStart),LC_SOLV,LL_INFO); runSingleProcess(); // Zeit messen, Ausgabe der SimInfos ISolver::SOLVERSTATUS status = _solver->getSolverStatus(); if ((status & ISolver::DONE) || (status & ISolver::USER_STOP)) { Logger::write("SimManager: simulation done at t = " + boost::lexical_cast<std::string>(_tEnd),LC_SOLV,LL_INFO); Logger::write("SimManager: number of steps = " + boost::lexical_cast<std::string>(_totStps),LC_SOLV,LL_INFO); writeProperties(); } } catch (std::exception & ex) { Logger::write("SimManager: simulation finish with errors at t = " + boost::lexical_cast<std::string>(_tEnd),LC_SOLV,LL_ERROR); Logger::write("SimManager: number of steps = " + boost::lexical_cast<std::string>(_totStps),LC_SOLV,LL_INFO); writeProperties(); Logger::write("SimManager: error = " + boost::lexical_cast<std::string>(ex.what()),LC_SOLV,LL_ERROR); //ex << error_id(SIMMANAGER); throw; } #ifdef RUNTIME_PROFILING if (MeasureTime::getInstance() != NULL) { MEASURETIME_END(runSimStartValues, runSimEndValues, measureTimeFunctionsArray[1], runSimHandler); } #endif }
void IssueDetailsGenerator::write( HtmlWriter* writer, HtmlText::Flags flags ) { IssueEntity issue = IssueEntity::find( m_issueId ); if ( issue.isValid() ) { writer->writeBlock( issue.name(), HtmlWriter::Header2Block ); writer->createLayout(); QList<ValueEntity> values; if ( dataManager->setting( "hide_empty_values" ) == "1" ) values = issue.nonEmptyValues(); else values = issue.values(); writer->beginCell( HtmlWriter::TopPane, values.isEmpty() ? 2 : 1 ); writeProperties( writer, issue ); if ( !values.isEmpty() ) { writer->beginCell( HtmlWriter::TopPane ); writeAttributes( writer, values, flags ); } if ( m_description ) { DescriptionEntity description = issue.description(); if ( description.isValid() ) { writer->appendLayoutRow(); writer->beginCell( HtmlWriter::BottomPane, 2 ); writer->writeBlock( descriptionLinks( description, flags ), HtmlWriter::FloatBlock ); writer->writeBlock( tr( "Description" ), HtmlWriter::Header3Block ); writer->writeBlock( descriptionText( description, flags ), HtmlWriter::CommentBlock ); } } if ( m_history != NoHistory ) { writer->appendLayoutRow(); writer->beginCell( HtmlWriter::BottomPane, 2 ); if ( !flags.testFlag( HtmlText::NoInternalLinks ) ) writer->writeBlock( historyLinks( flags ), HtmlWriter::FloatBlock ); writer->writeBlock( tr( "Issue History" ), HtmlWriter::Header3Block ); writeHistory( writer, issue, flags ); } writer->endLayout(); } }
void MainWindow::saveInputsAs() { const auto qFileName = QFileDialog::getSaveFileName( this, "Save Input Data File", QSettings().value(InputDataFileNameFromSettings).toString() ); if ( qFileName.isNull() ) // user cancelled? return; const auto fileName = qFileName.toStdString(); std::ofstream file( fileName ); if ( !file.good() ) CU_THROW( "Failed to open the file '" + fileName + "'." ); writeProperties( file, m->serializers ); QSettings().setValue( InputDataFileNameFromSettings, qFileName ); }
void SimManager::runSimulation() { #ifdef RUNTIME_PROFILING MEASURETIME_REGION_DEFINE(runSimHandler, "runSimulation"); if (MeasureTime::getInstance() != NULL) { MEASURETIME_START(runSimStartValues, runSimHandler, "runSimulation"); } #endif try { LOGGER_WRITE("SimManager: Start simulation at t = " + to_string(_tStart), LC_SOLV, LL_INFO); runSingleProcess(); // Measure time; Output SimInfos ISolver::SOLVERSTATUS status = _solver->getSolverStatus(); if ((status & ISolver::DONE) || (status & ISolver::USER_STOP)) { //LOGGER_WRITE("SimManager: Simulation done at t = " + to_string(_tEnd), LC_SOLV, LL_INFO); writeProperties(); } } catch (std::exception & ex) { LOGGER_WRITE("SimManager: Simulation finish with errors at t = " + to_string(_tEnd), LC_SOLV, LL_ERROR); writeProperties(); LOGGER_WRITE("SimManager: Error = " + string(ex.what()), LC_SOLV, LL_ERROR); //ex << error_id(SIMMANAGER); throw; } #ifdef RUNTIME_PROFILING if (MeasureTime::getInstance() != NULL) { MEASURETIME_END(runSimStartValues, runSimEndValues, (*measureTimeFunctionsArray)[1], runSimHandler); } #endif }
/** Pops a job from the queue @param job: the output job being popped @return: 1 if it worked; 0 otherwise */ int JobQueue::popJob(job_descriptor* job) { queue_properties props = readProperties(); if(props.jobCount > 0){ int charIndex = props.tailIndex*sizeof(job_descriptor) + sizeof(queue_properties); memory->read((void*)job,charIndex,sizeof(job_descriptor)); props.tailIndex = props.tailIndex + 1; props.jobCount = props.jobCount - 1; writeProperties(props); return 1; } return 0; }
/** Pushes a job in the queue @param job: the input job being pushed @return: 1 if it worked; 0 otherwise */ int JobQueue::pushJob(job_descriptor* job) { queue_properties props = readProperties(); if(props.jobCount < MAX_JOB_NUMBER){ int charIndex = props.headIndex*sizeof(job_descriptor) + sizeof(queue_properties); memory->write((void*)job,charIndex,sizeof(job_descriptor)); props.headIndex = props.headIndex + 1; props.jobCount = props.jobCount + 1; writeProperties(props); return 1; } return 0; }
void EwsItemShape::write(QXmlStreamWriter &writer) const { writer.writeStartElement(ewsMsgNsUri, QStringLiteral("ItemShape")); // Write the base shape writeBaseShape(writer); // Write the IncludeMimeContent element (if applicable) if (mFlags.testFlag(IncludeMimeContent)) { writer.writeTextElement(ewsTypeNsUri, QStringLiteral("IncludeMimeContent"), QStringLiteral("true")); } // Write the BodyType element if (mBodyType != BodyNone) { QString bodyTypeText; switch (mBodyType) { case BodyHtml: bodyTypeText = QStringLiteral("HTML"); break; case BodyText: bodyTypeText = QStringLiteral("Text"); break; default: //case BodyBest: bodyTypeText = QStringLiteral("Best"); break; } writer.writeTextElement(ewsTypeNsUri, QStringLiteral("BodyType"), bodyTypeText); } // Write the FilterHtmlContent element (if applicable) if (mBodyType == BodyHtml && mFlags.testFlag(FilterHtmlContent)) { writer.writeTextElement(ewsTypeNsUri, QStringLiteral("FilterHtmlContent"), QStringLiteral("true")); } // Write the ConvertHtmlCodePageToUTF8 element (if applicable) if (mBodyType == BodyHtml && mFlags.testFlag(ConvertHtmlToUtf8)) { writer.writeTextElement(ewsTypeNsUri, QStringLiteral("ConvertHtmlCodePageToUTF8"), QStringLiteral("true")); } // Write properties (if any) writeProperties(writer); writer.writeEndElement(); }
void MainWindow::saveInputs() { const auto qFileName = QSettings() .value(InputDataFileNameFromSettings) .toString(); if (qFileName.isNull() || qFileName.isEmpty() ) { saveInputsAs(); return; } std::ofstream file( qFileName.toStdString() ); if ( !file.good() ) { saveInputsAs(); return; } writeProperties( file, m->serializers ); }
/** * @brief Write an object contained in the binary. * @param object Object to decompile * @param pex Binary to decompile. */ void Decompiler::PscCoder::writeObject(const Pex::Object &object, const Pex::Binary &pex) { auto stream = indent(0); stream <<"ScriptName " << object.getName().asString(); if (! object.getParentClassName().asString().empty()) { stream << " extends " << object.getParentClassName().asString(); } if (object.getConstFlag()) stream << " Const"; writeUserFlag(stream, object, pex); write(stream); writeDocString(0, object); if (object.getStructInfos().size()) { write(""); write(";-- Structs -----------------------------------------"); writeStructs(object, pex); } if (object.getProperties().size()) { write(""); write(";-- Properties --------------------------------------"); writeProperties(object, pex); } if (object.getVariables().size()) { write(""); write(";-- Variables ---------------------------------------"); writeVariables(object, pex); } writeStates(object, pex); }
void Text::write(Xml& xml) const { xml.stag(name()); writeProperties(xml, true); xml.etag(); }
void TextLine::write(Xml& xml) const { xml.stag(QString("%1 id=\"%2\"").arg(name()).arg(id())); writeProperties(xml); xml.etag(); }
void TextStyleData::write(Xml& xml) const { xml.stag("TextStyle"); writeProperties(xml); xml.etag(); }
void StaffType::write(Xml& xml, int idx) const { xml.stag(QString("StaffType idx=\"%1\" group=\"%2\"").arg(idx).arg(groupName())); writeProperties(xml); xml.etag(); }
virtual bool writePropertiesTester( DDLNode *node, std::string &statement ) { return writeProperties( node, statement ); }
void Box::write(Xml& xml) const { xml.stag(name()); writeProperties(xml); xml.etag(); }