예제 #1
0
void Pessoa::loadPessoa(fstream& inFile) //carrega a pessoa de um ficheiro
{
	string nome_, BI_;
	unsigned int numAlugueresON, aluguerID;

	getline(inFile,nome_);
	getline(inFile,BI_);
	setNome(nome_);
	setBI(BI_);
	Data* d = new Data();
	d->loadData(inFile);
	setData(d);

	Contato* c = new Contato();
	c->loadContato(inFile);
	setContato(c);

	inFile >> alugueres_realizados;
	inFile.ignore(1,'\n');

	inFile >> numAlugueresON;
	while ( numAlugueresON > 0 )
	{
		inFile >> aluguerID;
		IDs_alugueres.push_back(aluguerID);
		numAlugueresON--;
	}
	inFile.ignore(10,'\n');
}
void Kierownik::Scan(fstream &plik, string os)
{
	getline(plik, Imie, ';');
	getline(plik, Nazwisko, ';');
	plik >> Sta¿;
	plik.ignore();
	getline(plik, Ulica, ';');
	getline(plik, Numer, ';');
	getline(plik, Kod, ';');
	getline(plik, MiejscowoϾ, ';');
	plik >> liczbaPracowników;
	plik.ignore();
	Etat = kierownik;
}
예제 #3
0
   /**************************************************************
    *
    * * Entry: a file with something in it, preferably at some point in it
    *          combinations of alpha characters separated by spaces on one or
    *          both sides, and comprised of intelligible words.
    *
    * * Exit: wordSet is filled with unique and sorted strings
    *          alpha only, lowercase, excluding ones greater than max length
    *
    * * Purpose: to parse a file into WORDS, for dictionary data set
    *
    *
    * ***************************************************************/
   void ReadFromFile ( fstream &instream , set<string> &wordSet ,
         const int MaxWordLength ) {

      string nextWord;

      while ( !instream.eof() ) {
         while ( !swansonString::IsALetter( (instream.peek()) ) ) {
            instream.ignore( 1 );
         }
         string nextWord;
         getline( instream , nextWord , ' ' );
         //check last character for alpha // for !.?"
         while ( !swansonString::IsALetter( nextWord.at( nextWord.size() - 1 ) ) ) {
            nextWord.erase( nextWord.size() - 1 , 1 ); // delete last character
         }

         if ( !nextWord.empty() && swansonString::AllLetters( nextWord ) ) {

            nextWord = swansonString::LowerCase( nextWord );
            wordSet.insert( nextWord );

         }

      }

   }
예제 #4
0
   void ReadFromFile ( fstream &instream , set<string> &wordSet ,
         const int MaxWordLength ) {

      string nextWord;
      int timein = time(NULL);

      while ( !instream.eof() && time(NULL)-timein<BAIL) { //x second bailout
         while ( !swansonString::IsALetter( (instream.peek()) ) ) {
            instream.ignore( 1 );
         }
         string nextWord;
         getline( instream , nextWord , ' ' );
         //check last character for alpha // for !.?"
         while ( !swansonString::IsALetter( nextWord.at( nextWord.size() - 1 ) ) ) {
            nextWord.erase( nextWord.size() - 1 , 1 ); // delete last character
         }

         if ( (!nextWord.empty() && swansonString::AllLetters( nextWord ))
               && (MaxWordLength == UNRESTRICTED
                     || nextWord.size() < MaxWordLength) ) {

            nextWord = swansonString::LowerCase( nextWord );

            wordSet.insert( nextWord );
         }
      }

      //cout << "time out is " << time(NULL) << " file took " << time(NULL)-timein;

   }
void Portier::Scan(fstream &plik, string os)
{
	getline(plik, Imie, ';');
	getline(plik, Nazwisko, ';');
	plik >> Sta¿;
	plik.ignore();
	getline(plik, Ulica, ';');
	getline(plik, Numer, ';');
	getline(plik, Kod, ';');
	getline(plik, MiejscowoϾ, '\n');
	Etat = portier;
}