Changeset 752 for trunk/src2


Ignore:
Timestamp:
May 30, 2007 12:19:11 AM (17 years ago)
Author:
dkearney
Message:

added use of RPENC_HDR flag in decode function so users can give the RPENC_Z and RPENC_B64 flags and tell the decode function to only use those flags
if the header does not say how to treat the data.

in library.tcl, added a -decode flag set to yes by default. this flag allows the user to tell if they want the data to be automatically decoded when
it is retrieved from the xmlobj. this is paricaularly useful for dx data held within a field where we do not want the data automatcially decoded.

added the -decode no flag to dx data being retrieved from fields

updated nanovis.cpp with capability to decode data with the new @@RP-ENC: style headers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src2/core/RpEncode.cc

    r751 r752  
    129129    int decompress            = 0;
    130130    int base64                = 0;
     131    int checkHDR              = 0;
    131132    Rappture::Outcome err;
    132133    Rappture::Buffer outData;
     
    138139        base64 = 1;
    139140    }
     141    if ((flags & RPENC_HDR) == RPENC_HDR ) {
     142        checkHDR = 1;
     143    }
    140144
    141145    if ((buf.size() > 11) && (strncmp(buf.bytes(),"@@RP-ENC:z\n",11) == 0)) {
    142146        outData.append(buf.bytes()+11,buf.size()-11);
    143         if ( (decompress == 0) && (base64 == 0) ) {
     147        if ( (checkHDR == 1) || ( (decompress == 0) && (base64 == 0) ) ) {
    144148            decompress = 1;
    145149            base64 = 0;
     
    148152    else if ((buf.size() > 13) && (strncmp(buf.bytes(),"@@RP-ENC:b64\n",13) == 0)) {
    149153        outData.append(buf.bytes()+13,buf.size()-13);
    150         if ( (decompress == 0) && (base64 == 0) ) {
     154        if ( (checkHDR == 1) || ( (decompress == 0) && (base64 == 0) ) ) {
    151155            decompress = 0;
    152156            base64 = 1;
     
    155159    else if ((buf.size() > 14) && (strncmp(buf.bytes(),"@@RP-ENC:zb64\n",14) == 0)) {
    156160        outData.append(buf.bytes()+14,buf.size()-14);
    157         if ( (decompress == 0) && (base64 == 0) ) {
     161        if ( (checkHDR == 1) || ( (decompress == 0) && (base64 == 0) ) ) {
    158162            decompress = 1;
    159163            base64 = 1;
Note: See TracChangeset for help on using the changeset viewer.