replace string in byte stream

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Carmen Sei

    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;
    }
  • Ian Collins

    #2
    Re: replace string in byte stream

    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.

    Comment

    Working...