Changeset 620 for trunk/libffado/src/genericavc
- Timestamp:
- 09/06/07 13:09:35 (17 years ago)
- Files:
-
- trunk/libffado/src/genericavc/avc_vendormodel.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/src/genericavc/avc_vendormodel.cpp
r607 r620 23 23 24 24 #include "genericavc/avc_vendormodel.h" 25 #include "libutil/serialize.h" 25 26 26 27 #include <fstream> … … 34 35 using namespace std; 35 36 36 static void37 tokenize(const string& str,38 vector<string>& tokens,39 const string& delimiters = " ")40 {41 // Skip delimiters at beginning.42 string::size_type lastPos = str.find_first_not_of(delimiters, 0);43 // Find first "non-delimiter".44 string::size_type pos = str.find_first_of(delimiters, lastPos);45 46 while (string::npos != pos || string::npos != lastPos)47 {48 // Found a token, add it to the vector.49 tokens.push_back(str.substr(lastPos, pos - lastPos));50 // Skip delimiters. Note the "not_of"51 lastPos = str.find_first_not_of(delimiters, pos);52 // Find next "non-delimiter"53 pos = str.find_first_of(delimiters, lastPos);54 }55 }56 57 //-------------------------------------------------58 59 37 GenericAVC::VendorModelEntry::VendorModelEntry() 60 38 : vendor_id( 0 ) … … 89 67 { 90 68 bool equal=true; 91 69 92 70 equal &= (vendor_id == rhs.vendor_id); 93 71 equal &= (model_id == rhs.model_id); … … 216 194 if ( it != m_vendorModelEntries.end() ) 217 195 return *it; 218 196 219 197 struct VendorModelEntry invalid; 220 198 return invalid;