Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @file BlocData.cpp
- * @brief Codeages des fonctions bloc data
- * @author Samy Letombe, Nathan Pellissiere, Mohammed Senhadji
- * @version 1 20/12/17
- */
- #include <iostream>
- #include <fstream>
- #include <cassert>
- using namespace std;
- #include "BlocData.h"
- /**
- * @brief Lecture d'un bloc de donnée
- * @param[in] le flux d'entrée
- * @return le BlocData lu
- * @pre flux d'entrée valide
- */
- BlocData lire_bd(istream& is) {
- assert(is);
- BlocData bd;
- is >> bd.noBloc;
- is.seekg(2, ios::cur);
- is.getline(bd.data, max + 1, '\n');
- return bd;
- }
- /**
- * @brief Ecriture d'un bloc de donnée
- * @param[in] le flux de sortie
- * @param[in] la BlocData à écrire
- * @pre flux de sortie valide
- */
- void ecrire_bd(ostream& os, const BlocData& b) {
- assert(os);
- os << b.noBloc << endl;
- os << b.data;
- }
- bool enordre(const BlocData& b1, const BlocData& b2) {
- if (b1.noBloc < b2.noBloc)
- return true;
- else return false;
- }
Add Comment
Please, Sign In to add comment