Show
Ignore:
Timestamp:
08/29/07 14:17:58 (16 years ago)
Author:
wagi
Message:

Instead of static compiled in vendor/model table use configuration files.

Maybe needs some more cleanup but I wanted to check in this baby before
someone else screws me up with some majors changes in the repos :)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/genericavc/avc_vendormodel.h

    r557 r599  
    2525#define GENERICAVC_VENDORMODEL_H 
    2626 
     27#include <string> 
    2728#include <vector> 
    2829 
     
    3132// struct to define the supported devices 
    3233struct VendorModelEntry { 
     34    VendorModelEntry(); 
     35    VendorModelEntry(const VendorModelEntry& rhs); 
     36    VendorModelEntry& operator = (const VendorModelEntry& rhs); 
     37    virtual ~VendorModelEntry(); 
     38 
    3339    unsigned int vendor_id; 
    3440    unsigned int model_id; 
    35     char *vendor_name; 
    36     char *model_name; 
     41    std::string vendor_name; 
     42    std::string model_name; 
    3743}; 
    3844 
    39 typedef std::vector<VendorModelEntry*> VendorModelEntryVector; 
     45typedef std::vector<VendorModelEntry> VendorModelEntryVector; 
    4046 
    4147class VendorModel { 
    4248public: 
    4349    VendorModel( const char* filename ); 
    44     ~VendorModel(); 
     50    virtual ~VendorModel(); 
     51 
     52    virtual bool parse(); 
     53    virtual bool printTable() const; 
     54    virtual bool handleAdditionalEntries(VendorModelEntry& vme, 
     55                                         std::vector<std::string>& v, 
     56                                         std::vector<std::string>::const_iterator& b, 
     57                                         std::vector<std::string>::const_iterator& e ); 
     58    VendorModelEntry* find( unsigned int vendor_id,  unsigned model_id ); 
    4559 
    4660    const VendorModelEntryVector& getVendorModelEntries() const; 
    4761private: 
     62    std::string m_filename; 
    4863    VendorModelEntryVector m_vendorModelEntries; 
    4964};