StrArray<2> NumFlyWeight::GetData() { StrArray<2> ret; ret.Data(m_strValue); ret.Data(m_strUnit,1); return ret; }
void CFourQuadrantDBManager::GetFourQuadrantDB(CalcTable<2> &DBTable, TCHAR *buffer, ueifStream &file) { int i = 0; file.getline(buffer, 50); file.getline(buffer, 50); while (file.getline(buffer, 50)) { CString strFront; CString strBack; CString strSource = buffer; StrArray<2> strArray; if (strTableDBEnd.Compare(strSource) == 0) { i; break; } else { SlipeString(strFront, strBack, buffer); strArray.Data(strFront, 0); strArray.Data(strBack, 1); DBTable.AddItem(strArray); i++; } } }
ErrorStatus::FileError CalcOrificeFace::Save(CalcOrifice &Data,StrArray<5> &Model) { Data.Model(Model.nData(0)); Data.InFlowCD(Model.fData(1)); Data.OutFlowCD(Model.fData(2)); Data.Area(TransStd(Model.Data(3),Model.Data(4))); return ErrorStatus::eFileOK; }
void CFourQuadrantDBManager::GetSqecSpeed(CalcTable<2> &speedTable, ueifStream &file, TCHAR *buffer) { StrArray<2> strArray; file.getline(buffer, 50); strArray.Data(buffer, 0); file.getline(buffer, 50); file.getline(buffer, 50); strArray.Data(buffer, 1); speedTable.AddItem(strArray); }
/*! Reads parameters from global user's arguments */ void HuMoments::Params::ReadFromUserArguments() { StrArray options; options.push_back("I1"); options.push_back("I2"); options.push_back("I3"); options.push_back("I1I2"); options.push_back("I1I3"); g_userArgs.ReadArg("HuMomentsComp", "method", options, "Contour comparison method", 0, &methodId); }
// vyrobit vektor int a naplnit int main(int argc, _TCHAR* argv[]) { StrArray sa; string str; for (int i=0;i<4;++i) { cin >> str; sa.push_back(str); } cout << endl; string rem = "ddd"; StrArray::iterator new_end = remove ( sa.begin(), sa.end(), rem); sa.erase(new_end,sa.end()); for (StrArray::iterator it = sa.begin(); it != sa.end(); ++it) { cout << *it << " "; cout << endl; } /* while (!ia.empty()) { cout << ia.back() << " "; ia.pop_back(); } cout << endl;*/ cout << endl; string x; cin >> x; return 0; }
void CInputToFile::SetDAtaToFile(CalcTable<2> &DBTable) { CString strBuffer; ofstream ofFile(m_strFilePath); GetFilePath(); StrArray<2> temp; IteratorPtr<StrArray<2> > DBPtr(DBTable.CreatIterator()); for(DBPtr->Fist();!DBPtr->IsDone();DBPtr->Next()) { temp = DBPtr->CurrentItem(); strBuffer = temp.Data(0); ofFile<<strBuffer<<_T(","); strBuffer = temp.Data(1); ofFile<<strBuffer<<endl; } }
int main() { char s[10000]; while(true) { cin.getline(s,10000); cout << s << endl; if(s[0]=='E' && s[1]=='N' && s[2]=='D') break; ar.clear(); ar.split(s,' '); parse(); } return 0; }
void PCFPipesMgr::InitNetLink(AcGePoint3d &Pt,EndList &end,int nID) { PCFPipe *pPipe = NULL; StrArray<1> item; IteratorPtr<PCFPipe> PipeitPtr(CreateIt()); for(PipeitPtr->Fist();!PipeitPtr->IsDone();PipeitPtr->Next()) { pPipe = &PipeitPtr->CurrentItem(); ASSERT(pPipe != NULL); if(IsEqual(pPipe->StartPt(),Pt)) { pPipe->InJun(nID); item.Data(-pPipe->GetKey(),0); end.AddItem(item); } if(IsEqual(pPipe->EndPt(),Pt)) { pPipe->OutJun(nID); item.Data(pPipe->GetKey(),0); end.AddItem(item); } } }
void Pipe::SectionInfo(StrArray<8> &array,double dTime) { array.Data(GetKey(),0); array.Data(float(Len()),1); array.Data(float(WaveSpeed()),2); array.Data(float(CalcSection(dTime)),3); int nNum = 0; double dError = 0; double dWave = 0; CalcSection(nNum,dError,dTime); dWave = (Len()/nNum) / dTime; array.Data(nNum,4); array.Data(float(dError),5); array.Data(float(dWave),6); }
void NumFlyWeight::SetData(const StrArray<2> &ref) { m_strValue = ref.Data(); m_strUnit = ref.Data(1); }
int main () { //StrArray h (QSE_NULL, 100); StrArray h (QSE_NULL, 15); char buf[20]; for (int i = 0; i < 20; i++) { sprintf (buf, "hello %d", i); PosStr x (buf); h.insert (0, x); } #if 0 printf ("%s\n", h.get(3).getBuffer()); h.remove (3, 5); printf ("%s\n", h.get(3).getBuffer()); h.remove (3, 5); printf ("%s\n", h.get(3).getBuffer()); #endif printf ("--------------------\n"); for (qse_size_t i = 0; i < h.getSize(); i++) { printf ("[%s] at [%lu]\n", h[i].getBuffer(), (unsigned long int)h.getIndex(h[i])); } printf ("--------------------\n"); StrArray h2 (h); StrArray h3; h3 = h2; h.clear (true); printf ("--------------------\n"); printf ("%d\n", (int)h.getSize()); printf ("--------------------\n"); for (qse_size_t i = 0; i < h2.getSize(); i++) { printf ("[%s] at [%lu]\n", h2[i].getBuffer(), (unsigned long int)h2.getIndex(h2[i])); } printf ("--------------------\n"); h3.insert (21, "this is a large string"); printf ("%d %d\n", (int)h2.getSize(), (int)h3.getSize()); printf ("--------------------\n"); h3.insert (21, "mystery!"); for (qse_size_t i = 0; i < h3.getSize(); i++) { printf ("[%s] at [%lu]\n", h3[i].getBuffer(), (unsigned long int)h3.getIndex(h3[i])); } printf ("--------------------\n"); h3.setCapacity (6); h3.insert (6, "good?"); h3.rotate (StrArray::ROTATE_RIGHT, h3.getSize() / 2); printf ("[%s] [%s]\n", h3.getValueAt(5).getBuffer(), h3.getValueAt(6).getBuffer()); printf ("%d\n", (int)h3.getSize()); printf ("--------------------\n"); h3.insert (1, "bad?"); for (qse_size_t i = 0; i < h3.getSize(); i++) { printf ("[%s] at [%lu]\n", h3[i].getBuffer(), (unsigned long int)h3.getIndex(h3[i])); } printf ("--------------------\n"); QSE::Array<int> a; a.insert (0, 10); a.insert (0, 20); a.insert (0, 30); const int& t = a[2u]; printf ("%lu\n", (unsigned long int)a.getIndex(t)); return 0; }