| 69 | } |
| 70 | |
| 71 | std::vector<CString> IniFile::ReadSection(PCWSTR section) { |
| 72 | WCHAR buffer[1 << 10]; |
| 73 | std::vector<CString> names; |
| 74 | if (0 == ::GetPrivateProfileSection(section, buffer, _countof(buffer), _path)) |
| 75 | return names; |
| 76 | |
| 77 | names.reserve(8); |
| 78 | for (auto p = buffer; *p;) { |
| 79 | names.push_back(p); |
| 80 | // back���һ��Ԫ�� |
| 81 | p += names.back().GetLength() + 1; |
| 82 | } |
| 83 | return names; |
| 84 | } |
| 85 | |
| 86 | bool IniFile::WriteString(PCWSTR section, PCWSTR name, PCWSTR value) { |
| 87 | return ::WritePrivateProfileString(section, name, value, _path); |
no test coverage detected