/////////////////////////////////////////////////////////////// // 读StringList结点 bool ScanParamXML::ReadStringListNode( IXMLDOMNode *const pTheNode, VectorOfString &vStr ) { if( NULL == pTheNode ) { return false; } try { vStr.clear(); // 初始化输出参数 _variant_t varVal = 0; IXMLDOMNode *pIpSeedNode; for( pTheNode->get_firstChild( &pIpSeedNode ); pIpSeedNode != NULL; pIpSeedNode->get_nextSibling( &pIpSeedNode ) ) { varVal = ReadNodeText( pIpSeedNode ); //cout << "Seed IP: " << _bstr_t( varVal.bstrVal ).operator char *() << endl; vStr.push_back( _bstr_t( varVal.bstrVal ).operator char *() ); } } catch( ... ) { return false; } return true; }
/* Image filtering on save/load */ void applyCustomFilter(PLBmp & theBitmap, const VectorOfString & theFilterName, const VectorOfVectorOfFloat & theFilterparams) { if (theFilterName.size() != theFilterparams.size()) { throw ImageLoaderException(std::string("Sorry, filter and params count do not match."), PLUS_FILE_LINE); } for (VectorOfString::size_type myFilterIndex = 0; myFilterIndex < theFilterName.size(); myFilterIndex++) { applyCustomFilter(theBitmap, theFilterName[myFilterIndex], theFilterparams[myFilterIndex]); } }
void XPosixEnvironmentVariables::GetKeys(VectorOfString& outKeys, VError& outError) { outError = VE_OK; for (sLONG i = 0; environ[i] != NULL; ++i) { const char* var = environ[i]; const char* s = strchr(var, '='); const sLONG varLength = s ? s - var : strlen(var); VString key(var, varLength, VTC_UTF_8); outKeys.push_back(key); } }