POV-Ray : Newsgroups : povray.programming : Extending the #read directive Server Time
18 May 2024 09:04:48 EDT (-0400)
  Extending the #read directive (Message 11 to 15 of 15)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Warp
Subject: Re: Extending the #read directive
Date: 8 May 2003 13:52:47
Message: <3eba996e@news.povray.org>
Christoph Hormann <chr### [at] gmxde> wrote:
> '\0' indicates the end of a string so this would mess up the whole thing.

  This shouldn't be a problem in C++. C++ strings do not have any special
character which marks the end of the string (ie. strings can have any
characters).

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

From: ABX
Subject: Re: Extending the #read directive
Date: 8 May 2003 13:57:29
Message: <je6lbv4fls5qtothmhb34v8vutoa11mjn7@4ax.com>
On 8 May 2003 13:52:47 -0400, Warp <war### [at] tagpovrayorg> wrote:
> Christoph Hormann <chr### [at] gmxde> wrote:
> > '\0' indicates the end of a string so this would mess up the whole thing.
>
> This shouldn't be a problem in C++. C++ strings do not have any special
> character which marks the end of the string (ie. strings can have any
> characters).

IIRC Hugo meant _small_ change in POV-Ray sources ;-)

ABX


Post a reply to this message

From: Hugo Asm
Subject: Re: Extending the #read directive
Date: 8 May 2003 17:08:48
Message: <3ebac760@news.povray.org>
> IIRC Hugo meant _small_ change in POV-Ray sources ;-)

I do have a few questions to this:

Would a text file ever contain a null character (ascii value zero)
considering it's only text? A text file uses 0-9, A-Z, a-z, a few !"#&
signs, an invisible line break, and EOF.. There seems to be no need for a
null character.

On the other hand, if we are actually talking about 2 characters  '\0'  then
why not convert them to an ascii value that is never used in a text file?
Just as long as the C string can hold it. Then convert it back to \0 when
the user wants to read the string.


Regards,
Hugo


Post a reply to this message

From: Christopher James Huff
Subject: Re: Extending the #read directive
Date: 9 May 2003 11:16:28
Message: <cjameshuff-409C31.11163009052003@netplex.aussie.org>
In article <3ebac760@news.povray.org>, "Hugo Asm" <hua### [at] post3teledk> 
wrote:

> Would a text file ever contain a null character (ascii value zero)
> considering it's only text? A text file uses 0-9, A-Z, a-z, a few !"#&
> signs, an invisible line break, and EOF.. There seems to be no need for a
> null character.

Probably not, but this restriction makes binary files unuseable.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Christopher James Huff
Subject: Re: Extending the #read directive
Date: 9 May 2003 11:18:15
Message: <cjameshuff-9E56A4.11181709052003@netplex.aussie.org>
In article <3EBA5031.EDABF9C2@gmx.de>,
 Christoph Hormann <chr### [at] gmxde> wrote:

> No, i think he means if the file contains a '\0' this will result in a
> '\0' :-)
> 
> '\0' indicates the end of a string so this would mess up the whole thing.

Only on null-terminated strings. If you store the length separately, you 
don't need a null terminator and can have any byte value in the string.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.