Skip to content

Commit 4add452

Browse files
mrbillajapaulh-aja
authored andcommitted
Fixed AJA_DISABLE_PLUGIN_LOAD builds
1 parent a184174 commit 4add452

1 file changed

Lines changed: 36 additions & 36 deletions

File tree

ajantv2/src/ntv2nubaccess.cpp

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,42 @@ bool NTV2DeviceSpecParser::ParseQuery (size_t & pos, NTV2Dictionary & outParams)
931931
return !outParams.empty();
932932
}
933933

934+
bool NTV2DeviceSpecParser::ParseQueryParams (const NTV2Dictionary & inSrcDict, NTV2Dictionary & outQueryParams)
935+
{
936+
if (!inSrcDict.hasKey(kConnectParamQuery))
937+
return true; // It's not an error if there's no 'query' in srcDict
938+
string queryStr(inSrcDict.valueForKey(kConnectParamQuery));
939+
if (!queryStr.empty())
940+
if (queryStr[0] == '?')
941+
queryStr.erase(0,1); // Remove leading '?'
942+
PLGDBG("Query: '" << queryStr << "'");
943+
const NTV2StringList strs(aja::split(queryStr, "&"));
944+
for (NTV2StringListConstIter it(strs.begin()); it != strs.end(); ++it)
945+
{
946+
string str(*it), key, value;
947+
if (str.find("=") == string::npos)
948+
{ // No assignment (i.e. no '=') --- just insert key with empty value...
949+
key = aja::lower(str);
950+
outQueryParams.insert(key, value);
951+
PLGDBG("'" << key << "' = ''");
952+
continue;
953+
}
954+
NTV2StringList pieces(aja::split(str,"="));
955+
if (pieces.empty())
956+
continue;
957+
key = aja::lower(pieces.at(0));
958+
if (pieces.size() > 1)
959+
value = pieces.at(1);
960+
if (key.empty())
961+
{PLGWARN("Empty key '" << key << "'"); continue;}
962+
if (outQueryParams.hasKey(key))
963+
PLGDBG("Param '" << key << "' value '" << outQueryParams.valueForKey(key) << "' to be replaced with '" << value << "'");
964+
outQueryParams.insert(key, ::PercentDecode(value));
965+
PLGDBG("'" << key << "' = '" << outQueryParams.valueForKey(key) << "'");
966+
} // for each &param
967+
return true;
968+
} // ParseQueryParams
969+
934970
bool NTV2DeviceSpecParser::IsUpperLetter (const char inChar)
935971
{ static const string sHexDigits("_ABCDEFGHIJKLMNOPQRSTUVWXYZ");
936972
return sHexDigits.find(inChar) != string::npos;
@@ -1616,42 +1652,6 @@ bool NTV2PluginLoader::ExtractIssuerInfo (NTV2Dictionary & outInfo, const string
16161652
return true;
16171653
} // ExtractIssuerInfo
16181654

1619-
bool NTV2DeviceSpecParser::ParseQueryParams (const NTV2Dictionary & inSrcDict, NTV2Dictionary & outQueryParams)
1620-
{
1621-
if (!inSrcDict.hasKey(kConnectParamQuery))
1622-
return true; // It's not an error if there's no 'query' in srcDict
1623-
string queryStr(inSrcDict.valueForKey(kConnectParamQuery));
1624-
if (!queryStr.empty())
1625-
if (queryStr[0] == '?')
1626-
queryStr.erase(0,1); // Remove leading '?'
1627-
PLGDBG("Query: '" << queryStr << "'");
1628-
const NTV2StringList strs(aja::split(queryStr, "&"));
1629-
for (NTV2StringListConstIter it(strs.begin()); it != strs.end(); ++it)
1630-
{
1631-
string str(*it), key, value;
1632-
if (str.find("=") == string::npos)
1633-
{ // No assignment (i.e. no '=') --- just insert key with empty value...
1634-
key = aja::lower(str);
1635-
outQueryParams.insert(key, value);
1636-
PLGDBG("'" << key << "' = ''");
1637-
continue;
1638-
}
1639-
NTV2StringList pieces(aja::split(str,"="));
1640-
if (pieces.empty())
1641-
continue;
1642-
key = aja::lower(pieces.at(0));
1643-
if (pieces.size() > 1)
1644-
value = pieces.at(1);
1645-
if (key.empty())
1646-
{PLGWARN("Empty key '" << key << "'"); continue;}
1647-
if (outQueryParams.hasKey(key))
1648-
PLGDBG("Param '" << key << "' value '" << outQueryParams.valueForKey(key) << "' to be replaced with '" << value << "'");
1649-
outQueryParams.insert(key, ::PercentDecode(value));
1650-
PLGDBG("'" << key << "' = '" << outQueryParams.valueForKey(key) << "'");
1651-
} // for each &param
1652-
return true;
1653-
} // ParseQueryParams
1654-
16551655
void * NTV2PluginLoader::getSymbolAddress (const string & inSymbolName, string & outErrorMsg)
16561656
{
16571657
outErrorMsg.clear();

0 commit comments

Comments
 (0)