Logo Search packages:      
Sourcecode: inkscape version File versions

int org::w3c::dom::io::Base64OutputStream::put ( XMLCh  ch  )  [virtual]

Writes the specified byte to this output stream.

Reimplemented from org::w3c::dom::io::BasicOutputStream.

Definition at line 295 of file base64stream.cpp.

References putCh().

{
    if (closed)
        {
        //probably throw an exception here
        return -1;
        }

    outBuf   <<=  8;
    outBuf   |=  (ch & 0xff);
    bitCount +=  8;
    if (bitCount >= 24)
        {
        int indx  = (int)((outBuf & 0x00fc0000L) >> 18);
        int obyte = (int)base64encode[indx & 63];
        putCh(obyte);

        indx      = (int)((outBuf & 0x0003f000L) >> 12);
        obyte     = (int)base64encode[indx & 63];
        putCh(obyte);

        indx      = (int)((outBuf & 0x00000fc0L) >>  6);
        obyte     = (int)base64encode[indx & 63];
        putCh(obyte);

        indx      = (int)((outBuf & 0x0000003fL)      );
        obyte     = (int)base64encode[indx & 63];
        putCh(obyte);

        bitCount = 0;
        outBuf   = 0L;
        }

    return 1;
}


Generated by  Doxygen 1.6.0   Back to index