Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void hardware_ids_cmd::getWMICTable(const QString &query, const QList<QString> &columns, JSONNode &root, Error::Error &err, QString &err_args)
- {
- QString res;
- getWMICRaw(query, res, err, err_args);
- QList< std::pair<int,int> > columnDataPoints;
- int currentSearchIndex = 1, currentIndex = 0;
- while(currentSearchIndex < columns.size())
- {
- const int newIndex = res.indexOf( columns[currentSearchIndex] );
- const int length = newIndex - currentIndex;
- const std::pair<int,int> p( currentIndex, length );
- columnDataPoints.push_back( p );
- currentIndex = newIndex;
- }
- // Last element
- columnDataPoints.push_back( std::pair<int,int>(currentIndex, res.size() - currentIndex) );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement