Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > replace string ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 44103 of 47561
Post > Topic >>

replace string in byte stream

by Carmen Sei <fatwallet951@[EMAIL PROTECTED] > Mar 25, 2008 at 01:17 AM

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;
}
 




 3 Posts in Topic:
replace string in byte stream
Carmen Sei <fatwallet9  2008-03-25 01:17:28 
Re: replace string in byte stream
Ian Collins <ian-news@  2008-03-25 22:08:46 
Re: replace string in byte stream
James Kanze <james.kan  2008-03-25 05:19:23 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 3:29:07 CDT 2008.