| 139 | } |
| 140 | |
| 141 | class StringArray |
| 142 | { |
| 143 | public: |
| 144 | void add(const std::string& str) |
| 145 | { |
| 146 | strings.push_back(str); |
| 147 | ptrs.push_back(strings.back().c_str()); |
| 148 | } |
| 149 | |
| 150 | void clear() |
| 151 | { |
| 152 | strings.clear(); |
| 153 | ptrs.clear(); |
| 154 | } |
| 155 | |
| 156 | const char** c_str() |
| 157 | { |
| 158 | return ptrs.data(); |
| 159 | } |
| 160 | |
| 161 | bool empty() |
| 162 | { |
| 163 | return ptrs.empty(); |
| 164 | } |
| 165 | |
| 166 | size_t size() |
| 167 | { |
| 168 | return ptrs.size(); |
| 169 | } |
| 170 | |
| 171 | private: |
| 172 | std::vector<std::string> strings; |
| 173 | std::vector<const char*> ptrs; |
| 174 | }; |
| 175 | |
| 176 | int wmain(int argc, wchar_t *argv[]) { |
| 177 | if (argc < 2) { |
nothing calls this directly
no outgoing calls
no test coverage detected