Changeset 26122 in vbox
- Timestamp:
- Feb 1, 2010 2:23:08 PM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/Performance.cpp
r25149 r26122 505 505 506 506 for (size_t pos = name.find(","); 507 pos != std::string::npos;507 pos != com::Utf8Str::npos; 508 508 pos = name.find(",", startPos)) 509 509 { 510 mElements.push_back(std::make_pair(object, std::string(name.substr(startPos, pos - startPos).c_str())));510 mElements.push_back(std::make_pair(object, iprt::MiniString(name.substr(startPos, pos - startPos).c_str()))); 511 511 startPos = pos + 1; 512 512 } 513 mElements.push_back(std::make_pair(object, std::string(name.substr(startPos).c_str())));513 mElements.push_back(std::make_pair(object, iprt::MiniString(name.substr(startPos).c_str()))); 514 514 } 515 515 … … 587 587 } 588 588 589 bool Filter::match(const ComPtr<IUnknown> object, const std::string &name) const589 bool Filter::match(const ComPtr<IUnknown> object, const iprt::MiniString &name) const 590 590 { 591 591 ElementList::const_iterator it; -
trunk/src/VBox/Main/include/Performance.h
r22173 r26122 25 25 #include <VBox/com/defs.h> 26 26 #include <VBox/com/ptr.h> 27 #include <VBox/com/string.h> 27 28 28 29 #include <iprt/types.h> 29 30 #include <iprt/err.h> 30 31 31 #include <algorithm>32 32 #include <list> 33 #include <string>34 33 #include <vector> 35 36 namespace com37 {38 class Utf8Str;39 }40 34 41 35 namespace pm … … 84 78 typedef int HintFlags; 85 79 typedef std::pair<RTPROCESS, HintFlags> ProcessFlagsPair; 86 87 inline bool processEqual(ProcessFlagsPair pair, RTPROCESS process)88 {89 return pair.first == process;90 }91 80 92 81 class CollectorHints … … 130 119 { 131 120 ProcessList::iterator it; 132 133 it = std::find_if(mProcesses.begin(), 134 mProcesses.end(), 135 std::bind2nd(std::ptr_fun(processEqual), process)); 136 137 if (it != mProcesses.end()) 138 return *it; 121 for (it = mProcesses.begin(); it != mProcesses.end(); it++) 122 if (it->first == process) 123 return *it; 139 124 140 125 /* Not found -- add new */ … … 369 354 if (mAggregate) 370 355 { 371 mName += ":";372 mName += mAggregate->getName();356 mName.append(":"); 357 mName.append(mAggregate->getName()); 373 358 } 374 359 } … … 394 379 395 380 private: 396 std::string mName;381 iprt::MiniString mName; 397 382 BaseMetric *mBaseMetric; 398 383 SubMetric *mSubMetric; … … 409 394 static bool patternMatch(const char *pszPat, const char *pszName, 410 395 bool fSeenColon = false); 411 bool match(const ComPtr<IUnknown> object, const std::string &name) const;396 bool match(const ComPtr<IUnknown> object, const iprt::MiniString &name) const; 412 397 private: 413 398 void init(ComSafeArrayIn(IN_BSTR, metricNames), 414 399 ComSafeArrayIn(IUnknown * , objects)); 415 400 416 typedef std::pair<const ComPtr<IUnknown>, const std::string> FilterElement;401 typedef std::pair<const ComPtr<IUnknown>, const iprt::MiniString> FilterElement; 417 402 typedef std::list<FilterElement> ElementList; 418 403
Note:
See TracChangeset
for help on using the changeset viewer.