ossim_uint32 ossimKeywordlist::numberOf(const char* prefix, const char* key) const { if (!prefix && key) // Must have key, sometimes no prefix. { return numberOf(key); } ossim_uint32 count = 0; if (prefix && key) { KeywordMap::const_iterator i = m_map.begin(); while (i != m_map.end()) { if ( (*i).first.contains(prefix) && (*i).first.contains(key)) { ++count; } ++i; } } return count; }
ossim_uint32 ossimKeywordlist::numberOf(const char* prefix, const char* key) const { if ( key ) // Must have key, sometimes no prefix. { std::string k(prefix ? (std::string(prefix)+std::string(key)) : key); return numberOf(k.c_str()); } return 0; }
void UmlPackage::import(QString path) { bool manual = path.isEmpty(); if (manual) path = Q3FileDialog::getOpenFileName(QString::null, QString::null, 0, 0, "open xmi/xml file"); if (! path.isEmpty()) { // note : QTextStream(FILE *) bugged under windows FILE * fp = fopen(path, "rb"); if (fp == 0) UmlCom::trace("cannot open " + path); else { QString s = "import " + path + "<br>"; UmlCom::trace(s); FileIn in(path, fp); getProject()->set_childrenVisible(FALSE); init(); importHeader(in); UmlCom::trace(WrapperStr("<br><font face=helvetica>xmi import done<br><br>") + WrapperStr("<font face=helvetica> ") + WrapperStr().setNum(numberOf() - 1) + WrapperStr(" packages </font><br>") + WrapperStr("<font face=helvetica> ") + WrapperStr().setNum(UmlUseCase::numberOf()) + WrapperStr(" use cases </font><br>") + WrapperStr("<font face=helvetica> ") + WrapperStr().setNum(UmlClass::numberOf()) + WrapperStr(" classes </font><br>") + WrapperStr("<font face=helvetica> ") + WrapperStr().setNum(UmlActivity::numberOf()) + WrapperStr(" activities </font><br>") + WrapperStr("<font face=helvetica> ") + WrapperStr().setNum(UmlState::numberOf()) + " states </font><br>" + WrapperStr("<font face=helvetica> ") + WrapperStr().setNum(UmlComponent::numberOf()) + WrapperStr(" components </font><br>") + WrapperStr("<font face=helvetica> ") + WrapperStr().setNum(UmlArtifact::numberOf()) + WrapperStr(" artifacts </font><br>") + WrapperStr("<font face=helvetica> ") + WrapperStr().setNum(UmlNode::numberOf()) + WrapperStr(" deployment nodes </font><br>") + WrapperStr("<font face=helvetica> ") + WrapperStr().setNum(UmlPackage::numberOfProfile()) + WrapperStr(" profiles </font><br>") + WrapperStr("<font face=helvetica> ") + WrapperStr().setNum(UmlClass::numberOfStereotype()) + WrapperStr(" stereotypes </font><br><br>")); if (manual) getProject()->set_childrenVisible(TRUE); } } }
//! read particles matching a specific PDG name and run id from supplied // file. Must supply particle mass ourselves... EventArray* readParticles(const std::string& file, const std::string& particle, const double mass, const std::string& runId) { int resultCode(0); size_t numberOf(0); resultCode = countParticles(file, particle, runId, numberOf); if (resultCode) { std::cerr << "[pp6day3_muonanalysis:error] Failed to count particles in file " << file << std::endl; return 0; } // With number of particles known, create the appropriately sized // EventArray and fill it return createParticles(file, numberOf, particle, mass, runId); }
int ZFan::numberOfConesOfDimension(int d, bool orbit, bool maximal)const { this->ensureComplex(); return numberOf(table(orbit,maximal),d); }