🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #6413

Re: memory stream parsing

#6413
From: Vladimir Stefanovic
Date: Sun, 15 May 2005 19:31
27 lines
1621 bytes
To extend the code to search for sequences "\r\n", you can do
something like this (untested again):

>         for ( int i=0; i<MS_OLD->Size ; i++ )

for ( int i=0; i<MS_OLD->Size-1;  i++ )

>            if (
>                 (((char*)(MS_OLD->Memory))[i] != '\r') &&
>                 (((char*)(MS_OLD->Memory))[i] != '\n')
>               )

if (
     (((char*)(MS_OLD->Memory))[i] != '\r') &&
     (((char*)(MS_OLD->Memory))[i+1] != '\n')
   )

>               MS_NEW->WriteBuffer( &((char*)(MS_OLD->Memory))[i] , 1 );

MS_NEW->WriteBuffer( &((char*)(MS_OLD->Memory))[i] , 1 );
++i;  //<--- THIS IS ADDED



-- 
Best regards,
Vladimir Stefanovic 
Technical Details
Message-ID: <4287a37a@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <42878a87$1@newsgroups.borland.com> <4287a0a4$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,cb77108e6b3d9403
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Vladimir Stefanovic" <antivari@po.sbb.co.yu>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <42878a87$1@newsgroups.borland.com> <4287a0a4$1@newsgroups.borland.com>
Subject: Re: memory stream parsing
Date: Sun, 15 May 2005 21:31:10 +0200
Lines: 29
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 82.117.212.65
Message-ID: <4287a37a@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1116185466 82.117.212.65 (15 May 2005 12:31:06 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail