| 201 | } |
| 202 | |
| 203 | void IncludeProcessor::processInclude(std::string & include, CompositeStringSource * compositeSource, std::stringstream & destinationstream) |
| 204 | { |
| 205 | if (m_includes.count(include) > 0) |
| 206 | { |
| 207 | return; |
| 208 | } |
| 209 | |
| 210 | m_includes.insert(include); |
| 211 | compositeSource->appendSource(new StaticStringSource(destinationstream.str())); |
| 212 | |
| 213 | NamedString * namedString = nullptr; |
| 214 | if (startsWith(include, '/')) |
| 215 | { |
| 216 | namedString = NamedString::obtain(include); |
| 217 | } |
| 218 | else |
| 219 | { |
| 220 | for (const std::string & prefix : m_includePaths) |
| 221 | { |
| 222 | namedString = NamedString::obtain(expandPath(include, prefix)); |
| 223 | if (namedString) |
| 224 | { |
| 225 | break; |
| 226 | } |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | if (namedString) |
| 231 | { |
| 232 | compositeSource->appendSource(processComposite(namedString->stringSource())); |
| 233 | } |
| 234 | else |
| 235 | { |
| 236 | warning() << "Did not find include " << include; |
| 237 | } |
| 238 | |
| 239 | destinationstream.str(""); |
| 240 | } |
| 241 | |
| 242 | std::string IncludeProcessor::expandPath(const std::string& include, const std::string & includePath) |
| 243 | { |
nothing calls this directly
no test coverage detected