diff --git a/TP/1-Prise en main/liste_chainee/ListString.cpp b/TP/1-Prise en main/liste_chainee/ListString.cpp index 0c0c61f..382dbb2 100644 --- a/TP/1-Prise en main/liste_chainee/ListString.cpp +++ b/TP/1-Prise en main/liste_chainee/ListString.cpp @@ -7,7 +7,8 @@ struct ListString::Cell { Cell * m_prev; Cell * m_next; string m_value; - Cell(const string &Value = "UNINITIALIZED", Cell *prev = nullptr, Cell *next = nullptr); + Cell(const string &Value = "UNINITIALIZED", + Cell *prev = nullptr, Cell *next = nullptr); bool phantom() const { return (! m_next) || (! m_prev ); } }; @@ -18,6 +19,11 @@ ListString::Cell::Cell(const string & value, Cell *prev, Cell *next ) { } +unsigned int ListString::size() const +{ + return m_size; +} + ListString::ListString() : m_size{0} , m_first{new Cell} @@ -44,7 +50,7 @@ void ListString::push_back(const std::string &value) { void ListString::insert(const Position & p, const std::string &value) { Cell *before = p.m_cell; - Cell *neo = new Cell(value, before, m_first->m_next); + Cell *neo = new Cell(value, before, before->m_next); before->m_next->m_prev = neo; before->m_next = neo; ++m_size; diff --git a/TP/1-Prise en main/liste_chainee/ListString.hpp b/TP/1-Prise en main/liste_chainee/ListString.hpp index 69fdc1f..d5bc2c5 100644 --- a/TP/1-Prise en main/liste_chainee/ListString.hpp +++ b/TP/1-Prise en main/liste_chainee/ListString.hpp @@ -26,6 +26,7 @@ public: Position begin() const; friend std::ostream& operator<<(std::ostream & os, const ListString & list); + unsigned int size() const; }; diff --git a/TP/4-Interactions-Qml/README.md b/TP/4-Interactions-Qml/README.md index 73ea45b..590a37a 100644 --- a/TP/4-Interactions-Qml/README.md +++ b/TP/4-Interactions-Qml/README.md @@ -1,7 +1,7 @@ # Communication C++ / QML" L'objectif de ce TP est d'apprendre à faire interagir C++ et QML. -Vous utiliserez QtCreator mais **l'éditeur de GUI**. Vous pouvez utilisez si vous le souhaitez les `QtQuick.Controls.`. +Vous utiliserez QtCreator. Vous pouvez utilisez si vous le souhaitez les `QtQuick.Controls.`. ## Une classe NetworkInterface