473,407 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

replace string in byte stream

I have a function that read data byte and drmp to a file

how can I change the string <givenname xsi:nil='true'/to
<givenname>.</givenname>

======================
bool dump;
std::ofstream dumpfile;
int my_block_reader(void *userdata, const char *buf, size_t len)
{
if (dump == false) {
if (strnicmp(buf, "<?xml", 5) == 0) {
dump = true;
}
}
if (dump == true) {
char *szBuffer = new char[len + 1];
memcpy(szBuffer, buf, len);
szBuffer[len] = 0;
dumpfile << szBuffer;
delete[] szBuffer;
}
return 0;
}
Mar 25 '08 #1
1 3246
Carmen Sei wrote:
I have a function that read data byte and drmp to a file

how can I change the string <givenname xsi:nil='true'/to
<givenname>.</givenname>
Learn how to use std::string.

--
Ian Collins.
Mar 25 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: DraguVaso | last post by:
Hi, In my application I receive a Byte Stream (Dim bytFile() As Byte) which contains a jpeg-picture, which I want to display in a picturebox. I want to display it directly from the bytfile()...
6
by: Hayato Iriumi | last post by:
I'm looking for a way to convert String to Stream. I don't want to have to write the string out to a file to get the stream. Does anyone know how? TIA
7
by: .... | last post by:
Hi I have an existing function which has a stream object (inmsg.BodyPart.Data). I'm trying to search and replace the stream object in the most efficient way possible This is my attempt below,...
0
by: Xah Lee | last post by:
Interactive Find and Replace String Patterns on Multiple Files Xah Lee, 2006-06 Suppose you need to do find and replace of a string pattern, for all files in a directory. However, you do not...
1
by: eengel | last post by:
Hi, A site Im working with has an API that allows one to retrieve files. The file is a Word doc sent as a byte stream. url="blah.asp?fileid=777777" set...
3
by: jackjoesh | last post by:
I want to display a pdf through byte stream in IE7. For example: ......... Response.ContentType = "application/pdf"; Response.AddHeader("Content-Type", "application/pdf");...
1
by: jyohere | last post by:
What is the difference between character and byte stream......Pls explain me in detail.......How is the internal mapping done .....its probably very difficult to understand....when we read from...
1
by: libish | last post by:
hi all.... i am developing a mobile application(windows mobile). my application will be requesting (hitting) a server.. what i'm suppose to get in response is an XML page... i've written code to...
5
by: da1978 | last post by:
Hi experts, I need to convert a string or a Byte array to a string byte array. Its relatively easy to convert a string to an char array or a byte array but not a STRING byte array. i.e. ...
3
by: ashishgdata | last post by:
i have a text file which has a byte stream as follows - 0B00000000 0B01010101 0B00100100 and so on . the ' 0B ' are the starting bits and then each '0' or '1' stands for one pixel and a sing...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.