SASC
DVBSoftCAM

cSmartCardSlots Class Reference

Inheritance diagram for cSmartCardSlots:

List of all members.

Public Member Functions

 cSmartCardSlots (void)
cSmartCardSlot * GetSlot (int num)
cSmartCardSlot * FirstSlot (void)
void Release (void)
 cSmartCardSlots (void)
cSmartCardSlot * GetSlot (int num)
cSmartCardSlot * FirstSlot (void)
void Release (void)

Protected Member Functions

virtual bool ParseLinePlain (const char *line)
virtual bool ParseLinePlain (const char *line)

Friends

class cSmartCardSlotLink

Detailed Description

Definition at line 571 of file smartcard.c.


Constructor & Destructor Documentation

cSmartCardSlots::cSmartCardSlots ( void  )

Definition at line 596 of file smartcard.c.

:cStructListPlain<cSmartCardSlot>("cardslot config","cardslot.conf",SL_MISSINGOK|SL_VERBOSE|SL_NOPURGE)
{}
cSmartCardSlots::cSmartCardSlots ( void  )

Member Function Documentation

cSmartCardSlot * cSmartCardSlots::FirstSlot ( void  )
cSmartCardSlot* cSmartCardSlots::FirstSlot ( void  )
cSmartCardSlot * cSmartCardSlots::GetSlot ( int  num)

Definition at line 607 of file smartcard.c.

References cStructListPlain< cSmartCardSlot >::First(), cStructLoader::ListLock(), and cStructListPlain< cSmartCardSlot >::Next().

Referenced by cSmartCards::CardInfo(), cSmartCards::CardReset(), and cSmartCards::ListCard().

{
  ListLock(false);
  for(cSmartCardSlot *slot=First(); slot; slot=Next(slot))
    if(slot->SlotNum()==num) return slot;
  return 0;
}
cSmartCardSlot* cSmartCardSlots::GetSlot ( int  num)
virtual bool cSmartCardSlots::ParseLinePlain ( const char *  line) [protected, virtual]

Implements cStructLoaderPlain.

bool cSmartCardSlots::ParseLinePlain ( const char *  line) [protected, virtual]

Implements cStructLoaderPlain.

Definition at line 626 of file smartcard.c.

References cSimpleListBase::Add(), cSimpleListBase::Count(), L_GEN_ERROR, cSmartCardSlotLink::next, PRINTF, cSmartCardSlot::Setup(), and cStructLoader::type.

{
  char type[32];
  int num;
  if(sscanf(line,"%31[^:]:%n",type,&num)==1) {
    for(cSmartCardSlotLink *scs=first; scs; scs=scs->next) {
      if(!strcasecmp(type,scs->name)) {
        cSmartCardSlot *slot=scs->Create();
        if(slot) {
          if(slot->Setup(Count(),&line[num])) {
            Add(slot);
            return true;
            }
          delete slot;
          }
        else PRINTF(L_GEN_ERROR,"failed to create cardslot");
        return false;
        }
      }
    PRINTF(L_GEN_ERROR,"unknown cardslot type '%s'",type);
    }
  return false;
}
void cSmartCardSlots::Release ( void  )

Friends And Related Function Documentation

Definition at line 572 of file smartcard.c.


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