Click here to Skip to main content
15,913,487 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: WTL - 7.5 Released - Open Source Pin
_Magnus_16-May-04 23:38
_Magnus_16-May-04 23:38 
GeneralRe: WTL - 7.5 Released - Open Source Pin
Jörgen Sigvardsson23-May-04 12:02
Jörgen Sigvardsson23-May-04 12:02 
Generalafter installing xp service pack 1 and latest windows update. Pin
ekklesia14-May-04 19:59
ekklesia14-May-04 19:59 
Generalerror PRJ0019: A tool returned an error code: Performing registration Pin
parkerpkthn14-May-04 7:33
parkerpkthn14-May-04 7:33 
GeneralString Parsing ! Pin
ra_sasi14-May-04 6:22
ra_sasi14-May-04 6:22 
GeneralRe: String Parsing ! Pin
Andrew Walker14-May-04 16:56
Andrew Walker14-May-04 16:56 
GeneralRe: String Parsing ! Pin
ra_sasi17-May-04 4:10
ra_sasi17-May-04 4:10 
GeneralRe: String Parsing ! Pin
Andrew Walker17-May-04 22:40
Andrew Walker17-May-04 22:40 
I'm assuming that you want to keep supporting some of the functionalities of IString - but want to start moving to STL? I had a quick look at the documentation of IString, it seems to have a conversion operator to char*, so you should be able to directly construct a std::string from an IString, provided your IString's will never have embedded nulls.

What follows is a (hack) way of extracting the data in a way similar to what you are doing, because the stream extraction operators will read until they reach whitespace (and AFAIK, you can't change the definition of whitespace). One function which gets around this limitation is getline, which (optionally) stops at a delimiting character. This won't work without modification under VC6 (requires an STL patch from dinkumware)

#include <iostream>
#include <sstream>

int main()
{
    std::istringstream iss("12#34#56#78#90#ab");
    std::string I1,I2,I3,I4,I5,I6;

    std::getline(iss,I1,'#');
    std::getline(iss,I2,'#');
    std::getline(iss,I3,'#');
    std::getline(iss,I4,'#');
    std::getline(iss,I5,'#');
    std::getline(iss,I6,'#');

    return 0;
}


'The Standard C++ Library' by Josuttis is a good reference if you get stuck, it covers all of this and more in depth.


If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.

Rudyard Kipling

GeneralRe: String Parsing ! Pin
ra_sasi20-May-04 12:10
ra_sasi20-May-04 12:10 
GeneralITableCreation Pin
João Paulo Figueira12-May-04 7:28
professionalJoão Paulo Figueira12-May-04 7:28 
GeneralRe: ITableCreation Pin
João Paulo Figueira12-May-04 23:52
professionalJoão Paulo Figueira12-May-04 23:52 
General8-bit graphics display Pin
ted_yu11-May-04 14:49
ted_yu11-May-04 14:49 
GeneralRe: 8-bit graphics display Pin
John M. Drescher11-May-04 16:50
John M. Drescher11-May-04 16:50 
GeneralRe: 8-bit graphics display Pin
ted_yu11-May-04 18:18
ted_yu11-May-04 18:18 
Generaldifference between MIDL Compiler Versions 6.00.0361 and 5.01.0164 Pin
Tarundeep Singh Kalra10-May-04 20:05
Tarundeep Singh Kalra10-May-04 20:05 
General(WTL) XP style password edit box Pin
Ernesto D.10-May-04 17:53
Ernesto D.10-May-04 17:53 
GeneralRe: (WTL) XP style password edit box Pin
Jens Doose10-May-04 23:18
Jens Doose10-May-04 23:18 
GeneralRe: (WTL) XP style password edit box Pin
Jason De Arte11-May-04 9:38
Jason De Arte11-May-04 9:38 
GeneralRe: (WTL) XP style password edit box Pin
Michael Dunn11-May-04 10:15
sitebuilderMichael Dunn11-May-04 10:15 
GeneralRe: (WTL) XP style password edit box Pin
Ernesto D.11-May-04 16:06
Ernesto D.11-May-04 16:06 
Generalstreams problem Pin
ra_sasi10-May-04 12:45
ra_sasi10-May-04 12:45 
GeneralRe: streams problem Pin
Joaquín M López Muñoz11-May-04 9:45
Joaquín M López Muñoz11-May-04 9:45 
GeneralRe: streams problem Pin
ra_sasi13-May-04 10:44
ra_sasi13-May-04 10:44 
GeneralNT Service - problem in re-registering service Pin
Anonymous7-May-04 10:48
Anonymous7-May-04 10:48 
GeneralRe: NT Service - problem in re-registering service Pin
Milton Karimbekallil14-May-04 0:23
Milton Karimbekallil14-May-04 0:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.