const std::string& CAIInterfaceLibraryInfo::GetDescriptionAt(size_t index) const { if (index < keys.size()) { return key_description.find(GetKeyAt(index))->second; } else { return DEFAULT_VALUE; } }
const std::string& CSkirmishAILibraryInfo::GetDescriptionAt(size_t index) const { if (index < info_keys.size()) { return info_key_description.find(GetKeyAt(index))->second; } else { return DEFAULT_VALUE; } }
STDMETHODIMP IDSMPropertyBagImpl::GetPropertyInfo(ULONG iProperty, ULONG cProperties, PROPBAG2* pPropBag, ULONG* pcProperties) { CheckPointer(pPropBag, E_POINTER); CheckPointer(pcProperties, E_POINTER); for(ULONG i = 0; i < cProperties; i++, iProperty++, (*pcProperties)++) { CStringW key = GetKeyAt(iProperty); pPropBag[i].pstrName = (BSTR)CoTaskMemAlloc((key.GetLength()+1)*sizeof(WCHAR)); if(!pPropBag[i].pstrName) return E_FAIL; wcscpy_s(pPropBag[i].pstrName, key.GetLength()+1, key); } return S_OK; }
void CDSMMuxerFilter::MuxFileInfo(IBitStream* pBS) { int len = 1; CSimpleMap<CStringA, CStringA> si; for (int i = 0; i < GetSize(); i++) { CStringA key = CStringA(CString(GetKeyAt(i))), value = UTF16To8(GetValueAt(i)); if (key.GetLength() != 4) { continue; } si.Add(key, value); len += 4 + value.GetLength() + 1; } MuxPacketHeader(pBS, DSMP_FILEINFO, len); pBS->BitWrite(DSMF_VERSION, 8); for (int i = 0; i < si.GetSize(); i++) { CStringA key = si.GetKeyAt(i), value = si.GetValueAt(i); pBS->ByteWrite((LPCSTR)key, 4); pBS->ByteWrite((LPCSTR)value, value.GetLength() + 1); } }
/** * Return the key at the current position */ CString CScintillaBibWnd::GetCurrentKey() { long lPos = SendMessage(SCI_GETCURRENTPOS, 0, 0); return GetKeyAt(lPos); }