Logo Search packages:      
Sourcecode: inkscape version File versions

void Inkscape::IO::Base64OutputStream::put ( int  ch  )  [virtual]

Writes the specified byte to this output stream.

Reimplemented from Inkscape::IO::BasicOutputStream.

Definition at line 274 of file base64stream.cpp.

References putc().

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

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

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

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

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

        bitCount = 0;
        outBuf   = 0L;
        }
}


Generated by  Doxygen 1.6.0   Back to index