SASC-NG
DVBSoftCAM

cLineBuff Class Reference

#include <misc.h>

Inheritance diagram for cLineBuff:

List of all members.

Public Member Functions

 cLineBuff (int blocksize)
 ~cLineBuff ()
void Printf (const char *fmt,...) __attribute__((format(printf
void void Strcat (const char *str)
void Flush (void)
void Back (int n)
const char * Line (void) const
int Length (void) const

Protected Member Functions

char * Grab (void)

Detailed Description

Definition at line 63 of file misc.h.


Constructor & Destructor Documentation

cLineBuff::cLineBuff ( int  blocksize)

Definition at line 160 of file misc.c.

{
  blockSize=blocksize;
  work=0;
  blen=wlen=0;
}
cLineBuff::~cLineBuff ( )

Definition at line 167 of file misc.c.

References free.

{
  free(work);
}

Member Function Documentation

void cLineBuff::Back ( int  n)

Definition at line 221 of file misc.c.

{
  if(n>blen) blen=0; else blen-=n;
  if(work) work[blen]=0;
}
void cLineBuff::Flush ( void  )

Reimplemented in cLogLineBuff.

Definition at line 172 of file misc.c.

Referenced by cInfoStr::Begin(), cLogging::GetConfig(), Grab(), and cLogging::PutLB().

{
  blen=0;
}
char * cLineBuff::Grab ( void  ) [protected]

Definition at line 177 of file misc.c.

References Flush().

Referenced by cInfoStr::Finish().

{
  char *w=work;
  work=0; wlen=0;
  Flush();
  return w;
}
int cLineBuff::Length ( void  ) const [inline]

Definition at line 80 of file misc.h.

Referenced by cLogging::PutLB(), and cScPlugin::SVDRPCommand().

{ return blen; }
const char* cLineBuff::Line ( void  ) const [inline]

Definition at line 79 of file misc.h.

Referenced by cLogging::PutLB(), cScSetup::Store(), and cScPlugin::SVDRPCommand().

{ return work; }
void cLineBuff::Printf ( const char *  fmt,
  ... 
)

Definition at line 198 of file misc.c.

Referenced by cST20::Decode(), cLogging::GetConfig(), cSmartCardVideoGuard2::Init(), cSmartCardViaccess::Init(), cSmartCardSeca::Init(), cSmartCardNagra::Init(), cSmartCardIrdeto::Init(), cSmartCardCryptoworks::Init(), cSmartCardConax::Init(), cN2Prov0101::Stepper(), Strcat(), and cScPlugin::SVDRPCommand().

{
  int q=120;
  while(Check(q)) {
    int s=wlen-blen;
    va_list ap;
    va_start(ap,fmt);
    q=vsnprintf(work+blen,s,fmt,ap);
    va_end(ap);
    if(q<s) {
      if(q>0) blen+=q;
      break;
      }
    // truncated
    q+=100;
    }
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines