MCPcopy Create free account
hub / github.com/Persper/code-analytics / Load

Method Load

test/cpp_test_repo/D/TextFileParsers.cpp:77–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77void ConfigurationParser::Load(istream& inputStream)
78{
79 string buffer{};
80 stringstream ss{};
81 size_t lineNumber = 0;
82 while (getline(inputStream, buffer))
83 {
84 lineNumber++;
85 ss.clear();
86 ss.str(buffer);
87 string key{};
88 char ch;
89 if (!(ss >> key)) continue;
90 if (key[0] == '#') continue;
91 if (!(ss >> ch) || ch != '=')
92 throw Exception("������������������=������" + to_string(lineNumber) + "��");
93 string value{};
94 if (!(ss >> value))
95 throw Exception("��Ч�������С�����������ֵ���У�" + to_string(lineNumber) + "��");
96 // ISSUE Ŀǰ����ֵ�в��ܰ����ո񣬷�����ڿո񴦽ضϡ�
97 entries[key] = value;
98 }
99}
100
101std::string ConfigurationParser::GetString(const std::string& key, const std::string& defaultValue) const
102{

Callers

nothing calls this directly

Calls 3

ExceptionClass · 0.70
to_stringFunction · 0.70
clearMethod · 0.45

Tested by

no test coverage detected