Article View: comp.sys.mac.programmer.codewarrior
Article #1051Re: CW "Map newlines to CR" chaos
From: MW Ron
Date: Thu, 07 Mar 2002 19:14
Date: Thu, 07 Mar 2002 19:14
34 lines
2385 bytes
2385 bytes
In article <3C86BC4F.9930D425@vernier.com>,
Christopher Corbell <ccorbell@vernier.com> wrote:
>What I'd really like is to have std::endl always
>be the same thing regardless of whether it's
>going to an fstream or a stringstream, and
>also have '\r' in code always mean '\r' in
>the byte and its subsequent i/o, and sim. for
>'\n' to always mean '\n', with no translation
>other than what the programmer does explicitly.
>If this is possible in MSL C++, what does
>it involve other than the newlines-to-CR setting?
Just to add to what Meeroh explained
If you do not want end of line translations to occur you must open a
file in binary format. (Apple uses one char to signify and end of the
line, while UNIX uses another, and Widnows yet another).
You should not change the newline to CR in fact we are dropping this in
future IDE's so it can only be changed by a pragma to avoid this
confuseion. It is there to use with MPW files and normally should not
be changed or altered.
I hope this helps expand on the excellent answer Meeroh gave.
Ron
--
TOP PICK HandHeld Computing - issue 4.5
"The best overall development tool for the Palm OS"
Metrowerks, maker of CodeWarrior - "Software Starts Here"
Ron Liechty - MWRon@metrowerks.com - http://www.metrowerks.com
Technical Details
Message-ID:
<mwron-452B80.14140007032002@enews.newsguy.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!upp1.onvoy!onvoy.com!pln-e!spln!dex!extra.newsguy.com!newsp.newsguy.com!mwronReferences:
<3C86BC4F.9930D425@vernier.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10bcce,1e3721ce480a395b
X-Google-Attributes: gid10bcce,public
X-Google-Thread: f635e,1e3721ce480a395b
X-Google-Attributes: gidf635e,public
X-Google-ArrivalTime: 2002-03-07 11:37:06 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!upp1.onvoy!onvoy.com!pln-e!spln!dex!extra.newsguy.com!newsp.newsguy.com!mwron
From: MW Ron <mwron@metrowerks.com>
Newsgroups: comp.sys.mac.programmer.codewarrior,codewarrior.mac
Subject: Re: CW "Map newlines to CR" chaos
Date: Thu, 07 Mar 2002 14:14:00 -0500
Organization: Metrowerks
Lines: 34
Message-ID: <mwron-452B80.14140007032002@enews.newsguy.com>
References: <3C86BC4F.9930D425@vernier.com>
NNTP-Posting-Host: p-562.newsdawg.com
Posted-And-Mailed: yes
User-Agent: MT-NewsWatcher/3.1 (PPC)
X-Face: )mY~XFHLw)UOW!W#[Ljvxq6Ja7(g'#F0-g*&puNxR8hEJkd@Oue/70^.)I78\
(%a%&Id211u"l/t.llWo/M|?15XUlx9!IGkdWiEmcasiyg"k;Q9[~XuE+`t2"*n(>nmm
@L/q,TjMd5+H{gASEPDR^$