MCPcopy Create free account
hub / github.com/clechasseur/pathcopycopy / StringToPluginIds

Method StringToPluginIds

PathCopyCopy/src/PluginUtils.cpp:487–505  ·  view source on GitHub ↗

Converts a string containing a list of plugin unique identifiers to a vector of GUID structs. @param p_PluginIdsAsString String containing the plugin IDs. @param p_Separator Character used to separate the plugin IDs in the string. @return Vector of plugin IDs as GUID structs.

Source from the content-addressed store, hash-verified

485 // @return Vector of plugin IDs as GUID structs.
486 //
487 GUIDV PluginUtils::StringToPluginIds(std::wstring p_PluginIdsAsString,
488 const wchar_t p_Separator)
489 {
490 // Assume there are no plugin IDs.
491 GUIDV vPluginIds;
492
493 // First split the string.
494 WStringV vStringParts = StringUtils::Split(std::move(p_PluginIdsAsString), p_Separator);
495
496 // Scan parts and convert to GUIDs.
497 GUID onePluginId = { 0 };
498 for (const std::wstring& stringPart : vStringParts) {
499 if (SUCCEEDED(::CLSIDFromString(stringPart.c_str(), &onePluginId))) {
500 vPluginIds.push_back(onePluginId);
501 }
502 }
503
504 return vPluginIds;
505 }
506
507 //
508 // Converts a string containing a list of unsigned integers to a vector.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected