Results 1 to 2 of 2

Thread: about stdiostream.h and strstream.h

  1. #1
    Join Date
    Jan 2011
    Posts
    4
    Thanks
    1

    Default about stdiostream.h and strstream.h

    Hello,
    As we know, stdiostream and strstream are not use again in new gcc version, but some old program use them. I need to amend it.

    Qt Code:
    1. #include <iostream.h>
    2. #include <stdiostream.h>
    3. #include <fstream.h>
    4. #include <strstream.h>
    5.  
    6. class Slave : public SlaveBase {
    7. public:
    8. Slave(char* hostName_, int port_);
    9. ~Slave();
    10.  
    11. void SendMessageToMaster(char* msg);
    12.  
    13. char* GetMasterHostName();
    14. int Initialize(int slaveID);
    15. int ConnectToMaster();
    16. SockInetClient* GetMasterChannel();
    17. void DoSession(CallBackBase<SessionData>& callBack);
    18.  
    19. istdiostream& IStream();
    20. ostdiostream& OStream();
    21. FILE* Stream();
    22.  
    23. protected:
    24. CString _hostName;
    25. int _port;
    26. SockInetClient* _masterChannel;
    27. FILE* _fp;
    28. istdiostream* _istd;
    29. ostdiostream* _ostd;
    30. };
    31. #endif
    32.  
    33. int CAdvFEGenericAttribute::set(char* str)
    34. {
    35. char buf[1024];
    36. istrstream s(str);
    37. s >> buf; this->set(0, buf);
    38. s >> buf; this->set(1, buf);
    39. s >> buf; this->set(2, buf);
    40. s >> buf; this->set(3, buf);
    41. s >> buf; this->set(4, buf);
    42. return (0);
    43. }
    To copy to clipboard, switch view to plain text mode 

    How can I do?
    Thank you for you kindly help!
    Last edited by Lykurg; 3rd March 2011 at 05:13.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: about stdiostream.h and strstream.h

    Just use the new ISO headers without the 'h' suffix.
    Qt Code:
    1. //#include <iostream.h>
    2. #include <iostream>
    To copy to clipboard, switch view to plain text mode 
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.