forked from felixmt/LO21
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tag.cpp
36 lines (30 loc) · 772 Bytes
/
Tag.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include "Tag.h"
#include <iostream>
void Tag::AddNote(Note* n)
{
std::cout<<"J'ai utilisé addNote(int pos)\n";
for(int i=0;i<tabNotes.size();i++)
if(tabNotes[i]->getId() == n->getId())
return;
tabNotes<<n;
n->addTag(this);
}
int Tag::getPosNote(Note* n)
{
std::cout<<"J'ai utilisé getPosNote(Note* n)\n";
for (unsigned int i = 0 ; i<tabNotes.size() ; i++)
{
if(tabNotes[i]==n) return i;
}
throw ("La note recherchée n'existe pas.");
}
void Tag::deleteNote(int i )
{
std::cout<<"J'ai utilisé deleteNote()\n";
tabNotes.removeAt(i);
// std::cout<<"Taille du tableau"<<tabNotes.size();
}
Note* Tag::getNote(int i){
std::cout<<"J'ai utilisé getNote(int i)\n";
return tabNotes[i];
}