Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @brief Nacte polozky ze zadaneho souboru
- *
- * @param string nazev souboru
- * @param vector<sporttracker_item>* databaze polozek
- *
- * @return 0 - chyba, 1 - ok
- *
- * Funkce provadi nacteni udaju ze souboru csv
- */
- int load_items(string db_filerok, vector<sporttracker_item>* ei)
- {
- fstream db;
- //otevreni souboru
- db.open(db_filerok.c_str(), fstream::in);
- if (!db.is_open())
- return 0;
- char buff[255];
- sporttracker_item tmp_ei;
- while (db.good())
- {
- db.getline(buff, LINE_SIZE);
- if (db.good())
- {
- string line = string(buff);
- if (parse_item(line, &tmp_ei))
- {
- ei->push_back(tmp_ei);
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement