From 56cc59cf44ec64440ba4d1c0d005196195c758e6 Mon Sep 17 00:00:00 2001 From: hugues Date: Sat, 25 Mar 2006 15:07:51 +0000 Subject: Nettoyage du repository glagen git-svn-id: file:///usr/local/opt/svn/repos/glagen@12 0f7e0d06-a6f9-0310-a55f-d5f984f55e4c --- tags/START/glagen/dll/classes/Data_string.hh | 62 ---------------------------- 1 file changed, 62 deletions(-) delete mode 100644 tags/START/glagen/dll/classes/Data_string.hh (limited to 'tags/START/glagen/dll/classes/Data_string.hh') diff --git a/tags/START/glagen/dll/classes/Data_string.hh b/tags/START/glagen/dll/classes/Data_string.hh deleted file mode 100644 index a5f9131..0000000 --- a/tags/START/glagen/dll/classes/Data_string.hh +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef DATA_STRING_HH_ -# define DATA_STRING_HH_ - -#include -#include -#include // Pour write/read - -#include - -using namespace std; - -class Data_string -{ -public: - Data_string() : _str("") {}; - Data_string(const string& str) : _str(str) {}; - - void write_data(const int& fd) const - { - - std::cout << "Donnees envoyes" << std::endl << _str << std::endl; - unsigned int size = _str.size(); - write(fd, &size, sizeof(unsigned int)); - for (unsigned int i = 0; i < size; ++i) - { - char car = _str[i]; - write(fd, &car, sizeof(char)); - } - } - - void read_data(const int& fd) - { - unsigned int size = 0; - do - { - errno = 0; - read(fd, &size, sizeof(size)); - } - while (errno == 4); - - _str = ""; - for (unsigned int i = 0; i < size; ++i) - { - char car; - do - { - errno = 0; - read(fd, &car, sizeof(char)); - } - while (errno == 4); - _str += car; - } - - std::cout << "Reception message sur le file descriptor :" << fd - << std::endl << _str << std::endl; - } - -private: - string _str; -}; - -#endif // DATA_STRING -- cgit v1.2.3