openoffice-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jorge ivan poot diaz <ivan.pootd...@gmail.com>
Subject Re: std::stringstream aStrStream
Date Thu, 18 Apr 2013 02:51:30 GMT
Hello,
Thanks you,  I have already changed the string as you said me. This is the
result:
::rtl::OUString aName ( aEdtName.GetText() );

And then I put this code

std::stringstream aStrStream;
            aStrStream << "\nThis is " << aName << " and " << aName
<< "
genial!" <<std::endl;
            _STL::cout << aStrStream.str();

The building was successful, but does not print whole aStrStream. Only this
part:
This is
http://imagebin.org/254440

What causes this?
Could be some error in the code or in the concatenation?




2013/4/17 Andre Fischer <awf.aoo@gmail.com>

> On 17.04.2013 17:09, jorge ivan poot diaz wrote:
>
>> I don't see a definition of aName, but from the error message assume that
>>>
>> it is String.
>> http://imagebin.org/254354
>>
>>  That is because the String class has no << operator defined. Try to use
>>>
>> aName.getStr() instead of just aName.
>> http://imagebin.org/254355
>>
>> As you can see from the picture, I already made the change, but I have the
>> following error:
>> http://imagebin.org/254357
>>
>> I try with aEdtName.GetText () instead of aName.getStr() but yet does not
>> compile:
>> http://imagebin.org/254361
>>
>> Help, ragards.
>>
>
> Sorry, I do not use String anymore and had to guess and apparently guessed
> wrong.  If you can, you probably should use ::rtl::OUString instead of
> String.  The conversion to char* looks like this:
>   ::rtl::OUString sText (::rtl::OUString::**createFromAscii("some text"));
>   ::std::cout << ::rtl::OUStringToOString(**sText,
> RTL_TEXTENCODING_ASCII_US).**getStr() << ::std::endl;
> or something very similar to this.
>
> If you still want to use String then cosv/inc/cosv/string.hxx suggests to
> use c_str() to obtain a char*.
>
> -Andre
>
>
>>
>>
>>
>> 2013/4/17 Andre Fischer <awf.aoo@gmail.com>
>>
>>  On 17.04.2013 01:46, jorge ivan poot diaz wrote:
>>>
>>>  Hello,
>>>>
>>>> I am modifying this code in AOO:
>>>> http://opengrok.adfinis-**sygr**oup.org/source/xref/aoo-**<http://sygroup.org/source/xref/aoo-**>
>>>> trunk/main/cui/source/****tabpages/tpcolor.cxx#465<http:**
>>>> //opengrok.adfinis-sygroup.**org/source/xref/aoo-trunk/**
>>>> main/cui/source/tabpages/**tpcolor.cxx#465<http://opengrok.adfinis-sygroup.org/source/xref/aoo-trunk/main/cui/source/tabpages/tpcolor.cxx#465>
>>>> >
>>>>
>>>>
>>>> I'm trying to concatenate with stringstream but I have errors when I'am
>>>> building:
>>>>
>>>> 1- I already included:
>>>> #include <sstream>
>>>>
>>>> 2- I have added the following code:
>>>> http://imagebin.org/254288
>>>>
>>>>  I don't see a definition of aName, but from the error message assume
>>> that
>>> it is String.
>>>
>>>
>>>
>>>  3- This is the error:
>>>> http://imagebin.org/254289
>>>>
>>>>  That is because the String class has no << operator defined. Try to
use
>>> aName.getStr() instead of just aName.
>>>
>>> -Andre
>>>
>>>
>>>  Help me, regards!!
>>>>
>>>>
>>>>  ------------------------------****----------------------------**
>>> --**---------
>>> To unsubscribe, e-mail: dev-unsubscribe@openoffice.**a**pache.org<http://apache.org>
>>> <dev-unsubscribe@**openoffice.apache.org<dev-unsubscribe@openoffice.apache.org>
>>> >
>>>
>>> For additional commands, e-mail: dev-help@openoffice.apache.org
>>>
>>>
>>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: dev-unsubscribe@openoffice.**apache.org<dev-unsubscribe@openoffice.apache.org>
> For additional commands, e-mail: dev-help@openoffice.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message