コード例 #1
0
void CConfigAppearance::AddFontName(std::wstring_view Name)		// // //
{
	if (Name.size() >= LF_FACESIZE)		// // //
		return;

	CComboBox *pFontList = static_cast<CComboBox*>(GetDlgItem(IDC_FONT));

	pFontList->AddString(Name.data());

	if (m_strFont == Name)
		pFontList->SelectString(0, Name.data());
}
コード例 #2
0
ファイル: utils.cpp プロジェクト: KDE/snoretoast
std::unordered_map<std::wstring_view, std::wstring_view> splitData(const std::wstring_view &data)
{
    std::unordered_map<std::wstring_view, std::wstring_view> out;
    size_t start = 0;
    for (size_t end = data.find(L";", start); end != std::wstring::npos;
         start = end + 1, end = data.find(L";", start)) {
        if (start == end) {
            end = data.size();
        }
        const std::wstring_view tmp(data.data() + start, end - start);
        const auto pos = tmp.find(L"=");
        out[tmp.substr(0, pos)] = tmp.substr(pos + 1);
        // tLog << L"'" << tmp.substr(0, pos) << L"' = '" << tmp.substr(pos + 1) << L"'";
    }
    return out;
}